query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
list
label_sequence
list
Unused import
Impactstory/total-impact-core/test/unit_tests/providers/test_blog_post.py
[ { "content": "from test.unit_tests.providers import common\nfrom test.unit_tests.providers.common import ProviderTestCase\nfrom totalimpact.providers.provider import Provider, ProviderContentMalformedError\nfrom test.utils import http\n\nimport os\nimport collections\nimport json\nfrom nose.tools import assert_equals, assert_items_equal, raises, nottest\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestBlog_post(ProviderTestCase):\n\n provider_name = \"blog_post\"\n\n testitem_aliases = ('blog_post', json.dumps({\"post_url\": \"http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/\", \"blog_url\": \"http://researchremix.wordpress.com\"}))\n testitem_aliases_not_wordpress_com = ('blog_post', json.dumps({\"post_url\": \"http://jasonpriem.org/2012/05/toward-a-second-revolution-altmetrics-total-impact-and-the-decoupled-journal-video/\", \"blog_url\": \"http://jasonpriem.org/blog\"}))\n api_key = os.environ[\"WORDPRESS_OUR_BLOG_API_KEY\"]\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestBlog_post", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def setUp(self):\n ProviderTestCase.setUp(self) ", "metadata": "root.TestBlog_post.setUp", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 18 }, { "content": " def test_is_relevant_alias(self):\n # ensure that it matches an appropriate ids\n assert_equals(self.provider.is_relevant_alias(self.testitem_aliases), True)\n\n assert_equals(self.provider.is_relevant_alias((\"url\", \"https://twitter.com/researchremix/status/400821465828061184\")), False)", "metadata": "root.TestBlog_post.test_is_relevant_alias", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 21 }, { "content": " @http\n def test_aliases_wordpress_com(self):\n response = self.provider.aliases([self.testitem_aliases])\n print response\n expected = [('url', u'http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/'), ('wordpress_blog_post', '{\"post_url\": \"http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/\", \"blog_url\": \"http://researchremix.wordpress.com\", \"wordpress_post_id\": 1119}')]\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_aliases_wordpress_com", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 28 }, { "content": " @http\n def test_aliases_not_wordpress(self):\n response = self.provider.aliases([('blog_post', json.dumps({\"post_url\": \"http://jasonpriem.com/cv\", \"blog_url\": \"jasonpriem.com\"}))])\n print response\n expected = [('url', u'http://jasonpriem.com/cv')]\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_aliases_not_wordpress", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 35 }, { "content": " @http\n def test_biblio_wordpress(self):\n response = self.provider.biblio([self.testitem_aliases])\n print response\n expected = {'url': u'http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/', 'account': u'researchremix.wordpress.com', 'hosting_platform': 'wordpress.com', 'blog_title': 'Research Remix', 'title': 'Elsevier agrees UBC researchers can text-mine for citizen science, research tools'}\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_biblio_wordpress", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": " @http\n def test_biblio_wordpress(self):\n response = self.provider.biblio([self.testitem_aliases])\n print response\n expected = {'url': u'http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/', 'account': u'researchremix.wordpress.com', 'hosting_platform': 'wordpress.com', 'blog_title': 'Research Remix', 'title': 'Elsevier agrees UBC researchers can text-mine for citizen science, research tools'}\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_biblio_wordpress", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 50 }, { "content": " @http\n def test_biblio_not_wordpress2(self):\n test_alias = ('blog_post', \"{\\\"post_url\\\": \\\"http://researchremix.wordpress.com/2011/08/10/personal\\\", \\\"blog_url\\\": \\\"http://researchremix.wordpress.com\\\"}\")\n response = self.provider.biblio([test_alias])\n print response\n expected = {'url': u'http://researchremix.wordpress.com/2011/08/10/personal', 'account': u'researchremix.wordpress.com', 'hosting_platform': 'wordpress.com', 'blog_title': 'Research Remix', 'title': 'Cancer data: it just got personal'}\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_biblio_not_wordpress2", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 57 }, { "content": " @http\n @nottest\n def test_metrics(self):\n wordpress_aliases = [('url', u'http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/'), ('wordpress_blog_post', '{\"post_url\": \"http://researchremix.wordpress.com/2012/04/17/elsevier-agrees/\", \"blog_url\": \"researchremix.wordpress.com\", \"wordpress_post_id\": 1119}')]\n response = self.provider.metrics(wordpress_aliases)\n print response\n expected = {}\n assert_equals(response, expected)", "metadata": "root.TestBlog_post.test_metrics", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 65 }, { "content": " def test_provider_aliases_400(self):\n pass", "metadata": "root.TestBlog_post.test_provider_aliases_400", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_provider_aliases_500(self):\n pass", "metadata": "root.TestBlog_post.test_provider_aliases_500", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 77 }, { "content": " def test_provider_biblio_400(self):\n pass", "metadata": "root.TestBlog_post.test_provider_biblio_400", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 80 }, { "content": " def test_provider_biblio_500(self):\n pass", "metadata": "root.TestBlog_post.test_provider_biblio_500", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 82 }, { "content": " def test_provider_metrics_400(self):\n pass", "metadata": "root.TestBlog_post.test_provider_metrics_400", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 85 }, { "content": " def test_provider_metrics_500(self):\n pass", "metadata": "root.TestBlog_post.test_provider_metrics_500", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " def test_provider_metrics_empty(self):\n pass", "metadata": "root.TestBlog_post.test_provider_metrics_empty", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 89 }, { "content": " def test_provider_metrics_nonsense_txt(self):\n pass", "metadata": "root.TestBlog_post.test_provider_metrics_nonsense_txt", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 91 }, { "content": " def test_provider_metrics_nonsense_xml(self):\n pass", "metadata": "root.TestBlog_post.test_provider_metrics_nonsense_xml", "header": "['class', 'TestBlog_post', '(', 'ProviderTestCase', ')', ':', '___EOS___']", "index": 93 } ]
[ { "span": "from test.unit_tests.providers import common", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 44 }, { "span": "from totalimpact.providers.provider import Provider, ProviderContentMalformedError", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 82 }, { "span": "import collections", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 18 }, { "span": "from nose.tools import assert_equals, assert_items_equal, raises, nottest", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 73 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "test_", "._", "unit", "\\u", "tests_", "._", "providers_", "import_", "common_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "unit", "\\u", "tests_", "._", "providers_", "._", "common_", "import_", "Provider", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "total", "impact", "_", "._", "providers_", "._", "provider_", "import_", "Provider_", ",_", "Provider", "Conten", "t", "Mal", "formed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test_", "._", "utils_", "import_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "equals_", ",_", "assert", "\\u", "items", "\\u", "equal_", ",_", "raises_", ",_", "not", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "provide", "r", "\\u", "name_", "=_", "\"", "blog", "\\u", "post", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "testi", "tem", "\\u", "aliases_", "=_", "(_", "'", "blog", "\\u", "post", "'_", ",_", "json_", "._", "dumps_", "(_", "{_", "\"", "post", "\\u", "url", "\"_", ":_", "\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/\"_", ",_", "\"", "blog", "\\u", "url", "\"_", ":_", "\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "\"_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testi", "tem", "\\u", "alias", "es", "\\u", "not", "\\u", "wordpress", "\\u", "com_", "=_", "(_", "'", "blog", "\\u", "post", "'_", ",_", "json_", "._", "dumps_", "(_", "{_", "\"", "post", "\\u", "url", "\"_", ":_", "\"", "http", "://", "jas", "onp", "rie", "m", ".", "org", "/", "2012", "/", "05", "/", "tow", "ard", "-", "a", "-", "second", "-", "revo", "luti", "on", "-", "alt", "metric", "s", "-", "total", "-", "impact", "-", "and", "-", "the", "-", "deco", "uple", "d", "-", "journal", "-", "video", "/\"_", ",_", "\"", "blog", "\\u", "url", "\"_", ":_", "\"", "http", "://", "jas", "onp", "rie", "m", ".", "org", "/", "blog", "\"_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api", "\\u", "key_", "=_", "os_", "._", "environ_", "[_", "\"", "WORD", "PRESS", "\\u", "OUR", "\\u", "BLO", "G", "\\u", "API", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Provider", "Test", "Case_", "._", "set", "Up_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ensure", " ", "tha", "t", " ", "it", " ", "matche", "s", " ", "an", " ", "appropr", "iate", " ", "ids_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equals_", "(_", "self_", "._", "provider_", "._", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "self_", "._", "testi", "tem", "\\u", "aliases_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "self_", "._", "provider_", "._", "is", "\\u", "rele", "van", "t", "\\u", "alias_", "(_", "(_", "\"", "url", "\"_", ",_", "\"", "https", "://", "twit", "ter", ".", "com", "/", "research", "remi", "x", "/", "status", "/", "400", "821", "465", "828", "061", "184", "\"_", ")_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "alias", "es", "\\u", "wordpress", "\\u", "com_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "provider_", "._", "aliases_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "aliases_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "(_", "'", "url", "'_", ",_", "u", "'", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/'_", ")_", ",_", "(_", "'", "wordpress", "\\u", "blog", "\\u", "post", "'_", ",_", "'{", "\"", "post", "\\u", "url", "\":", " ", "\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/\"", ",", " ", "\"", "blog", "\\u", "url", "\":", " ", "\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "\",", " ", "\"", "wordpress", "\\u", "post", "\\u", "id", "\":", " ", "111", "9", "}'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "alias", "es", "\\u", "not", "\\u", "wordpress", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "provider_", "._", "aliases_", "(_", "[_", "(_", "'", "blog", "\\u", "post", "'_", ",_", "json_", "._", "dumps_", "(_", "{_", "\"", "post", "\\u", "url", "\"_", ":_", "\"", "http", "://", "jas", "onp", "rie", "m", ".", "com", "/", "cv", "\"_", ",_", "\"", "blog", "\\u", "url", "\"_", ":_", "\"", "jas", "onp", "rie", "m", ".", "com", "\"_", "}_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "[_", "(_", "'", "url", "'_", ",_", "u", "'", "http", "://", "jas", "onp", "rie", "m", ".", "com", "/", "cv", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "biblio", "\\u", "wordpress", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "provider_", "._", "biblio", "_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "aliases_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "url", "'_", ":_", "u", "'", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/'_", ",_", "'", "account", "'_", ":_", "u", "'", "research", "remi", "x", ".", "wordpress", ".", "com", "'_", ",_", "'", "hostin", "g", "\\u", "platform", "'_", ":_", "'", "wordpress", ".", "com", "'_", ",_", "'", "blog", "\\u", "title", "'_", ":_", "'", "Rese", "arch", " ", "Remi", "x", "'_", ",_", "'", "title", "'_", ":_", "'", "Else", "vie", "r", " ", "agree", "s", " ", "UB", "C", " ", "research", "ers", " ", "can", " ", "text", "-", "mine", " ", "for", " ", "citi", "zen", " ", "scie", "nce", ",", " ", "research", " ", "tool", "s", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "biblio", "\\u", "wordpress", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "provider_", "._", "biblio", "_", "(_", "[_", "self_", "._", "testi", "tem", "\\u", "aliases_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "url", "'_", ":_", "u", "'", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/'_", ",_", "'", "account", "'_", ":_", "u", "'", "research", "remi", "x", ".", "wordpress", ".", "com", "'_", ",_", "'", "hostin", "g", "\\u", "platform", "'_", ":_", "'", "wordpress", ".", "com", "'_", ",_", "'", "blog", "\\u", "title", "'_", ":_", "'", "Rese", "arch", " ", "Remi", "x", "'_", ",_", "'", "title", "'_", ":_", "'", "Else", "vie", "r", " ", "agree", "s", " ", "UB", "C", " ", "research", "ers", " ", "can", " ", "text", "-", "mine", " ", "for", " ", "citi", "zen", " ", "scie", "nce", ",", " ", "research", " ", "tool", "s", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "biblio", "\\u", "not", "\\u", "wordpress", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test\\u", "alias_", "=_", "(_", "'", "blog", "\\u", "post", "'_", ",_", "\"{\\\\", "\"", "post", "\\u", "url", "\\\\\":", " ", "\\\\\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2011", "/", "0", "8", "/", "10", "/", "persona", "l", "\\\\\",", " ", "\\\\\"", "blog", "\\u", "url", "\\\\\":", " ", "\\\\\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "\\\\\"", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "provider_", "._", "biblio", "_", "(_", "[_", "test\\u", "alias_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "'", "url", "'_", ":_", "u", "'", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2011", "/", "0", "8", "/", "10", "/", "persona", "l", "'_", ",_", "'", "account", "'_", ":_", "u", "'", "research", "remi", "x", ".", "wordpress", ".", "com", "'_", ",_", "'", "hostin", "g", "\\u", "platform", "'_", ":_", "'", "wordpress", ".", "com", "'_", ",_", "'", "blog", "\\u", "title", "'_", ":_", "'", "Rese", "arch", " ", "Remi", "x", "'_", ",_", "'", "title", "'_", ":_", "'", "Can", "cer", " ", "data", ":", " ", "it", " ", "just", " ", "got", " ", "persona", "l", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "not", "test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "metrics_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wordpress", "\\u", "aliases_", "=_", "[_", "(_", "'", "url", "'_", ",_", "u", "'", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/'_", ")_", ",_", "(_", "'", "wordpress", "\\u", "blog", "\\u", "post", "'_", ",_", "'{", "\"", "post", "\\u", "url", "\":", " ", "\"", "http", "://", "research", "remi", "x", ".", "wordpress", ".", "com", "/", "2012", "/", "04", "/", "1", "7", "/", "else", "vie", "r", "-", "agree", "s", "/\"", ",", " ", "\"", "blog", "\\u", "url", "\":", " ", "\"", "research", "remi", "x", ".", "wordpress", ".", "com", "\",", " ", "\"", "wordpress", "\\u", "post", "\\u", "id", "\":", " ", "111", "9", "}'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "provider_", "._", "metrics_", "(_", "wordpress", "\\u", "aliases_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equals_", "(_", "response_", ",_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "alias", "es", "\\u", "400_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "alias", "es", "\\u", "500_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "biblio", "\\u", "400_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "biblio", "\\u", "500_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "metric", "s", "\\u", "400_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "metric", "s", "\\u", "500_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "metric", "s", "\\u", "empty_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "metric", "s", "\\u", "nons", "ense", "\\u", "txt_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Blog", "\\u", "post_", "(_", "Provider", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "provide", "r", "\\u", "metric", "s", "\\u", "nons", "ense", "\\u", "xml_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 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 ]
Unused import
snare/voltron/tests/http_api_tests.py
[ { "content": "\"\"\"\nTests that emulate the debugger adaptor and just test the interaction between\nthe front end and back end API classes. HTTP edition!\n\nTests:\nServer (via HTTP)\n\"\"\"\n\nimport logging\nimport sys\nimport json\nimport time\nimport subprocess\n\nfrom nose.tools import *\n\nimport voltron\nfrom voltron.core import *\nfrom voltron.api import *\nfrom voltron.plugin import *\n\nimport platform\nif platform.system() == 'Darwin':\n sys.path.append(\"/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python\")\n\nfrom .common import *\n\nimport requests\n\n\nlog = logging.getLogger('tests')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class APIHostNotSupportedRequest(APIRequest):", "metadata": "root.APIHostNotSupportedRequest", "header": "['module', '___EOS___']", "index": 33 }, { "content": " @server_side\n def dispatch(self):\n return APIDebuggerHostNotSupportedErrorResponse()", "metadata": "root.APIHostNotSupportedRequest.dispatch", "header": "['class', 'APIHostNotSupportedRequest', '(', 'APIRequest', ')', ':', '___EOS___']", "index": 34 }, { "content": "class APIHostNotSupportedPlugin(APIPlugin):\n request = \"host_not_supported\"\n request_class = APIHostNotSupportedRequest\n response_class = APIResponse", "metadata": "root.APIHostNotSupportedPlugin", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def setup():\n global server, client, target, pm, adaptor, methods\n\n log.info(\"setting up API tests\")\n\n # set up voltron\n voltron.setup_env()\n voltron.config['server'] = {\n \"listen\": {\n \"tcp\": [\"127.0.0.1\", 5555]\n }\n }\n pm = PluginManager()\n plugin = pm.debugger_plugin_for_host('mock')\n adaptor = plugin.adaptor_class()\n voltron.debugger = adaptor\n\n # inject mock methods\n inject_mock(adaptor)\n\n # start up a voltron server\n server = Server()\n server.start()\n\n time.sleep(2)", "metadata": "root.setup", "header": "['module', '___EOS___']", "index": 45 }, { "content": "def teardown():\n server.stop()\n time.sleep(2)", "metadata": "root.teardown", "header": "['module', '___EOS___']", "index": 72 }, { "content": "def test_disassemble():\n data = requests.get('http://localhost:5555/api/disassemble?count=16').text\n res = APIResponse(data=data)\n assert res.is_success\n assert res.disassembly == disassemble_response", "metadata": "root.test_disassemble", "header": "['module', '___EOS___']", "index": 77 }, { "content": "def test_command():\n data = requests.get('http://localhost:5555/api/command?command=reg%20read').text\n res = APIResponse(data=data)\n assert res.is_success\n assert res.output == command_response", "metadata": "root.test_command", "header": "['module', '___EOS___']", "index": 84 }, { "content": "def test_targets():\n data = requests.get('http://localhost:5555/api/targets').text\n res = api_response('targets', data=data)\n assert res.is_success\n assert res.targets == targets_response", "metadata": "root.test_targets", "header": "['module', '___EOS___']", "index": 91 }, { "content": "def test_memory():\n data = requests.get('http://localhost:5555/api/registers').text\n res = api_response('registers', data=data)\n url = 'http://localhost:5555/api/memory?address={}&length=64'.format(res.registers['rip'])\n data = requests.get(url).text\n res = api_response('memory', data=data)\n assert res.is_success\n assert res.memory == memory_response", "metadata": "root.test_memory", "header": "['module', '___EOS___']", "index": 98 }, { "content": "def test_registers():\n data = requests.get('http://localhost:5555/api/registers').text\n res = api_response('registers', data=data)\n assert res.is_success\n assert res.registers == registers_response", "metadata": "root.test_registers", "header": "['module', '___EOS___']", "index": 108 }, { "content": "def test_stack_length_missing():\n data = requests.get('http://localhost:5555/api/stack').text\n res = APIErrorResponse(data=data)\n assert res.is_error\n assert res.message == 'length'", "metadata": "root.test_stack_length_missing", "header": "['module', '___EOS___']", "index": 115 }, { "content": "def test_stack():\n data = requests.get('http://localhost:5555/api/stack?length=64').text\n res = api_response('stack', data=data)\n assert res.is_success\n assert res.memory == stack_response", "metadata": "root.test_stack", "header": "['module', '___EOS___']", "index": 122 }, { "content": "def test_state():\n data = requests.get('http://localhost:5555/api/state').text\n res = api_response('state', data=data)\n assert res.is_success\n assert res.state == state_response", "metadata": "root.test_state", "header": "['module', '___EOS___']", "index": 129 }, { "content": "def test_version():\n data = requests.get('http://localhost:5555/api/version').text\n res = api_response('version', data=data)\n assert res.is_success\n assert res.api_version == 1.1\n assert res.host_version == 'lldb-something'", "metadata": "root.test_version", "header": "['module', '___EOS___']", "index": 136 }, { "content": "def test_bad_json():\n data = requests.post('http://localhost:5555/api/request', data='xxx').text\n res = APIResponse(data=data)\n assert res.is_error\n assert res.code == 0x1001", "metadata": "root.test_bad_json", "header": "['module', '___EOS___']", "index": 144 }, { "content": "def test_bad_request():\n data = requests.post('http://localhost:5555/api/request', data='{\"type\":\"request\",\"request\":\"no_such_request\"}').text\n res = APIResponse(data=data)\n assert res.is_error\n assert res.code == 0x1002", "metadata": "root.test_bad_request", "header": "['module', '___EOS___']", "index": 151 }, { "content": "def test_breakpoints():\n data = requests.get('http://localhost:5555/api/breakpoints').text\n res = api_response('breakpoints', data=data)\n assert res.is_success\n assert res.breakpoints == breakpoints_response", "metadata": "root.test_breakpoints", "header": "['module', '___EOS___']", "index": 158 } ]
[ { "span": "import json", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 11 }, { "span": "import subprocess", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 17 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Test", "s", " ", "tha", "t", " ", "emulate", " ", "the", " ", "debugg", "er", " ", "adapt", "or", " ", "and", " ", "just", " ", "test", " ", "the", " ", "interacti", "on", " ", "bet", "ween", "\\", "10", ";", "the", " ", "front", " ", "end", " ", "and", " ", "back", " ", "end", " ", "API", " ", "classe", "s", ".", " ", "HTTP", " ", "edition", "!", "\\", "10", ";", "\\", "10", ";", "Test", "s", ":", "\\", "10", ";", "Server", " ", "(", "via", " ", "HTTP", ")", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "volt", "ron", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "volt", "ron", "_", "._", "core_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "volt", "ron", "_", "._", "api_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "volt", "ron", "_", "._", "plugin_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "platform_", "._", "system_", "(_", ")_", "==_", "'", "Dar", "win", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "path_", "._", "append_", "(_", "\"/", "Applica", "tion", "s", "/", "Xco", "de", ".", "app", "/", "Conten", "ts", "/", "Share", "d", "Frame", "works", "/", "LL", "DB", ".", "frame", "work", "/", "Reso", "urc", "es", "/", "Pyth", "on", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "._", "common_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "requests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "tests", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "API", "Host", "Not", "Supp", "orte", "d", "Request_", "(_", "API", "Request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "API", "Host", "Not", "Supp", "orte", "d", "Request_", "(_", "API", "Request_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "server", "\\u", "side_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "API", "Debugger", "Host", "Not", "Supp", "orte", "d", "Error", "Response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "API", "Host", "Not", "Supp", "orte", "d", "Plugin_", "(_", "API", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "=_", "\"", "host", "\\u", "not", "\\u", "support", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request", "\\u", "class_", "=_", "API", "Host", "Not", "Supp", "orte", "d", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response", "\\u", "class_", "=_", "API", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setup_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "server_", ",_", "client_", ",_", "target_", ",_", "pm_", ",_", "adaptor_", ",_", "methods_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "setti", "ng", " ", "up", " ", "API", " ", "tests", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "volt", "ron", "_", "\\u\\u\\uNL\\u\\u\\u_", "volt", "ron", "_", "._", "setup", "\\u", "env_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "volt", "ron", "_", "._", "config_", "[_", "'", "server", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "listen", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tcp", "\"_", ":_", "[_", "\"", "127", ".0", ".0", ".1", "\"_", ",_", "5555", "_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pm_", "=_", "Plug", "in", "Manager_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugin_", "=_", "pm_", "._", "debugg", "er", "\\u", "plugin", "\\u", "for", "\\u", "host_", "(_", "'", "mock", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adaptor_", "=_", "plugin_", "._", "adapt", "or", "\\u", "class_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "volt", "ron", "_", "._", "debugger_", "=_", "adaptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inject", " ", "mock", " ", "methods_", "\\u\\u\\uNL\\u\\u\\u_", "inject", "\\u", "mock_", "(_", "adaptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "up", " ", "a", " ", "volt", "ron", " ", "server_", "\\u\\u\\uNL\\u\\u\\u_", "server_", "=_", "Server_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "teardown_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "disassembl", "e_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "disassembl", "e", "?", "count", "=", "16", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Response_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "disassembl", "y_", "==_", "disassembl", "e\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "command_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "command", "?", "command", "=", "reg", "%", "20", "read", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Response_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "output_", "==_", "command", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "targets_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "target", "s", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "target", "s", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "targets_", "==_", "target", "s", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "memory_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "register", "s", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "register", "s", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "memory", "?", "address", "={}", "&", "length", "=", "64", "'_", "._", "format_", "(_", "res_", "._", "registers_", "[_", "'", "rip", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "requests_", "._", "get_", "(_", "url_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "memory", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "memory_", "==_", "memory", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "registers_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "register", "s", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "register", "s", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "registers_", "==_", "register", "s", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stack", "\\u", "length", "\\u", "missing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "stack", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Error", "Response_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "message_", "==_", "'", "length", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stack_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "stack", "?", "length", "=", "64", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "stack", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "memory_", "==_", "stack", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "state_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "state", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "state", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "state_", "==_", "state", "\\u", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "version_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "version", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "version", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "api", "\\u", "version_", "==_", "1.1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "host", "\\u", "version_", "==_", "'", "lldb", "-", "somet", "hing", "'_", "\\u\\u\\uNEWLINE\\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", "bad", "\\u", "json_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "post_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "request", "'_", ",_", "data_", "=_", "'", "xxx", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Response_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "code_", "==_", "0x100", "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_", "test\\u", "bad", "\\u", "request_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "post_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "request", "'_", ",_", "data_", "=_", "'{", "\"", "type", "\":\"", "request", "\",\"", "request", "\":\"", "no", "\\u", "suc", "h", "\\u", "request", "\"}'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "API", "Response_", "(_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "code_", "==_", "0x100", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "breakpoints", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "requests_", "._", "get_", "(_", "'", "http", "://", "local", "host", ":", "5555", "/", "api", "/", "breakpoints", "'_", ")_", "._", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "api", "\\u", "response_", "(_", "'", "breakpoints", "'_", ",_", "data_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "is", "\\u", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "breakpoints", "_", "==_", "breakpoints", "\\u", "response_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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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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 ]
Except block handles 'BaseException'
kylemacfarlane/django-cb-storage-s3/src/cuddlybuddly/storage/s3/cache.py
[ { "content": " def size(self, name):\n try:\n file = open(self._path(name))\n size = int(file.readlines()[1])\n file.close()\n except:\n size = None\n return size", "metadata": "root.FileSystemCache.size", "header": "['class', 'FileSystemCache', '(', 'Cache', ')', ':', '___EOS___']", "index": 69 }, { "content": " def modified_time(self, name):\n try:\n file = open(self._path(name))\n mtime = float(file.readlines()[2])\n file.close()\n except:\n mtime = None\n return mtime", "metadata": "root.FileSystemCache.modified_time", "header": "['class', 'FileSystemCache', '(', 'Cache', ')', ':', '___EOS___']", "index": 78 } ]
[ { "span": "except:", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 15 }, { "span": "except:", "start_line": 83, "start_column": 8, "end_line": 83, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "File", "System", "Cache_", "(_", "Cache_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "size_", "(_", "self_", ",_", "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 ", " _", "file_", "=_", "open_", "(_", "self_", "._", "\\u", "path_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "int_", "(_", "file_", "._", "readlines_", "(_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "File", "System", "Cache_", "(_", "Cache_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "modifi", "ed", "\\u", "time_", "(_", "self_", ",_", "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 ", " _", "file_", "=_", "open_", "(_", "self_", "._", "\\u", "path_", "(_", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mtime_", "=_", "float_", "(_", "file_", "._", "readlines_", "(_", ")_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "file_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mtime_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "mtime_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
First parameter of a method is not named 'self'
jonathanslenders/python-deployer/deployer/host/ssh.py
[ { "content": " def __init__(cls, host_cls):\n pass # Leave __init__ empty, use __new__ for this singleton.", "metadata": "root.SSHBackend.__init__", "header": "['class', 'SSHBackend', '(', 'object', ')', ':', '___EOS___']", "index": 28 } ]
[ { "span": "def __init__(cls, host_cls):", "start_line": 28, "start_column": 4, "end_line": 28, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "SSH", "Backend_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "cls_", ",_", "host", "\\u", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "Leav", "e", " ", "\\u\\u", "init", "\\u\\u", " ", "empty", ",", " ", "use", " ", "\\u\\u", "new", "\\u\\u", " ", "for", " ", "this", " ", "singleton", "._", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
openstack/gertty/gertty/view/project_list.py
[ { "content": " def closeCreateTopic(self, dialog, save):\n if save:\n last_topic_key = None\n for row in self.listbox.body:\n if isinstance(row, TopicRow):\n last_topic_key = row.topic_key\n with self.app.db.getSession() as session:\n if last_topic_key:\n last_topic = session.getTopic(last_topic_key)\n seq = last_topic.sequence + 1\n else:\n seq = 0\n t = session.createTopic(dialog.entry.edit_text, seq)\n self.app.backScreen()", "metadata": "root.ProjectListView.closeCreateTopic", "header": "['class', 'ProjectListView', '(', 'urwid', '.', 'WidgetWrap', ')', ':', '___EOS___']", "index": 387 } ]
[ { "span": "t ", "start_line": 399, "start_column": 16, "end_line": 399, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Project", "List", "View_", "(_", "urwid_", "._", "Wid", "get", "Wrap_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "close", "Creat", "e", "Topic_", "(_", "self_", ",_", "dialog_", ",_", "save_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "save_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "topic", "\\u", "key_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "row_", "in_", "self_", "._", "listbox_", "._", "body_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "row_", ",_", "Topic", "Row_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "last", "\\u", "topic", "\\u", "key_", "=_", "row_", "._", "topic", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "self_", "._", "app_", "._", "db_", "._", "get", "Session_", "(_", ")_", "as_", "session_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "last", "\\u", "topic", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "last", "\\u", "topic_", "=_", "session_", "._", "get", "Topic_", "(_", "last", "\\u", "topic", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seq_", "=_", "last", "\\u", "topic_", "._", "sequence_", "+_", "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 ", " ", "_", "seq_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "session_", "._", "create", "Topic_", "(_", "dialog_", "._", "entry_", "._", "edit", "\\u", "text_", ",_", "seq_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "app_", "._", "back", "Screen_", "(_", ")_", "\\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, 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 ]
Imprecise assert
ufora/ufora/test_scripts/bigbox_perf/disk/testBigboxDiskPerf.py
[ { "content": " def test_disk_scans(self):\n s3 = ActualS3Interface.ActualS3InterfaceFactory()\n objectStore = S3ObjectStore.S3ObjectStore(\n s3,\n Setup.config().userDataS3Bucket,\n prefix=\"test_object_cache/\"\n )\n\n _, simulation = InMemoryCumulusSimulation.computeUsingSeveralWorkers(\n \"1+1\",\n s3,\n 1,\n memoryLimitMb=1 * 1024,\n threadCount=30,\n returnSimulation=True,\n ioTaskThreadOverride=8,\n objectStore=objectStore,\n useInMemoryCache=False #use an actual disk cache for this\n )\n\n try:\n gigabytes = 8\n\n t0 = time.time()\n\n resultVectors = []\n for ix in range(gigabytes):\n result = simulation.compute(\"Vector.range(125000000 + %s)\" % ix, timeout=120)\n resultVectors.append(result.asResult.result)\n\n t1 = time.time()\n\n intResults = []\n for vec in resultVectors:\n result = simulation.compute(\"v.sum()\", timeout = 120, v=vec)\n intResults.append(result.asResult.result.pyval)\n\n\n self.assertTrue(len(intResults) == gigabytes)\n\n PerformanceTestReporter.recordTest(\n \"python.BigBox.Disk.Write.10GB\",\n t1 - t0,\n None\n )\n\n PerformanceTestReporter.recordTest(\n \"python.BigBox.Disk.WriteAndScan.%sGB\" % gigabytes,\n time.time() - t0,\n None\n )\n finally:\n simulation.teardown()", "metadata": "root.BigboxDiskPerformanceTest.test_disk_scans", "header": "['class', 'BigboxDiskPerformanceTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 37 } ]
[ { "span": "self.assertTrue(len(intResults) == gigabytes)", "start_line": 75, "start_column": 12, "end_line": 75, "end_column": 57 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Big", "box", "Disk", "Perform", "anc", "e", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "disk", "\\u", "scans", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s3_", "=_", "Actual", "S", "3", "Interface_", "._", "Actual", "S", "3", "Interface", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "object", "Store_", "=_", "S", "3", "Object", "Store_", "._", "S", "3", "Object", "Store_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Setup_", "._", "config_", "(_", ")_", "._", "user", "Data", "S", "3", "Bucket_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "\"", "test\\u", "object\\u", "cache", "/\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", ",_", "simulation_", "=_", "In", "Memo", "ry", "Cum", "ulus", "Simulation_", "._", "compute", "Us", "ing", "Seve", "ral", "Worke", "rs_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "1", "+", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "memory", "Limit", "Mb", "_", "=_", "1_", "*_", "1024_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thread", "Count_", "=_", "30_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "return", "Simulation_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "io", "Task", "Thread", "Override", "_", "=_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "object", "Store_", "=_", "object", "Store_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "In", "Memo", "ry", "Cache_", "=_", "False_", "#", "use", " ", "an", " ", "actual", " ", "disk", " ", "cache", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "giga", "bytes_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result", "Vectors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ix_", "in_", "range_", "(_", "giga", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "simulation_", "._", "compute_", "(_", "\"", "Vector", ".", "range", "(", "1250", "00000", " ", "+", " ", "%", "s", ")\"_", "%_", "ix_", ",_", "timeout_", "=_", "120_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "Vectors_", "._", "append_", "(_", "result_", "._", "as", "Result_", "._", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t1_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "int", "Results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "vec_", "in_", "result", "Vectors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "simulation_", "._", "compute_", "(_", "\"", "v", ".", "sum", "()\"_", ",_", "timeout_", "=_", "120_", ",_", "v_", "=_", "vec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "int", "Results_", "._", "append_", "(_", "result_", "._", "as", "Result_", "._", "result_", "._", "pyv", "al_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "int", "Results_", ")_", "==_", "giga", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Perform", "anc", "e", "Test", "Reporter_", "._", "record", "Test_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", ".", "Big", "Box", ".", "Disk", ".", "Write", ".1", "0", "GB", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "-_", "t0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Perform", "anc", "e", "Test", "Reporter_", "._", "record", "Test_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "python", ".", "Big", "Box", ".", "Disk", ".", "Write", "And", "Sca", "n", ".", "%", "s", "GB", "\"_", "%_", "giga", "bytes_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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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
enthought/traits/traits/tests/test_event_order.py
[ { "content": " def setUp(self):\n foo = Foo(cause='ORIGINAL')\n bar = Bar(foo=foo, test=self)\n baz = Baz(bar=bar, test=self)\n\n self.events_delivered = []\n foo.cause = 'CHANGE'\n return", "metadata": "root.TestEventOrder.setUp", "header": "['class', 'TestEventOrder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 } ]
[ { "span": "baz ", "start_line": 26, "start_column": 8, "end_line": 26, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Event", "Order_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "foo_", "=_", "Foo_", "(_", "cause_", "=_", "'", "ORIGIN", "AL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bar_", "=_", "Bar_", "(_", "foo_", "=_", "foo_", ",_", "test_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "baz_", "=_", "Baz", "_", "(_", "bar_", "=_", "bar_", ",_", "test_", "=_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "events", "\\u", "deliver", "ed_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "._", "cause_", "=_", "'", "CHANGE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
snare/voltron/voltron/view.py
[ { "content": "from __future__ import print_function\n\nimport os\nimport sys\nimport logging\nimport pprint\nimport re\nimport signal\nimport time\nimport argparse\nimport traceback\nimport subprocess\nfrom requests import ConnectionError\nfrom blessed import Terminal\n\ntry:\n import pygments\n import pygments.lexers\n import pygments.formatters\n have_pygments = True\nexcept:\n have_pygments = False\n\ntry:\n import cursor\nexcept:\n cursor = None\n\nfrom collections import defaultdict\n\nfrom scruffy import Config\n\nfrom .core import *\nfrom .colour import *\nfrom .plugin import *\n\nlog = logging.getLogger(\"view\")\n\nADDR_FORMAT_128 = '0x{0:0=32X}'\nADDR_FORMAT_64 = '0x{0:0=16X}'\nADDR_FORMAT_32 = '0x{0:0=8X}'\nADDR_FORMAT_16 = '0x{0:0=4X}'\nSHORT_ADDR_FORMAT_128 = '{0:0=32X}'\nSHORT_ADDR_FORMAT_64 = '{0:0=16X}'\nSHORT_ADDR_FORMAT_32 = '{0:0=8X}'\nSHORT_ADDR_FORMAT_16 = '{0:0=4X}'\n\n\n# https://gist.github.com/sampsyo/471779\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class AliasedSubParsersAction(argparse._SubParsersAction):\n\n class _AliasedPseudoAction(argparse.Action):\n def __init__(self, name, aliases, help):\n dest = name\n if aliases:\n dest += ' (%s)' % ','.join(aliases)\n sup = super(AliasedSubParsersAction._AliasedPseudoAction, self)\n sup.__init__(option_strings=[], dest=dest, help=help)\n", "metadata": "root.AliasedSubParsersAction", "header": "['module', '___EOS___']", "index": 49 }, { "content": " def add_parser(self, name, **kwargs):\n aliases = kwargs.pop('aliases', [])\n parser = super(AliasedSubParsersAction, self).add_parser(name, **kwargs)\n\n # Make the aliases work.\n for alias in aliases:\n self._name_parser_map[alias] = parser\n # Make the help text reflect them, first removing old help entry.\n if 'help' in kwargs:\n help = kwargs.pop('help')\n self._choices_actions.pop()\n pseudo_action = self._AliasedPseudoAction(name, aliases, help)\n self._choices_actions.append(pseudo_action)\n\n return parser", "metadata": "root.AliasedSubParsersAction.add_parser", "header": "['class', 'AliasedSubParsersAction', '(', 'argparse', '.', '_SubParsersAction', ')', ':', '___EOS___']", "index": 59 }, { "content": "class AnsiString(object):\n\n\n\n", "metadata": "root.AnsiString", "header": "['module', '___EOS___']", "index": 76 }, { "content": " def __init__(self, string):\n chunks = string.split('\\033')\n self.chars = []\n chars = list(chunks[0])\n\n if len(chunks) > 1:\n for chunk in chunks[1:]:\n if chunk == '(B':\n chars.append('\\033'+chunk)\n else:\n p = chunk.find('m')\n if p > 0:\n chars.append('\\033'+chunk[:p+1])\n chars.extend(list(chunk[p+1:]))\n else:\n chars.extend(list(chunk))\n\n # roll up ansi sequences\n ansi = []\n for char in chars:\n if char[0] == '\\033':\n ansi.append(char)\n else:\n self.chars.append(''.join(ansi) + char)\n ansi = []\n if len(self.chars) > 2:\n if self.chars[-1][0] == '\\033':\n self.chars[-2] = self.chars[-2] + self.chars[-1]\n self.chars = self.chars[:-1]", "metadata": "root.AnsiString.__init__", "header": "['class', 'AnsiString', '(', 'object', ')', ':', '___EOS___']", "index": 77 }, { "content": " def __getitem__(self, key):\n if isinstance(key, slice):\n return ''.join(self.chars[key.start:key.stop]) + '\\033[0m'\n else:\n return self.chars[key]", "metadata": "root.AnsiString.__getitem__", "header": "['class', 'AnsiString', '(', 'object', ')', ':', '___EOS___']", "index": 107 }, { "content": " def __str__(self):\n return ''.join(self.chars)", "metadata": "root.AnsiString.__str__", "header": "['class', 'AnsiString', '(', 'object', ')', ':', '___EOS___']", "index": 113 }, { "content": " def __len__(self):\n return len(self.chars)", "metadata": "root.AnsiString.__len__", "header": "['class', 'AnsiString', '(', 'object', ')', ':', '___EOS___']", "index": 116 }, { "content": " def clean(self):\n return re.sub('\\033\\[.{1,2}m', '', str(self))", "metadata": "root.AnsiString.clean", "header": "['class', 'AnsiString', '(', 'object', ')', ':', '___EOS___']", "index": 119 }, { "content": "class VoltronView (object):\n \"\"\"\n Parent class for all views.\n\n Views may or may not support blocking mode. LLDB can be queried from a background thread, which means requests can\n (if it makes sense) be fulfilled as soon as they're received. GDB cannot be queried from a background thread, so\n requests have to be queued and dispatched by the main thread when the debugger stops. This means that GDB requires\n blocking mode.\n\n In blocking mode, the view's `render` method must make a single call to Client's send_request/send_request method,\n with the request(s) flagged as blocking (block=True). If a view (or, more likely, a more complex client) has\n multiple calls to send_request/send_requests, then it cannot support blocking mode and should be flagged as such\n by including `supports_blocking = False` (see below, views are flagged as supporting blocking by default).\n\n All of the included Voltron views support blocking mode, but this distinction has been made so that views can be\n written for LLDB only without making compromises to support GDB.\n \"\"\"\n view_type = None\n block = False\n supports_blocking = True\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.VoltronView", "header": "['module', '___EOS___']", "index": 123 }, { "content": " @classmethod\n def add_generic_arguments(cls, sp):\n sp.add_argument('--show-header', '-e', dest=\"header\", action='store_true', help='show header', default=None)\n sp.add_argument('--hide-header', '-E', dest=\"header\", action='store_false', help='hide header')\n sp.add_argument('--show-footer', '-f', dest=\"footer\", action='store_true', help='show footer', default=None)\n sp.add_argument('--hide-footer', '-F', dest=\"footer\", action='store_false', help='hide footer')\n sp.add_argument('--name', '-n', action='store', help='named configuration to use', default=None)", "metadata": "root.VoltronView.add_generic_arguments", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 144 }, { "content": " @classmethod\n def configure_subparser(cls, subparsers):\n if hasattr(cls._plugin, 'aliases'):\n sp = subparsers.add_parser(cls.view_type, aliases=cls._plugin.aliases, help='{} view'.format(cls.view_type))\n else:\n sp = subparsers.add_parser(cls.view_type, help='{} view'.format(cls.view_type))\n VoltronView.add_generic_arguments(sp)\n sp.set_defaults(func=cls)", "metadata": "root.VoltronView.configure_subparser", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 152 }, { "content": " def __init__(self, args={}, loaded_config={}):\n log.debug('Loading view: ' + self.__class__.__name__)\n self.client = Client(url=voltron.config.view.api_url)\n self.pm = None\n self.args = args\n self.loaded_config = loaded_config\n self.server_version = None\n\n # Commonly set by render method for header and footer formatting\n self.title = ''\n self.info = ''\n self.body = ''\n\n # Build configuration\n self.build_config()\n\n log.debug(\"View config: \" + pprint.pformat(self.config))\n log.debug(\"Args: \" + str(self.args))\n\n # Let subclass do any setup it needs to do\n self.setup()\n\n # Override settings from command line args\n if self.args.header != None:\n self.config.header.show = self.args.header\n if self.args.footer != None:\n self.config.footer.show = self.args.footer\n\n # Setup a SIGWINCH handler so we do reasonable things on resize\n try:\n signal.signal(signal.SIGWINCH, self.sigwinch_handler)\n except:\n pass", "metadata": "root.VoltronView.__init__", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 161 }, { "content": " def build_config(self):\n # Start with all_views config\n self.config = self.loaded_config.view.all_views\n\n # Add view-specific config\n self.config.type = self.view_type\n name = self.view_type + '_view'\n if 'view' in self.loaded_config and name in self.loaded_config.view:\n self.config.update(self.loaded_config.view[name])\n\n # Add named config\n if self.args.name != None:\n self.config.update(self.loaded_config[self.args.name])\n\n # Apply view-specific command-line args\n self.apply_cli_config()", "metadata": "root.VoltronView.build_config", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 195 }, { "content": " def apply_cli_config(self):\n if self.args.header != None:\n self.config.header.show = self.args.header\n if self.args.footer != None:\n self.config.footer.show = self.args.footer", "metadata": "root.VoltronView.apply_cli_config", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 212 }, { "content": " def setup(self):\n log.debug('Base view class setup')", "metadata": "root.VoltronView.setup", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 218 }, { "content": " def cleanup(self):\n log.debug('Base view class cleanup')", "metadata": "root.VoltronView.cleanup", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 221 }, { "content": " def run(self):\n res = None\n os.system('clear')\n\n while True:\n try:\n # get the server version\n if not self.server_version:\n self.server_version = self.client.perform_request('version')\n\n # if the server supports async mode, use it, as some views may only work in async mode\n if self.server_version.capabilities and 'async' in self.server_version.capabilities:\n self.block = False\n elif self.supports_blocking:\n self.block = True\n else:\n raise BlockingNotSupportedError(\"Debugger requires blocking mode\")\n\n # render the view. if this view is running in asynchronous mode, the view should return immediately.\n self.render()\n\n # if the view is not blocking (server supports async || view doesn't support sync), block until the\n # debugger stops again\n if not self.block:\n done = False\n while not done:\n res = self.client.perform_request('version', block=True)\n if res.is_success:\n done = True\n except ConnectionError as e:\n # what the hell, requests? a message is a message, not a fucking nested error object\n try:\n msg = e.message.args[1].strerror\n except:\n try:\n msg = e.message.args[0]\n except:\n msg = str(e)\n traceback.print_exc()\n # if we're not connected, render an error and try again in a second\n self.do_render(error='Error: {}'.format(msg))\n self.server_version = None\n time.sleep(1)", "metadata": "root.VoltronView.run", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 224 }, { "content": " def render(self):\n log.warning('Might wanna implement render() in this view eh')", "metadata": "root.VoltronView.render", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 268 }, { "content": " def do_render(error=None):\n pass", "metadata": "root.VoltronView.do_render", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 271 }, { "content": " def should_reconnect(self):\n try:\n return self.loaded_config.view.reconnect\n except:\n return True", "metadata": "root.VoltronView.should_reconnect", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 274 }, { "content": " def sigwinch_handler(self, sig, stack):\n pass", "metadata": "root.VoltronView.sigwinch_handler", "header": "['class', 'VoltronView', '(', 'object', ')', ':', '___EOS___']", "index": 280 }, { "content": "class TerminalView (VoltronView):\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TerminalView", "header": "['module', '___EOS___']", "index": 284 }, { "content": " def __init__(self, *a, **kw):\n self.init_window()\n self.trunc_top = False\n super(TerminalView, self).__init__(*a, **kw)", "metadata": "root.TerminalView.__init__", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 285 }, { "content": " def init_window(self):\n self.t = Terminal()\n print(self.t.civis)\n if cursor:\n cursor.hide()", "metadata": "root.TerminalView.init_window", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 290 }, { "content": " def cleanup(self):\n log.debug('Cleaning up view')\n print(self.t.cnorm)\n if cursor:\n cursor.show()", "metadata": "root.TerminalView.cleanup", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 296 }, { "content": " def clear(self):\n # blessed's clear doesn't work properly on windaz\n # maybe figure out the right way to do it some time\n os.system('clear')", "metadata": "root.TerminalView.clear", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 302 }, { "content": " def render(self):\n self.do_render()", "metadata": "root.TerminalView.render", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 307 }, { "content": " def do_render(self, error=None):\n # Clear the screen\n self.clear()\n\n # If we got an error, we'll use that as the body\n if error:\n self.body = self.colour(error, 'red')\n\n # Refresh the formatted body\n self.fmt_body = self.body\n\n # Pad and truncate the body\n self.pad_body()\n self.truncate_body()\n\n # Print the header, body and footer\n try:\n if self.config.header.show:\n print(self.format_header_footer(self.config.header))\n print(self.fmt_body, end='')\n if self.config.footer.show:\n print('\\n' + self.format_header_footer(self.config.footer), end='')\n sys.stdout.flush()\n except IOError as e:\n # if we get an EINTR while printing, just do it again\n if e.errno == socket.EINTR:\n self.do_render()", "metadata": "root.TerminalView.do_render", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 310 }, { "content": " def sigwinch_handler(self, sig, stack):\n self.do_render()", "metadata": "root.TerminalView.sigwinch_handler", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 338 }, { "content": " def window_size(self):\n height, width = subprocess.check_output(['stty','size']).split()\n height = int(height) - int(self.config.pad.pad_bottom)\n width = int(width) - int(self.config.pad.pad_right)\n return (height, width)", "metadata": "root.TerminalView.window_size", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 341 }, { "content": " def body_height(self):\n height, width = self.window_size()\n if self.config.header.show:\n height -= 1\n if self.config.footer.show:\n height -= 1\n return height", "metadata": "root.TerminalView.body_height", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 347 }, { "content": " def colour(self, text='', colour=None, background=None, attrs=[]):\n s = ''\n if colour != None:\n s += fmt_esc(colour)\n if background != None:\n s += fmt_esc('b_'+background)\n if attrs != []:\n s += ''.join(map(lambda x: fmt_esc('a_'+x), attrs))\n s += text\n s += fmt_esc('reset')\n return s", "metadata": "root.TerminalView.colour", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 355 }, { "content": " def format_header_footer(self, c):\n height, width = self.window_size()\n\n # Get values for labels\n l = getattr(self, c.label_left.name) if c.label_left.name != None else ''\n r = getattr(self, c.label_right.name) if c.label_right.name != None else ''\n p = c.pad\n llen = len(l)\n rlen = len(r)\n\n # Add colour\n l = self.colour(l, c.label_left.colour, c.label_left.bg_colour, c.label_left.attrs)\n r = self.colour(r, c.label_right.colour, c.label_right.bg_colour, c.label_right.attrs)\n p = self.colour(p, c.colour, c.bg_colour, c.attrs)\n\n # Build\n data = l + (width - llen - rlen)*p + r\n\n return data", "metadata": "root.TerminalView.format_header_footer", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 367 }, { "content": " def pad_body(self):\n height, width = self.window_size()\n lines = self.fmt_body.split('\\n')\n pad = self.body_height() - len(lines)\n if pad < 0:\n pad = 0\n self.fmt_body += int(pad)*'\\n'", "metadata": "root.TerminalView.pad_body", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 387 }, { "content": " def truncate_body(self):\n height, width = self.window_size()\n\n # truncate lines horizontally\n lines = []\n for line in self.fmt_body.split('\\n'):\n s = AnsiString(line)\n if len(s) > width:\n line = s[:width-1] + self.colour('>', 'red')\n lines.append(line)\n\n # truncate body vertically\n if len(lines) > self.body_height():\n if self.trunc_top:\n lines = lines[len(lines) - self.body_height():]\n else:\n lines = lines[:self.body_height()]\n\n self.fmt_body = '\\n'.join(lines)", "metadata": "root.TerminalView.truncate_body", "header": "['class', 'TerminalView', '(', 'VoltronView', ')', ':', '___EOS___']", "index": 395 }, { "content": "def merge(d1, d2):\n for k1,v1 in d1.items():\n if isinstance(v1, dict) and k1 in d2.keys() and isinstance(d2[k1], dict):\n merge(v1, d2[k1])\n else:\n d2[k1] = v1\n return d2", "metadata": "root.merge", "header": "['module', '___EOS___']", "index": 416 } ]
[ { "span": "import pygments", "start_line": 16, "start_column": 4, "end_line": 16, "end_column": 19 }, { "span": "import pygments.lexers", "start_line": 17, "start_column": 4, "end_line": 17, "end_column": 26 }, { "span": "import pygments.formatters", "start_line": 18, "start_column": 4, "end_line": 18, "end_column": 30 }, { "span": "from collections import defaultdict", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 35 }, { "span": "from scruffy import Config", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "signal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "requests_", "import_", "Connect", "ion", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "bles", "sed_", "import_", "Terminal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pygments_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pygments_", "._", "lexer", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pygments_", "._", "formatters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "have", "\\u", "pygments_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "have", "\\u", "pygments_", "=_", "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 ", " _", "import_", "cursor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "scr", "uff", "y_", "import_", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "core_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "colour_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "plugin_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "view", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ADDR", "\\u", "FORMAT", "\\u", "128_", "=_", "'", "0", "x", "{", "0", ":", "0", "=", "32", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ADDR", "\\u", "FORMAT", "\\u", "64_", "=_", "'", "0", "x", "{", "0", ":", "0", "=", "16", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ADDR", "\\u", "FORMAT", "\\u", "32_", "=_", "'", "0", "x", "{", "0", ":", "0", "=", "8", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ADDR", "\\u", "FORMAT", "\\u", "16_", "=_", "'", "0", "x", "{", "0", ":", "0", "=", "4", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHORT", "\\u", "ADDR", "\\u", "FORMAT", "\\u", "128_", "=_", "'{", "0", ":", "0", "=", "32", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHORT", "\\u", "ADDR", "\\u", "FORMAT", "\\u", "64_", "=_", "'{", "0", ":", "0", "=", "16", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHORT", "\\u", "ADDR", "\\u", "FORMAT", "\\u", "32_", "=_", "'{", "0", ":", "0", "=", "8", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "SHORT", "\\u", "ADDR", "\\u", "FORMAT", "\\u", "16_", "=_", "'{", "0", ":", "0", "=", "4", "X", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "gist", ".", "git", "hub", ".", "com", "/", "samp", "sy", "o", "/", "471", "779", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Aliase", "d", "Sub", "Parser", "s", "Action_", "(_", "argparse_", "._", "\\u", "Sub", "Parser", "s", "Action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "\\u", "Aliase", "d", "Pse", "udo", "Action_", "(_", "argparse_", "._", "Action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "aliases_", ",_", "help_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "aliases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dest_", "+=_", "'", " ", "(%", "s", ")'_", "%_", "','_", "._", "join_", "(_", "aliases_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sup_", "=_", "super_", "(_", "Aliase", "d", "Sub", "Parser", "s", "Action_", "._", "\\u", "Aliase", "d", "Pse", "udo", "Action_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sup_", "._", "\\u\\u", "init\\u\\u_", "(_", "option", "\\u", "strings_", "=_", "[_", "]_", ",_", "dest_", "=_", "dest_", ",_", "help_", "=_", "help_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Aliase", "d", "Sub", "Parser", "s", "Action_", "(_", "argparse_", "._", "\\u", "Sub", "Parser", "s", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "parser_", "(_", "self_", ",_", "name_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aliases_", "=_", "kwargs_", "._", "pop_", "(_", "'", "alias", "es", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "super_", "(_", "Aliase", "d", "Sub", "Parser", "s", "Action_", ",_", "self_", ")_", "._", "add", "\\u", "parser_", "(_", "name_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "the", " ", "alias", "es", " ", "work", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "alias_", "in_", "aliases_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "name", "\\u", "parser", "\\u", "map_", "[_", "alias_", "]_", "=_", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "the", " ", "help", " ", "text", " ", "reflect", " ", "them", ",", " ", "first", " ", "remo", "ving", " ", "old", " ", "help", " ", "entry", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "help", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help_", "=_", "kwargs_", "._", "pop_", "(_", "'", "help", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "choice", "s", "\\u", "actions_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pseudo", "\\u", "action_", "=_", "self_", "._", "\\u", "Aliase", "d", "Pse", "udo", "Action_", "(_", "name_", ",_", "aliases_", ",_", "help_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "choice", "s", "\\u", "actions_", "._", "append_", "(_", "pseudo", "\\u", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Ans", "i", "String_", "(_", "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_", "[SEP]_", "class_", "Ans", "i", "String_", "(_", "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_", ",_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chunks_", "=_", "string_", "._", "split_", "(_", "'\\\\", "033", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "chars_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chars_", "=_", "list_", "(_", "chunks_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "chunks_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "chunk_", "in_", "chunks_", "[_", "1_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "chunk_", "==_", "'(", "B", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "chars_", "._", "append_", "(_", "'\\\\", "033", "'_", "+_", "chunk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "p_", "=_", "chunk_", "._", "find_", "(_", "'", "m", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "chars_", "._", "append_", "(_", "'\\\\", "033", "'_", "+_", "chunk_", "[_", ":_", "p_", "+_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chars_", "._", "extend_", "(_", "list_", "(_", "chunk_", "[_", "p_", "+_", "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 ", " ", " _", "chars_", "._", "extend_", "(_", "list_", "(_", "chunk_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "roll", " ", "up", " ", "ansi", " ", "sequences_", "\\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_", "ansi", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "char_", "in_", "chars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "char_", "[_", "0_", "]_", "==_", "'\\\\", "033", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ansi", "_", "._", "append_", "(_", "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 ", " _", "self_", "._", "chars_", "._", "append_", "(_", "''_", "._", "join_", "(_", "ansi", "_", ")_", "+_", "char_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ansi", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "chars_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "chars_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "'\\\\", "033", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "chars_", "[_", "-_", "2_", "]_", "=_", "self_", "._", "chars_", "[_", "-_", "2_", "]_", "+_", "self_", "._", "chars_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "chars_", "=_", "self_", "._", "chars_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ans", "i", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "key_", ",_", "slice_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "._", "join_", "(_", "self_", "._", "chars_", "[_", "key_", "._", "start_", ":_", "key_", "._", "stop_", "]_", ")_", "+_", "'\\\\", "033", "[", "0", "m", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "chars_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ans", "i", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "._", "join_", "(_", "self_", "._", "chars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ans", "i", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "len\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "chars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ans", "i", "String_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clean_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "re_", "._", "sub_", "(_", "'\\\\", "033", "\\\\[", ".", "{", "1", ",", "2", "}", "m", "'_", ",_", "''_", ",_", "str_", "(_", "self_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parent", " ", "class", " ", "for", " ", "all", " ", "views", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "View", "s", " ", "may", " ", "or", " ", "may", " ", "not", " ", "support", " ", "blockin", "g", " ", "mode", ".", " ", "LL", "DB", " ", "can", " ", "be", " ", "queried", " ", "from", " ", "a", " ", "background", " ", "thread", ",", " ", "whi", "ch", " ", "means", " ", "request", "s", " ", "can", "\\", "10", ";", " ", " ", " ", " ", "(", "if", " ", "it", " ", "make", "s", " ", "sense", ")", " ", "be", " ", "fulfill", "ed", " ", "as", " ", "soo", "n", " ", "as", " ", "the", "y", "'", "re", " ", "receive", "d", ".", " ", "GD", "B", " ", "cann", "ot", " ", "be", " ", "queried", " ", "from", " ", "a", " ", "background", " ", "thread", ",", " ", "so", "\\", "10", ";", " ", " ", " ", " ", "request", "s", " ", "have", " ", "to", " ", "be", " ", "queue", "d", " ", "and", " ", "dispatch", "ed", " ", "by", " ", "the", " ", "main", " ", "thread", " ", "whe", "n", " ", "the", " ", "debugg", "er", " ", "stop", "s", ".", " ", "Thi", "s", " ", "means", " ", "tha", "t", " ", "GD", "B", " ", "require", "s", "\\", "10", ";", " ", " ", " ", " ", "blockin", "g", " ", "mode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "blockin", "g", " ", "mode", ",", " ", "the", " ", "view", "'", "s", " ", "`", "render", "`", " ", "method", " ", "must", " ", "make", " ", "a", " ", "single", " ", "call", " ", "to", " ", "Client", "'", "s", " ", "send", "\\u", "request", "/", "send", "\\u", "request", " ", "method", ",", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "request", "(", "s", ")", " ", "flagged", " ", "as", " ", "blockin", "g", " ", "(", "block", "=", "Tru", "e", ").", " ", "If", " ", "a", " ", "view", " ", "(", "or", ",", " ", "more", " ", "like", "ly", ",", " ", "a", " ", "more", " ", "complex", " ", "client", ")", " ", "has", "\\", "10", ";", " ", " ", " ", " ", "multiple", " ", "calls", " ", "to", " ", "send", "\\u", "request", "/", "send", "\\u", "request", "s", ",", " ", "then", " ", "it", " ", "cann", "ot", " ", "support", " ", "blockin", "g", " ", "mode", " ", "and", " ", "shou", "ld", " ", "be", " ", "flagged", " ", "as", " ", "suc", "h", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "inclu", "ding", " ", "`", "support", "s", "\\u", "blockin", "g", " ", "=", " ", "Fal", "se", "`", " ", "(", "see", " ", "belo", "w", ",", " ", "views", " ", "are", " ", "flagged", " ", "as", " ", "support", "ing", " ", "blockin", "g", " ", "by", " ", "default", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "of", " ", "the", " ", "include", "d", " ", "Volt", "ron", " ", "views", " ", "support", " ", "blockin", "g", " ", "mode", ",", " ", "but", " ", "this", " ", "distinct", "ion", " ", "has", " ", "bee", "n", " ", "made", " ", "so", " ", "tha", "t", " ", "views", " ", "can", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "writt", "en", " ", "for", " ", "LL", "DB", " ", "only", " ", "with", "out", " ", "mak", "ing", " ", "compr", "omi", "ses", " ", "to", " ", "support", " ", "GD", "B", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "support", "s", "\\u", "blocking_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "add", "\\u", "gener", "ic", "\\u", "arguments_", "(_", "cls_", ",_", "sp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sp_", "._", "add", "\\u", "argument_", "(_", "'--", "show", "-", "header", "'_", ",_", "'-", "e", "'_", ",_", "dest_", "=_", "\"", "header", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "'", "show", " ", "header", "'_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "add", "\\u", "argument_", "(_", "'--", "hide", "-", "header", "'_", ",_", "'-", "E", "'_", ",_", "dest_", "=_", "\"", "header", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "fal", "se", "'_", ",_", "help_", "=_", "'", "hide", " ", "header", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "add", "\\u", "argument_", "(_", "'--", "show", "-", "footer", "'_", ",_", "'-", "f", "'_", ",_", "dest_", "=_", "\"", "footer", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ",_", "help_", "=_", "'", "show", " ", "footer", "'_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "add", "\\u", "argument_", "(_", "'--", "hide", "-", "footer", "'_", ",_", "'-", "F", "'_", ",_", "dest_", "=_", "\"", "footer", "\"_", ",_", "action_", "=_", "'", "store", "\\u", "fal", "se", "'_", ",_", "help_", "=_", "'", "hide", " ", "footer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "add", "\\u", "argument_", "(_", "'--", "name", "'_", ",_", "'-", "n", "'_", ",_", "action_", "=_", "'", "store", "'_", ",_", "help_", "=_", "'", "named", " ", "configura", "tion", " ", "to", " ", "use", "'_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "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_", "configur", "e\\u", "subparser_", "(_", "cls_", ",_", "subparsers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "cls_", "._", "\\u", "plugin_", ",_", "'", "alias", "es", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sp_", "=_", "subparsers_", "._", "add", "\\u", "parser_", "(_", "cls_", "._", "view", "\\u", "type_", ",_", "aliases_", "=_", "cls_", "._", "\\u", "plugin_", "._", "aliases_", ",_", "help_", "=_", "'{}", " ", "view", "'_", "._", "format_", "(_", "cls_", "._", "view", "\\u", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sp_", "=_", "subparsers_", "._", "add", "\\u", "parser_", "(_", "cls_", "._", "view", "\\u", "type_", ",_", "help_", "=_", "'{}", " ", "view", "'_", "._", "format_", "(_", "cls_", "._", "view", "\\u", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Volt", "ron", "View_", "._", "add", "\\u", "gener", "ic", "\\u", "arguments_", "(_", "sp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp_", "._", "set\\u", "defaults_", "(_", "func_", "=_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "args_", "=_", "{_", "}_", ",_", "load", "ed", "\\u", "config_", "=_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Load", "ing", " ", "view", ":", " ", "'_", "+_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "Client_", "(_", "url_", "=_", "volt", "ron", "_", "._", "config_", "._", "view_", "._", "api", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pm_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "args_", "=_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "load", "ed", "\\u", "config_", "=_", "load", "ed", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "server", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Common", "ly", " ", "set", " ", "by", " ", "render", " ", "method", " ", "for", " ", "header", " ", "and", " ", "footer", " ", "formatting_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "title_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "info_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "body_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "build", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "View", " ", "config", ":", " ", "\"_", "+_", "pprint_", "._", "pformat_", "(_", "self_", "._", "config_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"", "Arg", "s", ":", " ", "\"_", "+_", "str_", "(_", "self_", "._", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Let", " ", "subclass", " ", "do", " ", "any", " ", "setup", " ", "it", " ", "need", "s", " ", "to", " ", "do_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "setup_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Override", " ", "settings", " ", "from", " ", "command", " ", "line", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "args_", "._", "header_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "header_", "._", "show_", "=_", "self_", "._", "args_", "._", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "args_", "._", "footer_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "footer_", "._", "show_", "=_", "self_", "._", "args_", "._", "footer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", "up", " ", "a", " ", "SIG", "WIN", "CH", " ", "handler", " ", "so", " ", "we", " ", "do", " ", "reason", "able", " ", "thing", "s", " ", "on", " ", "resize_", "\\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 ", " _", "signal_", "._", "signal_", "(_", "signal_", "._", "SIG", "WIN", "CH_", ",_", "self_", "._", "sig", "win", "ch", "\\u", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "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_", "build", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "with", " ", "all", "\\u", "views", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "=_", "self_", "._", "load", "ed", "\\u", "config_", "._", "view_", "._", "all", "\\u", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "view", "-", "specific", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config_", "._", "type_", "=_", "self_", "._", "view", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "self_", "._", "view", "\\u", "type_", "+_", "'\\u", "view", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "view", "'_", "in_", "self_", "._", "load", "ed", "\\u", "config_", "and_", "name_", "in_", "self_", "._", "load", "ed", "\\u", "config_", "._", "view_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "update_", "(_", "self_", "._", "load", "ed", "\\u", "config_", "._", "view_", "[_", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "named", " ", "config_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "args_", "._", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "update_", "(_", "self_", "._", "load", "ed", "\\u", "config_", "[_", "self_", "._", "args_", "._", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "view", "-", "specific", " ", "command", "-", "line", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "appl", "y", "\\u", "cli", "\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "appl", "y", "\\u", "cli", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "args_", "._", "header_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "header_", "._", "show_", "=_", "self_", "._", "args_", "._", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "args_", "._", "footer_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "footer_", "._", "show_", "=_", "self_", "._", "args_", "._", "footer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "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_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Base", " ", "view", " ", "class", " ", "setup", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cleanup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Base", " ", "view", " ", "class", " ", "clean", "up", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\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 ", " _", "res_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "system_", "(_", "'", "clear", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "server", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "server", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "server", "\\u", "version_", "=_", "self_", "._", "client_", "._", "perform", "\\u", "request_", "(_", "'", "version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "server", " ", "support", "s", " ", "async", " ", "mode", ",", " ", "use", " ", "it", ",", " ", "as", " ", "some", " ", "views", " ", "may", " ", "only", " ", "work", " ", "in", " ", "async", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "server", "\\u", "version_", "._", "capabilities_", "and_", "'", "async", "'_", "in_", "self_", "._", "server", "\\u", "version_", "._", "capabilities_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "block_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "support", "s", "\\u", "blocking_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "block_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Block", "ing", "Not", "Supp", "orte", "d", "Error_", "(_", "\"", "Debugger", " ", "require", "s", " ", "blockin", "g", " ", "mode", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "render", " ", "the", " ", "view", ".", " ", "if", " ", "this", " ", "view", " ", "is", " ", "runn", "ing", " ", "in", " ", "async", "hronous", " ", "mode", ",", " ", "the", " ", "view", " ", "shou", "ld", " ", "return", " ", "immediate", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "view", " ", "is", " ", "not", " ", "blockin", "g", " ", "(", "server", " ", "support", "s", " ", "async", " ", "||", " ", "view", " ", "doe", "sn", "'", "t", " ", "support", " ", "sync", "),", " ", "block", " ", "unti", "l", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "debugg", "er", " ", "stop", "s", " ", "again", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "self_", "._", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "done_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "done_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "res_", "=_", "self_", "._", "client_", "._", "perform", "\\u", "request_", "(_", "'", "version", "'_", ",_", "block_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "res_", "._", "is", "\\u", "success_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "done_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Connect", "ion", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "what", " ", "the", " ", "hell", ",", " ", "request", "s", "?", " ", "a", " ", "message", " ", "is", " ", "a", " ", "message", ",", " ", "not", " ", "a", " ", "fuck", "ing", " ", "nest", "ed", " ", "error", " ", "object_", "\\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 ", " ", "_", "msg_", "=_", "e_", "._", "message_", "._", "args_", "[_", "1_", "]_", "._", "strerror_", "\\u\\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 ", " ", " _", "msg_", "=_", "e_", "._", "message_", "._", "args_", "[_", "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 ", " ", " _", "msg_", "=_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "traceback_", "._", "print", "\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", "'", "re", " ", "not", " ", "connect", "ed", ",", " ", "render", " ", "an", " ", "error", " ", "and", " ", "try", " ", "again", " ", "in", " ", "a", " ", "second_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "do", "\\u", "render_", "(_", "error_", "=_", "'", "Error", ":", " ", "{}'_", "._", "format_", "(_", "msg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "server", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "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_", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warning_", "(_", "'", "Mi", "ght", " ", "wan", "na", " ", "implement", " ", "render", "()", " ", "in", " ", "this", " ", "view", " ", "eh", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "render_", "(_", "error_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shou", "ld", "\\u", "reconnect_", "(_", "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_", "self_", "._", "load", "ed", "\\u", "config_", "._", "view_", "._", "reconnect_", "\\u\\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_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Volt", "ron", "View_", "(_", "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_", "sig", "win", "ch", "\\u", "handler_", "(_", "self_", ",_", "sig_", ",_", "stack_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\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_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\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_", ",_", "*_", "a_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "init", "\\u", "window_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "trunc", "\\u", "top_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Termin", "al", "View_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "a_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "init", "\\u", "window_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "t_", "=_", "Terminal_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "self_", "._", "t_", "._", "civi", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cursor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", "._", "hide_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cleanup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "'", "Clean", "ing", " ", "up", " ", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "self_", "._", "t_", "._", "cno", "rm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cursor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "bles", "sed", "'", "s", " ", "clear", " ", "doe", "sn", "'", "t", " ", "work", " ", "proper", "ly", " ", "on", " ", "wind", "az_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "may", "be", " ", "figure", " ", "out", " ", "the", " ", "right", " ", "way", " ", "to", " ", "do", " ", "it", " ", "some", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "system_", "(_", "'", "clear", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "do", "\\u", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "render_", "(_", "self_", ",_", "error_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Clear", " ", "the", " ", "screen_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "got", " ", "an", " ", "error", ",", " ", "we", "'", "ll", " ", "use", " ", "tha", "t", " ", "as", " ", "the", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "body_", "=_", "self_", "._", "colour_", "(_", "error_", ",_", "'", "red", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Refr", "esh", " ", "the", " ", "format", "ted", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fmt", "\\u", "body_", "=_", "self_", "._", "body_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pad", " ", "and", " ", "truncat", "e", " ", "the", " ", "body_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "pad", "\\u", "body_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "truncat", "e\\u", "body_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Print", " ", "the", " ", "header", ",", " ", "body", " ", "and", " ", "footer_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "config_", "._", "header_", "._", "show_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "self_", "._", "format\\u", "header", "\\u", "footer_", "(_", "self_", "._", "config_", "._", "header_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "self_", "._", "fmt", "\\u", "body_", ",_", "end_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "footer_", "._", "show_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'\\\\", "n", "'_", "+_", "self_", "._", "format\\u", "header", "\\u", "footer_", "(_", "self_", "._", "config_", "._", "footer_", ")_", ",_", "end_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "get", " ", "an", " ", "EIN", "TR", " ", "whi", "le", " ", "printin", "g", ",", " ", "just", " ", "do", " ", "it", " ", "again", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "e_", "._", "errno_", "==_", "socket_", "._", "EIN", "TR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "do", "\\u", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sig", "win", "ch", "\\u", "handler_", "(_", "self_", ",_", "sig_", ",_", "stack_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "do", "\\u", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "window", "\\u", "size_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", ",_", "width_", "=_", "subprocess_", "._", "check", "\\u", "output_", "(_", "[_", "'", "stt", "y", "'_", ",_", "'", "size", "'_", "]_", ")_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "height_", "=_", "int_", "(_", "height_", ")_", "-_", "int_", "(_", "self_", "._", "config_", "._", "pad_", "._", "pad", "\\u", "bottom_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "int_", "(_", "width_", ")_", "-_", "int_", "(_", "self_", "._", "config_", "._", "pad_", "._", "pad", "\\u", "right_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "height_", ",_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "body", "\\u", "height_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", ",_", "width_", "=_", "self_", "._", "window", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "header_", "._", "show_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "footer_", "._", "show_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "colour_", "(_", "self_", ",_", "text_", "=_", "''_", ",_", "colour_", "=_", "None_", ",_", "background_", "=_", "None_", ",_", "attrs_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "colour_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "+=_", "fmt", "\\u", "esc_", "(_", "colour_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "background_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "+=_", "fmt", "\\u", "esc_", "(_", "'", "b", "\\u'_", "+_", "background_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "attrs_", "!=_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "+=_", "''_", "._", "join_", "(_", "map_", "(_", "lambda_", "x_", ":_", "fmt", "\\u", "esc_", "(_", "'", "a", "\\u'_", "+_", "x_", ")_", ",_", "attrs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "+=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "+=_", "fmt", "\\u", "esc_", "(_", "'", "reset", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "format\\u", "header", "\\u", "footer_", "(_", "self_", ",_", "c_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", ",_", "width_", "=_", "self_", "._", "window", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "values", " ", "for", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "getattr_", "(_", "self_", ",_", "c_", "._", "label", "\\u", "left_", "._", "name_", ")_", "if_", "c_", "._", "label", "\\u", "left_", "._", "name_", "!=_", "None_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "getattr_", "(_", "self_", ",_", "c_", "._", "label", "\\u", "right_", "._", "name_", ")_", "if_", "c_", "._", "label", "\\u", "right_", "._", "name_", "!=_", "None_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "c_", "._", "pad_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "llen", "_", "=_", "len_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rle", "n_", "=_", "len_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "colour_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "=_", "self_", "._", "colour_", "(_", "l_", ",_", "c_", "._", "label", "\\u", "left_", "._", "colour_", ",_", "c_", "._", "label", "\\u", "left_", "._", "bg", "\\u", "colour_", ",_", "c_", "._", "label", "\\u", "left_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "self_", "._", "colour_", "(_", "r_", ",_", "c_", "._", "label", "\\u", "right_", "._", "colour_", ",_", "c_", "._", "label", "\\u", "right_", "._", "bg", "\\u", "colour_", ",_", "c_", "._", "label", "\\u", "right_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "self_", "._", "colour_", "(_", "p_", ",_", "c_", "._", "colour_", ",_", "c_", "._", "bg", "\\u", "colour_", ",_", "c_", "._", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Build_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "l_", "+_", "(_", "width_", "-_", "llen", "_", "-_", "rle", "n_", ")_", "*_", "p_", "+_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pad", "\\u", "body_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", ",_", "width_", "=_", "self_", "._", "window", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "self_", "._", "fmt", "\\u", "body_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pad_", "=_", "self_", "._", "body", "\\u", "height_", "(_", ")_", "-_", "len_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pad_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pad_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "fmt", "\\u", "body_", "+=_", "int_", "(_", "pad_", ")_", "*_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Termin", "al", "View_", "(_", "Volt", "ron", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "truncat", "e\\u", "body_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "height_", ",_", "width_", "=_", "self_", "._", "window", "\\u", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "truncat", "e", " ", "lines", " ", "horizon", "tally", "_", "\\u\\u\\uNL\\u\\u\\u_", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "self_", "._", "fmt", "\\u", "body_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "Ans", "i", "String_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "s_", ")_", ">_", "width_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line_", "=_", "s_", "[_", ":_", "width_", "-_", "1_", "]_", "+_", "self_", "._", "colour_", "(_", "'>'_", ",_", "'", "red", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lines_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "truncat", "e", " ", "body", " ", "vertical", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "lines_", ")_", ">_", "self_", "._", "body", "\\u", "height_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "trunc", "\\u", "top_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "lines_", "[_", "len_", "(_", "lines_", ")_", "-_", "self_", "._", "body", "\\u", "height_", "(_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lines_", "=_", "lines_", "[_", ":_", "self_", "._", "body", "\\u", "height_", "(_", ")_", "]_", "\\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_", "._", "fmt", "\\u", "body_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "merge_", "(_", "d1_", ",_", "d2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "k1_", ",_", "v1_", "in_", "d1_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "v1_", ",_", "dict_", ")_", "and_", "k1_", "in_", "d2_", "._", "keys_", "(_", ")_", "and_", "isinstance_", "(_", "d2_", "[_", "k1_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "merge_", "(_", "v1_", ",_", "d2_", "[_", "k1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d2_", "[_", "k1_", "]_", "=_", "v1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d2_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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 ]
Unused local variable
bayespy/bayespy/bayespy/inference/vmp/nodes/point_estimate.py
[ { "content": " def __init__(self, plates=None):\n dims = [()]\n raise NotImplementedError()", "metadata": "root.Scalar.__init__", "header": "['class', 'Scalar', '(', 'Stochastic', ')', ':', '___EOS___']", "index": 106 } ]
[ { "span": "dims ", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Scalar_", "(_", "Sto", "chas", "tic_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "plates", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dims_", "=_", "[_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
sightmachine/SimpleCV/SimpleCV/base.py
[ { "content": "def download_and_extract(URL):\n \"\"\"\n This function takes in a URL for a zip file, extracts it and returns\n the temporary path it was extracted to\n \"\"\"\n if URL == None:\n logger.warning(\"Please provide URL\")\n return None\n\n tmpdir = tempfile.mkdtemp()\n filename = os.path.basename(URL)\n path = tmpdir + \"/\" + filename\n zdata = urllib2.urlopen(URL)\n\n print \"Saving file to disk please wait....\"\n with open(path, \"wb\") as local_file:\n local_file.write(zdata.read())\n\n zfile = zipfile.ZipFile(path)\n print \"Extracting zipfile\"\n try:\n zfile.extractall(tmpdir)\n except:\n logger.warning(\"Couldn't extract zip file\")\n return None\n\n return tmpdir", "metadata": "root.download_and_extract", "header": "['module', '___EOS___']", "index": 200 }, { "content": "def system():\n \"\"\"\n \n **SUMMARY**\n \n Output of this function includes various informations related to system and library.\n \n Main purpose:\n - While submiting a bug, report the output of this function\n - Checking the current version and later upgrading the library based on the output\n \n **RETURNS**\n \n None\n\n **EXAMPLE**\n \n >>> import SimpleCV\n >>> SimpleCV.system()\n \n \n \"\"\"\n try :\n import platform\n print \"System : \", platform.system()\n print \"OS version : \", platform.version()\n print \"Python version :\", platform.python_version()\n try :\n from cv2 import __version__\n print \"Open CV version : \" + __version__\n except ImportError :\n print \"Open CV2 version : \" + \"2.1\"\n if (PIL_ENABLED) :\n print \"PIL version : \", pil.VERSION\n else :\n print \"PIL module not installed\"\n if (ORANGE_ENABLED) :\n print \"Orange Version : \" + orange.version\n else :\n print \"Orange module not installed\"\n try :\n import pygame as pg\n print \"PyGame Version : \" + pg.__version__\n except ImportError:\n print \"PyGame module not installed\"\n try :\n import pickle\n print \"Pickle Version : \" + pickle.__version__\n except :\n print \"Pickle module not installed\"\n\n except ImportError :\n print \"You need to install Platform to use this function\"\n print \"to install you can use:\"\n print \"easy_install platform\"\n return", "metadata": "root.system", "header": "['module', '___EOS___']", "index": 369 } ]
[ { "span": "except:", "start_line": 222, "start_column": 4, "end_line": 222, "end_column": 11 }, { "span": "except :", "start_line": 417, "start_column": 8, "end_line": 417, "end_column": 16 } ]
[]
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_", "download", "\\u", "and", "\\u", "extract_", "(_", "URL_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "take", "s", " ", "in", " ", "a", " ", "URL", " ", "for", " ", "a", " ", "zip", " ", "file", ",", " ", "extracts", " ", "it", " ", "and", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "temporar", "y", " ", "path", " ", "it", " ", "was", " ", "extracted", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "URL_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Ple", "ase", " ", "provide", " ", "URL", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tmpdir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "tmpdir_", "+_", "\"/\"_", "+_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zd", "ata_", "=_", "urllib2_", "._", "urlopen_", "(_", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Sav", "ing", " ", "file", " ", "to", " ", "disk", " ", "plea", "se", " ", "wait", "....", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "path_", ",_", "\"", "wb", "\"_", ")_", "as_", "local", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "local", "\\u", "file_", "._", "write_", "(_", "zd", "ata_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "zfil", "e_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Extract", "ing", " ", "zipfi", "le", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zfil", "e_", "._", "extracta", "ll_", "(_", "tmpdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\"", "Cou", "ld", "n", "'", "t", " ", "extract", " ", "zip", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tmpdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "system_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "**", "SUMMARY", "**", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Output", " ", "of", " ", "this", " ", "function", " ", "include", "s", " ", "vari", "ous", " ", "informations", " ", "relate", "d", " ", "to", " ", "system", " ", "and", " ", "librar", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "purpose", ":", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Whi", "le", " ", "submit", "ing", " ", "a", " ", "bug", ",", " ", "report", " ", "the", " ", "output", " ", "of", " ", "this", " ", "function", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Check", "ing", " ", "the", " ", "current", " ", "version", " ", "and", " ", "late", "r", " ", "up", "gradi", "ng", " ", "the", " ", "librar", "y", " ", "based", " ", "on", " ", "the", " ", "output", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "**", "RETURN", "S", "**", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "EXAMPLE", "**", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", ">>>", " ", "import", " ", "Simple", "CV", "\\", "10", ";", " ", " ", ">>>", " ", "Simple", "CV", ".", "system", "()", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "System", " ", ":", " ", "\"_", ",_", "platform_", "._", "system_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "OS", " ", "version", " ", ":", " ", "\"_", ",_", "platform_", "._", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Pyth", "on", " ", "version", " ", ":\"_", ",_", "platform_", "._", "python", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "cv2_", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Open", " ", "CV", " ", "version", " ", ":", " ", "\"_", "+_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Open", " ", "CV", "2", " ", "version", " ", ":", " ", "\"_", "+_", "\"", "2.1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "PI", "L", "\\u", "ENABLED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "PI", "L", " ", "version", " ", ":", " ", "\"_", ",_", "pil", "_", "._", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "PI", "L", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "ORA", "NGE", "\\u", "ENABLED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Ora", "nge", " ", "Version", " ", ":", " ", "\"_", "+_", "orange", "_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Ora", "nge", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pygame_", "as_", "pg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Py", "Game", " ", "Version", " ", ":", " ", "\"_", "+_", "pg_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Py", "Game", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Pickl", "e", " ", "Version", " ", ":", " ", "\"_", "+_", "pickle_", "._", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Pickl", "e", " ", "module", " ", "not", " ", "install", "ed", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "You", " ", "need", " ", "to", " ", "install", " ", "Plat", "form", " ", "to", " ", "use", " ", "this", " ", "function", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "to", " ", "install", " ", "you", " ", "can", " ", "use", ":\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "easy", "\\u", "install", " ", "platform", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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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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, 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 ]
First parameter of a method is not named 'self'
pandaproject/panda/panda/api/data.py
[ { "content": " def get_object_list():\n \"\"\"\n Bypassed, should never be invoked. \n\n Since Solr queries are not lazy, fetching a complete list\n of objects never makes sense.\n \"\"\"\n raise NotImplementedError() ", "metadata": "root.DataResource.get_object_list", "header": "['class', 'DataResource', '(', 'PandaResource', ')', ':', '___EOS___']", "index": 196 } ]
[ { "span": "def get_object_list():", "start_line": 196, "start_column": 4, "end_line": 196, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Data", "Resource_", "(_", "Pan", "da", "Resource_", ")_", ":_", "\\u\\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", "object\\u", "list_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "By", "pass", "ed", ",", " ", "shou", "ld", " ", "neve", "r", " ", "be", " ", "invoke", "d", ".", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sin", "ce", " ", "Solr", " ", "querie", "s", " ", "are", " ", "not", " ", "lazy", ",", " ", "fetch", "ing", " ", "a", " ", "complete", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "object", "s", " ", "neve", "r", " ", "make", "s", " ", "sense", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
taoliu/taolib/Scripts/window_stat.py
[ { "content": "#!/usr/bin/env python\n# Time-stamp: <2008-03-17 03:47:15 Tao Liu>\n\n\"\"\"Module Description\n\nCopyright (c) 2007 Tao Liu <[email protected]>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file COPYING included with\nthe distribution).\n\n@status: experimental\n@version: $Revision$\n@author: Tao Liu\n@contact: [email protected]\n\"\"\"\n\n# ------------------------------------\n# python modules\n# ------------------------------------\n\nimport os\nimport sys\nimport re\nfrom optparse import OptionParser\nfrom glob import glob\nimport Cistrome\nfrom Cistrome.TabIO import TabFile\n\n# ------------------------------------\n# constants\n# ------------------------------------\nGENOME_SIZE = {\"mm8\":2644077689L,\n \"hg18\":3080419480L}\n\n# ------------------------------------\n# Misc functions\n# ------------------------------------\n\n# ------------------------------------\n# Classes\n# ------------------------------------\n\n# ------------------------------------\n# Main function\n# ------------------------------------\n\nif __name__ == '__main__':\n try:\n main()\n except KeyboardInterrupt:\n sys.stderr.write(\"\\n;-) See you!\")\n sys.exit(0)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def log( msg ):\n sys.stderr.write( msg )", "metadata": "root.log", "header": "['module', '___EOS___']", "index": 38 }, { "content": "def fact (n):\n return reduce(lambda a,b:a*(b+1),range(n),1)", "metadata": "root.fact", "header": "['module', '___EOS___']", "index": 41 }, { "content": "def main():\n usage = \"usage: %prog [options]\"\n description = \"Slide window based on BED file, then plot the distribution of hits in window along the whole genome.\"\n \n optparser = OptionParser(version=\"%prog 0.1\",description=description,usage=usage,add_help_option=False)\n optparser.add_option(\"-h\",\"--help\",action=\"help\",help=\"Show this help message and exit.\")\n optparser.add_option(\"-s\",\"--species\",dest=\"species\",type=\"string\",\n help=\"species, must be \\\"mm8\\\" or \\\"hg18\\\"\") \n optparser.add_option(\"-i\",\"--ifile\",dest=\"ifile\",type=\"string\",\n help=\"input BED file, e.g. the ChIP regions\")\n optparser.add_option(\"-w\",\"--window\",dest=\"window\",type=\"int\",\n default=1000,help=\"window length, default:1000\")\n optparser.add_option(\"-g\",\"--gap\",dest=\"gap\",type=\"int\",\n default=0,help=\"gap length between nearby windows, must be no less than 0, default:0\")\n optparser.add_option(\"-o\",\"--ofile\",dest=\"ofile\",\n help=\"output file\") \n (options,args) = optparser.parse_args()\n\n if not options.ifile or not options.ofile:\n optparser.print_help()\n sys.exit(1)\n\n ofhd = open(options.ofile,\"w\")\n\n if options.species == \"hg18\":\n chromosomes_len = { # store start and number of file-pos for every chromosome in bin file\n \"chr1\":247249719,\"chr2\":242951149,\"chr3\":199501827,\n \"chr4\":191273063,\"chr5\":180857866,\"chr6\":170899992,\n \"chr7\":158821424,\"chr8\":146274826,\"chr9\":140273252,\n \"chr10\":135374737,\"chr11\":134452384,\"chr12\":132349534,\n \"chr13\":114142980,\"chr14\":106368585,\"chr15\":100338915,\n \"chr16\":88827254,\"chr17\":78774742,\"chr18\":76117153,\n \"chr19\":63811651,\"chr20\":62435964,\"chr21\":46944323,\n \"chr22\":49691432,\"chrX\":154913754,\"chrY\":57772954,\n \"chrM\" :16571\n }\n genome_len = 3080436051L\n elif options.species == \"mm8\":\n chromosomes_len = { # store start and number of file-pos for every chromosome in bin file\n \"chr1\" :197069962,\"chr2\" :181976762,\"chr3\" :159872112,\n \"chr4\" :155029701,\"chr5\" :152003063,\"chr6\" :149525685,\n \"chr7\" :145134094,\"chr8\" :132085098,\"chr9\" :124000669,\n \"chr10\":129959148,\"chr11\":121798632,\"chr12\":120463159,\n \"chr13\":120614378,\"chr14\":123978870,\"chr15\":103492577,\n \"chr16\":98252459, \"chr17\":95177420, \"chr18\":90736837,\n \"chr19\":61321190, \"chrX\" :165556469,\"chrY\" :16029404,\n \"chrM\" :16299\n }\n genome_len = 2644093988L\n else:\n log (\"Species must be \\\"mm8\\\" for mouse or \\\"hg18\\\" for human!\\n\")\n sys.exit(1)\n\n\n log(\"#1. Read BED file: %s\\n\" % (options.ifile))\n f = TabFile(options.ifile)\n # add tags\n track = f.build_fwtrack()\n track_chrs = track.get_chr_names()\n \n\n log(\"#2. Sliding...\\n\")\n total_num = 0\n range_num = 0\n for k in chromosomes_len.keys():\n log(\" on %s...\" % (k))\n if not track_chrs.count(k):\n log(\" skipped!\\n\")\n continue\n else:\n log(\" computing...\\n\")\n chr_end = chromosomes_len[k]\n cs = 0 # current position on chromosome\n ce = cs+options.window\n \n track_k = track.generate_rangeI_by_chr(k)\n track_k_range = track_k.next()\n while ce <= chr_end:\n # do something\n range_num += 1\n num = 0\n while True:\n try:\n if ce < track_k_range.end:\n ofhd.write( \"%d\\n\" % (num) )\n cs = options.gap+ce\n ce = cs+options.window\n break\n else:\n if cs < track_k_range.start:\n num += 1\n total_num+=1\n track_k_range = track_k.next()\n \n #ofhd.write( \"%d\\n\" % (num) )\n except StopIteration: # end of tag list\n ofhd.write( \"%d\\n\" % (num) )\n cs = options.gap+ce\n ce = cs+options.window\n #ofhd.write( \"0\\n\")\n break\n ofhd.close()\n\n sys.stdout.write( \"tags: %d\\ntotal: %d\\nlambda: %f\\n\" % (total_num,range_num,float(total_num)/range_num) )\n log(\"Over!\\n\")", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 50 } ]
[ { "span": "import os", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 9 }, { "span": "import re", "start_line": 23, "start_column": 0, "end_line": 23, "end_column": 9 }, { "span": "from glob import glob", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 21 }, { "span": "import Cistrome", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Time", "-", "stamp", ":", " ", "<", "2008", "-0", "3", "-1", "7", " ", "03", ":", "4", "7", ":", "15", " ", "Ta", "o", " ", "Li", "u", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Modul", "e", " ", "Descripti", "on", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2007", " ", "Ta", "o", " ", "Li", "u", " ", "<", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", ">", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "code", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or", " ", "modif", "y", " ", "it", "\\", "10", ";", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "BS", "D", " ", "License", " ", "(", "see", " ", "the", " ", "file", " ", "COPY", "ING", " ", "include", "d", " ", "with", "\\", "10", ";", "the", " ", "distribu", "tion", ").", "\\", "10", ";", "\\", "10", ";", "@", "status", ":", " ", " ", "experimental", "\\", "10", ";", "@", "version", ":", " ", "$", "Revi", "sion", "$", "\\", "10", ";", "@", "author", ":", " ", " ", "Ta", "o", " ", "Li", "u", "\\", "10", ";", "@", "contact", ":", " ", "ta", "oli", "u", "@", "jim", "my", ".", "har", "vard", ".", "edu", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "python", " ", "modules_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Ci", "stro", "me_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Ci", "stro", "me_", "._", "Tab", "IO_", "import_", "Tab", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "GEN", "OME", "\\u", "SIZE_", "=_", "{_", "\"", "mm", "8", "\"_", ":_", "264", "407", "768", "9_", "L_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hg", "1", "8", "\"_", ":_", "308", "041", "948", "0_", "L_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mis", "c", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Classes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Main", " ", "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\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "board", "Interrupt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "\"\\\\", "n", ";", "-)", " ", "See", " ", "you", "!\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "0_", ")_", "\\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_", "log_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fact_", "(_", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "reduce_", "(_", "lambda_", "a_", ",_", "b_", ":_", "a_", "*_", "(_", "b_", "+_", "1_", ")_", ",_", "range_", "(_", "n_", ")_", ",_", "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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "=_", "\"", "usage", ":", " ", "%", "prog", " ", "[", "options", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\"", "Slide", " ", "window", " ", "based", " ", "on", " ", "BED", " ", "file", ",", " ", "then", " ", "plot", " ", "the", " ", "distribu", "tion", " ", "of", " ", "hits", " ", "in", " ", "window", " ", "along", " ", "the", " ", "whole", " ", "geno", "me", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "optparse", "r_", "=_", "Optio", "n", "Parser_", "(_", "version_", "=_", "\"%", "prog", " ", "0.", "1", "\"_", ",_", "description_", "=_", "description_", ",_", "usage_", "=_", "usage_", ",_", "add", "\\u", "help", "\\u", "option_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "h", "\"_", ",_", "\"--", "help", "\"_", ",_", "action_", "=_", "\"", "help", "\"_", ",_", "help_", "=_", "\"", "Show", " ", "this", " ", "help", " ", "message", " ", "and", " ", "exit", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "s", "\"_", ",_", "\"--", "specie", "s", "\"_", ",_", "dest_", "=_", "\"", "specie", "s", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "specie", "s", ",", " ", "must", " ", "be", " ", "\\\\\"", "mm", "8", "\\\\\"", " ", "or", " ", "\\\\\"", "hg", "1", "8", "\\\\\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "i", "\"_", ",_", "\"--", "ifi", "le", "\"_", ",_", "dest_", "=_", "\"", "ifi", "le", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "input", " ", "BED", " ", "file", ",", " ", "e", ".", "g", ".", " ", "the", " ", "Ch", "IP", " ", "regions", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "w", "\"_", ",_", "\"--", "window", "\"_", ",_", "dest_", "=_", "\"", "window", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "1000_", ",_", "help_", "=_", "\"", "window", " ", "length", ",", " ", "default", ":", "1000", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "g", "\"_", ",_", "\"--", "gap", "\"_", ",_", "dest_", "=_", "\"", "gap", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "0_", ",_", "help_", "=_", "\"", "gap", " ", "length", " ", "bet", "ween", " ", "nearby", " ", "windows", ",", " ", "must", " ", "be", " ", "no", " ", "less", " ", "than", " ", "0", ",", " ", "default", ":", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "optparse", "r_", "._", "add", "\\u", "option_", "(_", "\"-", "o", "\"_", ",_", "\"--", "ofi", "le", "\"_", ",_", "dest_", "=_", "\"", "ofi", "le", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "output", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "optparse", "r_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "options_", "._", "ifile_", "or_", "not_", "options_", "._", "ofile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "optparse", "r_", "._", "print", "\\u", "help_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "of", "hd_", "=_", "open_", "(_", "options_", "._", "ofile_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "species_", "==_", "\"", "hg", "1", "8", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chromosomes", "\\u", "len_", "=_", "{_", "#", " ", "store", " ", "start", " ", "and", " ", "number", " ", "of", " ", "file", "-", "pos", " ", "for", " ", "every", " ", "chromo", "some", " ", "in", " ", "bin", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "1", "\"_", ":_", "247", "249", "719", "_", ",_", "\"", "chr", "2", "\"_", ":_", "242", "951", "149_", ",_", "\"", "chr", "3", "\"_", ":_", "1995", "018", "27_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "4", "\"_", ":_", "191", "273", "063", "_", ",_", "\"", "chr", "5", "\"_", ":_", "180", "857", "866", "_", ",_", "\"", "chr", "6", "\"_", ":_", "170", "899", "992", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "7", "\"_", ":_", "158", "821", "424", "_", ",_", "\"", "chr", "8", "\"_", ":_", "146", "274", "826", "_", ",_", "\"", "chr", "9", "\"_", ":_", "140", "273", "252_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "10", "\"_", ":_", "135", "374", "737", "_", ",_", "\"", "chr", "11", "\"_", ":_", "134", "452", "384_", ",_", "\"", "chr", "1", "2", "\"_", ":_", "132", "349", "534", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "13", "\"_", ":_", "114", "142", "980", "_", ",_", "\"", "chr", "14", "\"_", ":_", "106", "368", "585", "_", ",_", "\"", "chr", "15", "\"_", ":_", "1003", "389", "15_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "16", "\"_", ":_", "888", "272", "54_", ",_", "\"", "chr", "1", "7", "\"_", ":_", "787", "747", "42_", ",_", "\"", "chr", "1", "8", "\"_", ":_", "761", "171", "53_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "1", "9", "\"_", ":_", "638", "116", "51_", ",_", "\"", "chr", "20", "\"_", ":_", "624", "359", "64_", ",_", "\"", "chr", "21", "\"_", ":_", "469", "443", "23_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "2", "2", "\"_", ":_", "496", "914", "32_", ",_", "\"", "chr", "X", "\"_", ":_", "154", "913", "754", "_", ",_", "\"", "chr", "Y", "\"_", ":_", "577", "729", "54_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "M", "\"_", ":_", "165", "71_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geno", "me", "\\u", "len_", "=_", "308", "043", "605", "1_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "species_", "==_", "\"", "mm", "8", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chromosomes", "\\u", "len_", "=_", "{_", "#", " ", "store", " ", "start", " ", "and", " ", "number", " ", "of", " ", "file", "-", "pos", " ", "for", " ", "every", " ", "chromo", "some", " ", "in", " ", "bin", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "1", "\"_", ":_", "197", "069", "962", "_", ",_", "\"", "chr", "2", "\"_", ":_", "181", "976", "762", "_", ",_", "\"", "chr", "3", "\"_", ":_", "159", "872", "112_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "4", "\"_", ":_", "155", "029", "701", "_", ",_", "\"", "chr", "5", "\"_", ":_", "152", "0030", "63_", ",_", "\"", "chr", "6", "\"_", ":_", "149", "525", "685", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "7", "\"_", ":_", "145", "134", "094", "_", ",_", "\"", "chr", "8", "\"_", ":_", "132", "085", "098", "_", ",_", "\"", "chr", "9", "\"_", ":_", "124", "0006", "69_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "10", "\"_", ":_", "129", "959", "148_", ",_", "\"", "chr", "11", "\"_", ":_", "121", "798", "632", "_", ",_", "\"", "chr", "1", "2", "\"_", ":_", "120", "463", "159_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "13", "\"_", ":_", "120", "614", "378", "_", ",_", "\"", "chr", "14", "\"_", ":_", "123", "978", "870", "_", ",_", "\"", "chr", "15", "\"_", ":_", "103", "492", "577", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "16", "\"_", ":_", "982", "524", "59_", ",_", "\"", "chr", "1", "7", "\"_", ":_", "951", "774", "20_", ",_", "\"", "chr", "1", "8", "\"_", ":_", "907", "368", "37_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "1", "9", "\"_", ":_", "613", "211", "90_", ",_", "\"", "chr", "X", "\"_", ":_", "165", "556", "469", "_", ",_", "\"", "chr", "Y", "\"_", ":_", "160", "294", "04_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "chr", "M", "\"_", ":_", "162", "99_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "geno", "me", "\\u", "len_", "=_", "264", "409", "398", "8_", "L_", "\\u\\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_", "(_", "\"", "Speci", "es", " ", "must", " ", "be", " ", "\\\\\"", "mm", "8", "\\\\\"", " ", "for", " ", "mouse", " ", "or", " ", "\\\\\"", "hg", "1", "8", "\\\\\"", " ", "for", " ", "human", "!\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "(_", "\"#", "1", ".", " ", "Read", " ", "BED", " ", "file", ":", " ", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "options_", "._", "ifile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "Tab", "File_", "(_", "options_", "._", "ifile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "track_", "=_", "f_", "._", "build", "\\u", "fw", "track_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "track", "\\u", "chr", "s_", "=_", "track_", "._", "get", "\\u", "chr", "\\u", "names_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "(_", "\"#", "2", ".", " ", "Sli", "ding", "...", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "range", "\\u", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "chromosomes", "\\u", "len_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "\"", " ", "on", " ", "%", "s", "...\"_", "%_", "(_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "track", "\\u", "chr", "s_", "._", "count_", "(_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "(_", "\"", " ", "skip", "ped", "!\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\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_", "(_", "\"", " ", "compu", "ting", "...", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "chr", "\\u", "end_", "=_", "chromosomes", "\\u", "len_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "0_", "#", " ", "current", " ", "position", " ", "on", " ", "chromosome_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ce_", "=_", "cs_", "+_", "options_", "._", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "track", "\\u", "k_", "=_", "track_", "._", "generat", "e\\u", "range", "I", "\\u", "by", "\\u", "chr_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "track", "\\u", "k", "\\u", "range_", "=_", "track", "\\u", "k_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "ce_", "<=_", "chr", "\\u", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "something_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "range", "\\u", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "ce_", "<_", "track", "\\u", "k", "\\u", "range_", "._", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "of", "hd_", "._", "write_", "(_", "\"%", "d", "\\\\", "n", "\"_", "%_", "(_", "num_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "options_", "._", "gap_", "+_", "ce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ce_", "=_", "cs_", "+_", "options_", "._", "window_", "\\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 ", " ", " _", "if_", "cs_", "<_", "track", "\\u", "k", "\\u", "range_", "._", "start_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "num_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "track", "\\u", "k", "\\u", "range_", "=_", "track", "\\u", "k_", "._", "next_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "of", "hd", ".", "write", "(", " ", "\"%", "d", "\\\\", "n", "\"", " ", "%", " ", "(", "num", ")", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sto", "p", "Iteration_", ":_", "#", " ", "end", " ", "of", " ", "tag", " ", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "of", "hd_", "._", "write_", "(_", "\"%", "d", "\\\\", "n", "\"_", "%_", "(_", "num_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cs_", "=_", "options_", "._", "gap_", "+_", "ce_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ce_", "=_", "cs_", "+_", "options_", "._", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "of", "hd", ".", "write", "(", " ", "\"", "0", "\\\\", "n", "\")", "_", "\\u\\u\\uNL\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "of", "hd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "\"", "tags", ":", " ", "%", "d", "\\\\", "nto", "tal", ":", " ", "%", "d", "\\\\", "nla", "mb", "da", ":", " ", "%", "f", "\\\\", "n", "\"_", "%_", "(_", "total", "\\u", "num_", ",_", "range", "\\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 ]
Unused local variable
AppScale/appscale/AppServer/lib/argparse/argparse.py
[ { "content": " def _get_value(self, action, arg_string):\n type_func = self._registry_get('type', action.type, action.type)\n if not _callable(type_func):\n msg = _('%r is not callable')\n raise ArgumentError(action, msg % type_func)\n\n # convert the value to the appropriate type\n try:\n result = type_func(arg_string)\n\n # ArgumentTypeErrors indicate errors\n except ArgumentTypeError:\n name = getattr(action.type, '__name__', repr(action.type))\n msg = str(_sys.exc_info()[1])\n raise ArgumentError(action, msg)\n\n # TypeErrors or ValueErrors also indicate errors\n except (TypeError, ValueError):\n name = getattr(action.type, '__name__', repr(action.type))\n msg = _('invalid %s value: %r')\n raise ArgumentError(action, msg % (name, arg_string))\n\n # return the converted value\n return result", "metadata": "root.ArgumentParser._get_value", "header": "['class', 'ArgumentParser', '(', '_AttributeHolder', ',', '_ActionsContainer', ')', ':', '___EOS___']", "index": 2239 } ]
[ { "span": "name ", "start_line": 2251, "start_column": 12, "end_line": 2251, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Arg", "ument", "Parser_", "(_", "\\u", "Attribute", "Holder_", ",_", "\\u", "Action", "s", "Container_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "value_", "(_", "self_", ",_", "action_", ",_", "arg", "\\u", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "type", "\\u", "func_", "=_", "self_", "._", "\\u", "registr", "y", "\\u", "get_", "(_", "'", "type", "'_", ",_", "action_", "._", "type_", ",_", "action_", "._", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\\u", "callable_", "(_", "type", "\\u", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\\u_", "(_", "'%", "r", " ", "is", " ", "not", " ", "calla", "ble", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Arg", "ument", "Error_", "(_", "action_", ",_", "msg_", "%_", "type", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "the", " ", "value", " ", "to", " ", "the", " ", "appropr", "iate", " ", "type_", "\\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 ", " _", "result_", "=_", "type", "\\u", "func_", "(_", "arg", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Arg", "ument", "Type", "Error", "s", " ", "indicat", "e", " ", "errors_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Arg", "ument", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "getattr_", "(_", "action_", "._", "type_", ",_", "'\\u", "\\u", "name", "\\u\\u'_", ",_", "repr_", "(_", "action_", "._", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "str_", "(_", "\\u", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Arg", "ument", "Error_", "(_", "action_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Type", "Error", "s", " ", "or", " ", "Value", "Error", "s", " ", "als", "o", " ", "indicat", "e", " ", "errors_", "\\u\\u\\uNL\\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 ", " _", "name_", "=_", "getattr_", "(_", "action_", "._", "type_", ",_", "'\\u", "\\u", "name", "\\u\\u'_", ",_", "repr_", "(_", "action_", "._", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "\\u_", "(_", "'", "invalid", " ", "%", "s", " ", "value", ":", " ", "%", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Arg", "ument", "Error_", "(_", "action_", ",_", "msg_", "%_", "(_", "name_", ",_", "arg", "\\u", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "the", " ", "convert", "ed", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2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edMessages()\n hostname= invMessage[0].getHttpService().getHost()\n port= invMessage[0].getHttpService().getPort()\n bytes_req= invMessage[0].getRequest()\n\n r1= self._helpers.analyzeRequest(invMessage[0])\n offsets= []\n no_of_parameters= len(r1.getParameters())\n for p1 in r1.getParameters():\n if p1.getType() == 0:\n offset= []\n offset.append(p1.getValueStart())\n offset.append(p1.getValueEnd())\n offsets.append(jarray.array(offset,'i'))\n\n self._callbacks.sendToIntruder(hostname, port, 1, bytes_req, offsets)", "metadata": "root.BurpExtender.urlSet", "header": "['class', 'BurpExtender', '(', 'IBurpExtender', ',', 'IContextMenuFactory', ')', ':', '___EOS___']", "index": 33 }, { "content": " def bodySet(self, invocation):\n invMessage=invocation.getSelectedMessages()\n hostname= invMessage[0].getHttpService().getHost()\n port= invMessage[0].getHttpService().getPort()\n bytes_req= invMessage[0].getRequest()\n\n r1= self._helpers.analyzeRequest(invMessage[0])\n offsets= []\n no_of_parameters= len(r1.getParameters())\n for p1 in r1.getParameters():\n if p1.getType() == 1:\n offset= []\n offset.append(p1.getValueStart())\n offset.append(p1.getValueEnd())\n offsets.append(jarray.array(offset,'i'))\n\n self._callbacks.sendToIntruder(hostname, port, 1, bytes_req, offsets)", "metadata": "root.BurpExtender.bodySet", "header": "['class', 'BurpExtender', '(', 'IBurpExtender', ',', 'IContextMenuFactory', ')', ':', '___EOS___']", "index": 51 }, { "content": " def cookieSet(self, invocation):\n invMessage=invocation.getSelectedMessages()\n hostname= invMessage[0].getHttpService().getHost()\n port= invMessage[0].getHttpService().getPort()\n bytes_req= invMessage[0].getRequest()\n\n r1= self._helpers.analyzeRequest(invMessage[0])\n offsets= []\n no_of_parameters= len(r1.getParameters())\n for p1 in r1.getParameters():\n if p1.getType() == 2:\n offset= []\n offset.append(p1.getValueStart())\n offset.append(p1.getValueEnd())\n offsets.append(jarray.array(offset,'i'))\n\n self._callbacks.sendToIntruder(hostname, port, 1, bytes_req, offsets)", "metadata": "root.BurpExtender.cookieSet", "header": "['class', 'BurpExtender', '(', 'IBurpExtender', ',', 'IContextMenuFactory', ')', ':', '___EOS___']", "index": 69 } ]
[ { "span": "no_of_parameters=", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 24 }, { "span": "no_of_parameters=", "start_line": 59, "start_column": 8, "end_line": 59, "end_column": 24 }, { "span": "no_of_parameters=", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 24 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Bur", "p", "Extend", "er_", "(_", "IB", "ur", "p", "Extend", "er_", ",_", "IC", "onte", "xt", "Menu", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "url", "Set_", "(_", "self_", ",_", "invocation", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inv", "Message_", "=_", "invocation", "_", "._", "get", "Select", "ed", "Messages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Port_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "req_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r1_", "=_", "self_", "._", "\\u", "helpers_", "._", "analyze", "Request_", "(_", "inv", "Message_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "of", "\\u", "parameters_", "=_", "len_", "(_", "r1_", "._", "get", "Parameters_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p1_", "in_", "r1_", "._", "get", "Parameters_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p1_", "._", "get", "Type_", "(_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "Start_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "End_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "._", "append_", "(_", "jar", "ray_", "._", "array_", "(_", "offset_", ",_", "'", "i", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "callbacks_", "._", "send", "To", "Intr", "ude", "r_", "(_", "hostname_", ",_", "port_", ",_", "1_", ",_", "bytes", "\\u", "req_", ",_", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bur", "p", "Extend", "er_", "(_", "IB", "ur", "p", "Extend", "er_", ",_", "IC", "onte", "xt", "Menu", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "body", "Set_", "(_", "self_", ",_", "invocation", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inv", "Message_", "=_", "invocation", "_", "._", "get", "Select", "ed", "Messages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Port_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "req_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r1_", "=_", "self_", "._", "\\u", "helpers_", "._", "analyze", "Request_", "(_", "inv", "Message_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "of", "\\u", "parameters_", "=_", "len_", "(_", "r1_", "._", "get", "Parameters_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p1_", "in_", "r1_", "._", "get", "Parameters_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p1_", "._", "get", "Type_", "(_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "Start_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "End_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "._", "append_", "(_", "jar", "ray_", "._", "array_", "(_", "offset_", ",_", "'", "i", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "callbacks_", "._", "send", "To", "Intr", "ude", "r_", "(_", "hostname_", ",_", "port_", ",_", "1_", ",_", "bytes", "\\u", "req_", ",_", "offsets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bur", "p", "Extend", "er_", "(_", "IB", "ur", "p", "Extend", "er_", ",_", "IC", "onte", "xt", "Menu", "Factory_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cookie", "Set_", "(_", "self_", ",_", "invocation", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "inv", "Message_", "=_", "invocation", "_", "._", "get", "Select", "ed", "Messages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hostname_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Host_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Http", "Service_", "(_", ")_", "._", "get", "Port_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes", "\\u", "req_", "=_", "inv", "Message_", "[_", "0_", "]_", "._", "get", "Request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r1_", "=_", "self_", "._", "\\u", "helpers_", "._", "analyze", "Request_", "(_", "inv", "Message_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "of", "\\u", "parameters_", "=_", "len_", "(_", "r1_", "._", "get", "Parameters_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p1_", "in_", "r1_", "._", "get", "Parameters_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "p1_", "._", "get", "Type_", "(_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "Start_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset_", "._", "append_", "(_", "p1_", "._", "get", "Value", "End_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offsets_", "._", "append_", "(_", "jar", "ray_", "._", "array_", "(_", "offset_", ",_", "'", "i", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "callbacks_", "._", "send", "To", "Intr", "ude", "r_", "(_", "hostname_", ",_", "port_", ",_", "1_", ",_", "bytes", "\\u", "req_", ",_", "offsets_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
astraw/stdeb/stdeb/util.py
[ { "content": "#\n# This module contains most of the code of stdeb.\n#\nimport re, sys, os, shutil, select\nimport codecs\ntry:\n # Python 2.x\n import ConfigParser\nexcept ImportError:\n # Python 3.x\n import configparser as ConfigParser\nimport subprocess\nimport tempfile\nimport stdeb\nfrom stdeb import log, __version__ as __stdeb_version__\n\nif hasattr(os,'link'):\n link_func = os.link\nelse:\n # matplotlib deletes link from os namespace, expected distutils workaround\n link_func = shutil.copyfile\n\n__all__ = ['DebianInfo','build_dsc','expand_tarball','expand_zip',\n 'stdeb_cmdline_opts','stdeb_cmd_bool_opts','recursive_hardlink',\n 'apply_patch','repack_tarball_with_debianized_dirname',\n 'expand_sdist_file','stdeb_cfg_options']\n\nDH_MIN_VERS = '7' # Fundamental to stdeb >= 0.4\nDH_IDEAL_VERS = '7.4.3' # fixes Debian bug 548392\n\nPYTHON_ALL_MIN_VERS = '2.6.6-3'\n\ntry:\n # Python 2.x\n from exceptions import Exception\nexcept ImportError:\n # Python 3.x\n pass\n\n\nif sys.version_info[0]==2:\n help_str_py2='If True, build package for python 2. (Default=True).'\n help_str_py3='If True, build package for python 3. (Default=False).'\nelse:\n assert sys.version_info[0]==3\n help_str_py2='If True, build package for python 2. (Default=False).'\n help_str_py3='If True, build package for python 3. (Default=True).'\n\nstdeb_cmdline_opts = [\n ('dist-dir=', 'd',\n \"directory to put final built distributions in (default='deb_dist')\"),\n ('patch-already-applied','a',\n 'patch was already applied (used when py2dsc calls sdist_dsc)'),\n ('default-distribution=', None,\n \"deprecated (see --suite)\"),\n ('suite=', 'z',\n \"distribution name to use if not specified in .cfg (default='unstable')\"),\n ('default-maintainer=', None,\n 'deprecated (see --maintainer)'),\n ('maintainer=', 'm',\n 'maintainer name and email to use if not specified in .cfg '\n '(default from setup.py)'),\n ('extra-cfg-file=','x',\n 'additional .cfg file (in addition to stdeb.cfg if present)'),\n ('patch-file=','p',\n 'patch file applied before setup.py called '\n '(incompatible with file specified in .cfg)'),\n ('patch-level=','l',\n 'patch file applied before setup.py called '\n '(incompatible with file specified in .cfg)'),\n ('patch-posix','q',\n 'apply the patch with --posix mode'),\n ('remove-expanded-source-dir','r',\n 'remove the expanded source directory'),\n ('ignore-install-requires', 'i',\n 'ignore the requirements from requires.txt in the egg-info directory'),\n ('pycentral-backwards-compatibility=',None,\n 'This option has no effect, is here for backwards compatibility, and may '\n 'be removed someday.'),\n ('workaround-548392=',None,\n 'This option has no effect, is here for backwards compatibility, and may '\n 'be removed someday.'),\n ('no-backwards-compatibility',None,\n 'This option has no effect, is here for backwards compatibility, and may '\n 'be removed someday.'),\n ('guess-conflicts-provides-replaces=',None,\n 'If True, attempt to guess Conflicts/Provides/Replaces in debian/control '\n 'based on apt-cache output. (Default=False).'),\n ('with-python2=',None,\n help_str_py2),\n ('with-python3=',None,\n help_str_py3),\n ('no-python2-scripts=',None,\n 'If True, do not install scripts for python 2. (Default=False).'),\n ('no-python3-scripts=',None,\n 'If True, do not install scripts for python 3. (Default=False).'),\n ('force-x-python3-version',None,\n 'Override default minimum python3:any dependency with value from '\n 'x-python3-version'),\n ('allow-virtualenv-install-location',None,\n 'Allow installing into /some/random/virtualenv-path'),\n ('sign-results',None,\n 'Use gpg to sign the resulting .dsc and .changes file'),\n ]\n\n# old entries from stdeb.cfg:\n\n# These should be settable as distutils command options, but in case\n# we want to support other packaging methods, they should also be\n# settable outside distutils. Consequently, we keep the ability to\n# parse ConfigParser files (specified with --extra-cfg-file). TODO:\n# Also, some (most, in fact) of the above options should also be\n# settable in the ConfigParser file.\n\nstdeb_cfg_options = [\n # With defaults\n ('source=',None,\n 'debian/control Source: (Default: <source-debianized-setup-name>)'),\n ('package=',None,\n 'debian/control Package: (Default: python-<debianized-setup-name>)'),\n ('package3=',None,\n 'debian/control Package: (Default: python3-<debianized-setup-name>)'),\n ('suite=',None,\n 'suite (e.g. stable, lucid) in changelog (Default: unstable)'),\n ('maintainer=',None,\n 'debian/control Maintainer: (Default: <setup-maintainer-or-author>)'),\n ('debian-version=',None,'debian version (Default: 1)'),\n ('section=',None,'debian/control Section: (Default: python)'),\n\n # With no defaults\n ('epoch=',None,'version epoch'),\n ('forced-upstream-version=',None,'forced upstream version'),\n ('upstream-version-prefix=',None,'upstream version prefix'),\n ('upstream-version-suffix=',None,'upstream version suffix'),\n ('uploaders=',None,'uploaders'),\n ('copyright-file=',None,'copyright file'),\n ('build-depends=',None,'debian/control Build-Depends:'),\n ('build-conflicts=',None,'debian/control Build-Conflicts:'),\n ('stdeb-patch-file=',None,'file containing patches for stdeb to apply'),\n ('stdeb-patch-level=',None,'patch level provided to patch command'),\n ('depends=',None,'debian/control Depends:'),\n ('depends3=',None,'debian/control Depends:'),\n ('suggests=',None,'debian/control Suggests:'),\n ('suggests3=',None,'debian/control Suggests:'),\n ('recommends=',None,'debian/control Recommends:'),\n ('recommends3=',None,'debian/control Recommends:'),\n ('xs-python-version=',None,'debian/control XS-Python-Version:'),\n ('x-python3-version=',None,'debian/control X-Python3-Version:'),\n ('dpkg-shlibdeps-params=',None,'parameters passed to dpkg-shlibdeps'),\n ('conflicts=',None,'debian/control Conflicts:'),\n ('conflicts3=',None,'debian/control Conflicts:'),\n ('provides=',None,'debian/control Provides:'),\n ('provides3=',None,'debian/control Provides3:'),\n ('replaces=',None,'debian/control Replaces:'),\n ('replaces3=',None,'debian/control Replaces3:'),\n ('mime-desktop-files=',None,'MIME desktop files'),\n ('mime-file=',None,'MIME file'),\n ('shared-mime-file=',None,'shared MIME file'),\n ('setup-env-vars=',None,'environment variables passed to setup.py'),\n ('udev-rules=',None,'file with rules to install to udev'),\n ]\n\nstdeb_cmd_bool_opts = [\n 'patch-already-applied',\n 'remove-expanded-source-dir',\n 'patch-posix',\n 'ignore-install-requires',\n 'no-backwards-compatibility',\n 'force-x-python3-version',\n 'allow-virtualenv-install-location',\n 'sign-results',\n ]\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCHANGELOG_FILE = \"\"\"\\\n%(source)s (%(full_version)s) %(distname)s; urgency=low\n\n * source package automatically created by stdeb %(stdeb_version)s\n\n -- %(maintainer)s %(date822)s\\n\"\"\"\n\nCONTROL_FILE = \"\"\"\\\nSource: %(source)s\nMaintainer: %(maintainer)s\n%(uploaders)sSection: %(debian_section)s\nPriority: optional\nBuild-Depends: %(build_depends)s\nStandards-Version: 3.9.1\n%(source_stanza_extras)s\n\n%(control_py2_stanza)s\n\n%(control_py3_stanza)s\n\"\"\"\n\nCONTROL_PY2_STANZA = \"\"\"\nPackage: %(package)s\nArchitecture: %(architecture)s\nDepends: %(depends)s\n%(package_stanza_extras)sDescription: %(description)s\n%(long_description)s\n\"\"\"\n\nCONTROL_PY3_STANZA = \"\"\"\nPackage: %(package3)s\nArchitecture: %(architecture3)s\nDepends: %(depends3)s\n%(package_stanza_extras3)sDescription: %(description)s\n%(long_description)s\n\"\"\"\n\nRULES_MAIN = \"\"\"\\\n#!/usr/bin/make -f\n\n# This file was automatically generated by stdeb %(stdeb_version)s at\n# %(date822)s\n%(exports)s\n%(percent_symbol)s:\n dh $@ %(sequencer_options)s\n\n%(override_dh_auto_clean)s\n\n%(override_dh_auto_build)s\n\n%(override_dh_auto_install)s\n\noverride_dh_python2:\n dh_python2 --no-guessing-versions\n\n%(override_dh_python3)s\n\n%(binary_target_lines)s\n\"\"\"\n\nRULES_OVERRIDE_CLEAN_TARGET_PY2 = \" python setup.py clean -a\"\nRULES_OVERRIDE_CLEAN_TARGET_PY3 = \" python3 setup.py clean -a\"\nRULES_OVERRIDE_CLEAN_TARGET = \"\"\"\noverride_dh_auto_clean:\n%(rules_override_clean_target_pythons)s\n find . -name \\*.pyc -exec rm {} \\;\n\"\"\"\n\nRULES_OVERRIDE_BUILD_TARGET_PY2 = \" python setup.py build --force\"\nRULES_OVERRIDE_BUILD_TARGET_PY3 = \" python3 setup.py build --force\"\nRULES_OVERRIDE_BUILD_TARGET = \"\"\"\noverride_dh_auto_build:\n%(rules_override_build_target_pythons)s\n\"\"\"\n\nRULES_OVERRIDE_INSTALL_TARGET_PY2 = \" python setup.py install --force --root=debian/%(package)s --no-compile -O0 --install-layout=deb %(install_prefix)s %(no_python2_scripts_cli_args)s\"\n\nRULES_OVERRIDE_INSTALL_TARGET_PY3 = \" python3 setup.py install --force --root=debian/%(package3)s --no-compile -O0 --install-layout=deb %(install_prefix)s %(no_python3_scripts_cli_args)s\"\n\nRULES_OVERRIDE_INSTALL_TARGET = \"\"\"\noverride_dh_auto_install:\n%(rules_override_install_target_pythons)s\n%(scripts_cleanup)s\n\"\"\"\n\nRULES_OVERRIDE_PYTHON3 = \"\"\"\noverride_dh_python3:\n dh_python3\n%(scripts)s\n\"\"\"\n\nRULES_BINARY_TARGET = \"\"\"\nbinary: binary-arch binary-indep\n\"\"\"\n\nRULES_BINARY_ALL_TARGET = \"\"\"\nbinary: binary-indep\n\"\"\"\n\nRULES_BINARY_ARCH_TARGET = \"\"\"\nbinary-arch: build\n%(dh_binary_arch_lines)s\n\"\"\"\n\nRULES_BINARY_INDEP_TARGET = \"\"\"\nbinary-indep: build\n%(dh_binary_indep_lines)s\n%(dh_installmime_indep_line)s\n%(dh_desktop_indep_line)s\n\"\"\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CalledProcessError(Exception): pass", "metadata": "root.CalledProcessError", "header": "['module', '___EOS___']", "index": 38 }, { "content": "class CantSatisfyRequirement(Exception): pass", "metadata": "root.CantSatisfyRequirement", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def check_call(*popenargs, **kwargs):\n retcode = subprocess.call(*popenargs, **kwargs)\n if retcode == 0:\n return\n raise CalledProcessError(retcode)", "metadata": "root.check_call", "header": "['module', '___EOS___']", "index": 41 }, { "content": "class NotGiven: pass", "metadata": "root.NotGiven", "header": "['module', '___EOS___']", "index": 180 }, { "content": "def process_command(args, cwd=None):\n if not isinstance(args, (list, tuple)):\n raise RuntimeError(\"args passed must be in a list\")\n check_call(args, cwd=cwd)", "metadata": "root.process_command", "header": "['module', '___EOS___']", "index": 182 }, { "content": "def recursive_hardlink(src,dst):\n dst = os.path.abspath(dst)\n orig_dir = os.path.abspath(os.curdir)\n os.chdir(src)\n try:\n for root,dirs,files in os.walk(os.curdir):\n for file in files:\n fullpath = os.path.normpath(os.path.join(root,file))\n dirname, fname = os.path.split(fullpath)\n dstdir = os.path.normpath(os.path.join(dst,dirname))\n if not os.path.exists(dstdir):\n os.makedirs(dstdir)\n newpath = os.path.join(dstdir,fname)\n if os.path.exists(newpath):\n if os.path.samefile(fullpath,newpath):\n continue\n else:\n os.unlink(newpath)\n #print 'linking %s -> %s'%(fullpath,newpath)\n link_func(fullpath,newpath)\n finally:\n os.chdir(orig_dir)", "metadata": "root.recursive_hardlink", "header": "['module', '___EOS___']", "index": 187 }, { "content": "def debianize_name(name):\n \"make name acceptable as a Debian (binary) package name\"\n name = name.replace('_','-')\n name = name.lower()\n return name", "metadata": "root.debianize_name", "header": "['module', '___EOS___']", "index": 210 }, { "content": "def source_debianize_name(name):\n \"make name acceptable as a Debian source package name\"\n name = name.replace('_','-')\n name = name.replace('.','-')\n name = name.lower()\n return name", "metadata": "root.source_debianize_name", "header": "['module', '___EOS___']", "index": 216 }, { "content": "def debianize_version(name):\n \"make name acceptable as a Debian package name\"\n # XXX should use setuptools' version sorting and do this properly:\n name = name.replace('.dev','~dev')\n\n name = name.lower()\n return name", "metadata": "root.debianize_version", "header": "['module', '___EOS___']", "index": 223 }, { "content": "def dpkg_compare_versions(v1,op,v2):\n args = ['/usr/bin/dpkg','--compare-versions',v1,op,v2]\n cmd = subprocess.Popen(args)\n returncode = cmd.wait()\n if returncode:\n return False\n else:\n return True", "metadata": "root.dpkg_compare_versions", "header": "['module', '___EOS___']", "index": 231 }, { "content": "def get_cmd_stdout(args):\n cmd = subprocess.Popen(args,stdout=subprocess.PIPE)\n returncode = cmd.wait()\n if returncode:\n log.error('ERROR running: %s', ' '.join(args))\n raise RuntimeError('returncode %d', returncode)\n return cmd.stdout.read()", "metadata": "root.get_cmd_stdout", "header": "['module', '___EOS___']", "index": 240 }, { "content": "def normstr(s):\n try:\n # Python 3.x\n result = str(s,'utf-8')\n except TypeError:\n # Python 2.x\n result = s\n return result", "metadata": "root.normstr", "header": "['module', '___EOS___']", "index": 248 }, { "content": "def get_date_822():\n \"\"\"return output of 822-date command\"\"\"\n cmd = '/bin/date'\n if not os.path.exists(cmd):\n raise ValueError('%s command does not exist.'%cmd)\n args = [cmd,'-R']\n result = get_cmd_stdout(args).strip()\n result = normstr(result)\n return result", "metadata": "root.get_date_822", "header": "['module', '___EOS___']", "index": 257 }, { "content": "def get_version_str(pkg):\n args = ['/usr/bin/dpkg-query','--show',\n '--showformat=${Version}',pkg]\n stdout = get_cmd_stdout(args)\n return stdout.strip().decode('ascii')", "metadata": "root.get_version_str", "header": "['module', '___EOS___']", "index": 267 }, { "content": "def load_module(name,fname):\n import imp\n\n suffix = '.py'\n found = False\n for description in imp.get_suffixes():\n if description[0]==suffix:\n found = True\n break\n assert found\n\n fd = open(fname,mode='r')\n try:\n module = imp.load_module(name,fd,fname,description)\n finally:\n fd.close()\n return module", "metadata": "root.load_module", "header": "['module', '___EOS___']", "index": 273 }, { "content": "def get_deb_depends_from_setuptools_requires(requirements, on_failure=\"warn\"):\n \"\"\"\n Suppose you can't confidently figure out a .deb which satisfies a given\n requirement. If on_failure == 'warn', then log a warning. If on_failure\n == 'raise' then raise CantSatisfyRequirement exception. If on_failure ==\n 'guess' then guess that python-$FOO will satisfy the dependency and that\n the Python version numbers will apply to the Debian packages (in addition\n to logging a warning message).\n \"\"\"\n assert on_failure in (\"raise\", \"warn\", \"guess\"), on_failure\n\n import pkg_resources\n\n depends = [] # This will be the return value from this function.\n\n parsed_reqs=[]\n\n for extra,reqs in pkg_resources.split_sections(requirements):\n if extra: continue\n parsed_reqs.extend(pkg_resources.parse_requirements(reqs))\n\n if not parsed_reqs:\n return depends\n\n if not os.path.exists('/usr/bin/apt-file'):\n raise ValueError('apt-file not in /usr/bin. Please install '\n 'with: sudo apt-get install apt-file')\n\n # Ask apt-file for any packages which have a .egg-info file by\n # these names.\n\n # Note that apt-file appears to think that some packages\n # e.g. setuptools itself have \"foo.egg-info/BLAH\" files but not a\n # \"foo.egg-info\" directory.\n\n egginfore=(\"(/(%s)(?:-[^/]+)?(?:-py[0-9]\\.[0-9.]+)?\\.egg-info)\"\n % '|'.join(req.project_name.replace('-', '_') for req in parsed_reqs))\n\n args = [\"apt-file\", \"search\", \"--ignore-case\", \"--regexp\", egginfore]\n\n if 1:\n # do dry run on apt-file\n dry_run_args = args[:] + ['--dummy','--non-interactive']\n cmd = subprocess.Popen(dry_run_args,stderr=subprocess.PIPE)\n returncode = cmd.wait()\n if returncode:\n err_output = cmd.stderr.read()\n raise RuntimeError('Error running \"apt-file search\": ' +\n err_output.strip())\n\n try:\n cmd = subprocess.Popen(args, stdin=subprocess.PIPE,\n stdout=subprocess.PIPE,\n universal_newlines=True)\n except Exception as le:\n # TODO: catch rc=1 and \"E: The cache directory is empty. You need to\n # run 'apt-file update' first.\", and tell the user to follow those\n # instructions.\n log.error('ERROR running: %s', ' '.join(args))\n raise RuntimeError('exception %s from subprocess %s' % (le,args))\n returncode = cmd.wait()\n if returncode:\n log.error('ERROR running: %s', ' '.join(args))\n raise RuntimeError('returncode %d from subprocess %s' % (returncode,\n args))\n\n inlines = cmd.stdout.readlines()\n\n dd = {} # {pydistname: {pydist: set(debpackagename)}}\n E=re.compile(egginfore, re.I)\n D=re.compile(\"^([^:]*):\", re.I)\n eggsndebs = set()\n for l in inlines:\n if l:\n emo = E.search(l)\n assert emo, l\n dmo = D.search(l)\n assert dmo, l\n eggsndebs.add((emo.group(1), dmo.group(1)))\n\n for (egginfo, debname) in eggsndebs:\n pydist = pkg_resources.Distribution.from_filename(egginfo)\n try:\n dd.setdefault(\n pydist.project_name.lower(), {}).setdefault(\n pydist, set()).add(debname)\n except ValueError as le:\n log.warn(\"I got an error parsing a .egg-info file named \\\"%s\\\" \"\n \"from Debian package \\\"%s\\\" as a pkg_resources \"\n \"Distribution: %s\" % (egginfo, debname, le,))\n pass\n\n # Now for each requirement, see if a Debian package satisfies it.\n ops = {'<':'<<','>':'>>','==':'=','<=':'<=','>=':'>='}\n for req in parsed_reqs:\n reqname = req.project_name.lower()\n gooddebs = set()\n for pydist, debs in dd.get(reqname, {}).iteritems():\n if pydist in req:\n ## log.info(\"I found Debian packages \\\"%s\\\" which provides \"\n ## \"Python package \\\"%s\\\", version \\\"%s\\\", which \"\n ## \"satisfies our version requirements: \\\"%s\\\"\"\n ## % (', '.join(debs), req.project_name, ver, req)\n gooddebs |= (debs)\n else:\n log.info(\"I found Debian packages \\\"%s\\\" which provides \"\n \"Python package \\\"%s\\\" which \"\n \"does not satisfy our version requirements: \"\n \"\\\"%s\\\" -- ignoring.\"\n % (', '.join(debs), req.project_name, req))\n if not gooddebs:\n if on_failure == 'warn':\n log.warn(\n \"I found no Debian package which provides the required \"\n \"Python package \\\"%s\\\" with version requirements \"\n \"\\\"%s\\\".\"% (req.project_name, req.specs))\n elif on_failure == \"raise\":\n raise CantSatisfyRequirement(\n \"I found no Debian package which \"\n \"provides the required Python package \\\"%s\\\" with version \"\n \"requirements \\\"%s\\\".\" % (req.project_name, req.specs), req)\n elif on_failure == \"guess\":\n log.warn(\"I found no Debian package which provides the \"\n \"required Python package \\\"%s\\\" with version \"\n \"requirements \\\"%s\\\". Guessing blindly that the \"\n \"name \\\"python-%s\\\" will be it, and that the Python \"\n \"package version number requirements will apply to \"\n \"the Debian package.\" % (req.project_name,\n req.specs, reqname))\n gooddebs.add(\"python-\" + reqname)\n elif len(gooddebs) == 1:\n log.info(\"I found a Debian package which provides the require \"\n \"Python package. Python package: \\\"%s\\\", \"\n \"Debian package: \\\"%s\\\"; adding Depends specifications \"\n \"for the following version(s): \\\"%s\\\"\"\n % (req.project_name, tuple(gooddebs)[0], req.specs))\n else:\n log.warn(\"I found multiple Debian packages which provide the \"\n \"Python distribution required. I'm listing them all \"\n \"as alternates. Candidate debs which claim to provide \"\n \"the Python package \\\"%s\\\" are: \\\"%s\\\"\"\n % (req.project_name, ', '.join(gooddebs),))\n\n alts = []\n for deb in gooddebs:\n added_any_alt = False\n for spec in req.specs:\n # Here we blithely assume that the Debian package\n # versions are enough like the Python package versions\n # that the requirement can be ported straight over...\n alts.append(\"%s (%s %s)\" % (deb, ops[spec[0]], spec[1]))\n added_any_alt = True\n\n if not added_any_alt:\n # No alternates were added, but we have the name of a\n # good package.\n alts.append(\"%s\"%deb)\n\n if len(alts):\n depends.append(' | '.join(alts))\n\n return depends", "metadata": "root.get_deb_depends_from_setuptools_requires", "header": "['module', '___EOS___']", "index": 291 }, { "content": "def make_tarball(tarball_fname,directory,cwd=None):\n \"create a tarball from a directory\"\n if tarball_fname.endswith('.gz'): opts = 'czf'\n else: opts = 'cf'\n args = ['/bin/tar',opts,tarball_fname,directory]\n process_command(args, cwd=cwd)", "metadata": "root.make_tarball", "header": "['module', '___EOS___']", "index": 454 }, { "content": "def expand_tarball(tarball_fname,cwd=None):\n \"expand a tarball\"\n if tarball_fname.endswith('.gz'): opts = 'xzf'\n elif tarball_fname.endswith('.bz2'): opts = 'xjf'\n else: opts = 'xf'\n args = ['/bin/tar',opts,tarball_fname]\n process_command(args, cwd=cwd)", "metadata": "root.expand_tarball", "header": "['module', '___EOS___']", "index": 462 }, { "content": "def expand_zip(zip_fname,cwd=None):\n \"expand a zip\"\n unzip_path = '/usr/bin/unzip'\n if not os.path.exists(unzip_path):\n log.error('ERROR: {} does not exist'.format(unzip_path))\n sys.exit(1)\n args = [unzip_path, zip_fname]\n # Does it have a top dir\n res = subprocess.Popen(\n [args[0], '-l', args[1]], cwd=cwd,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n )\n contents = []\n for line in res.stdout.readlines()[3:-2]:\n contents.append(line.split()[-1])\n commonprefix = os.path.commonprefix(contents)\n if not commonprefix:\n extdir = os.path.join(cwd, os.path.basename(zip_fname[:-4]))\n args.extend(['-d', os.path.abspath(extdir)])\n\n process_command(args, cwd=cwd)", "metadata": "root.expand_zip", "header": "['module', '___EOS___']", "index": 471 }, { "content": "def expand_sdist_file(sdist_file,cwd=None):\n lower_sdist_file = sdist_file.lower()\n if lower_sdist_file.endswith('.zip'):\n expand_zip(sdist_file,cwd=cwd)\n elif lower_sdist_file.endswith('.tar.bz2'):\n expand_tarball(sdist_file,cwd=cwd)\n elif lower_sdist_file.endswith('.tar.gz'):\n expand_tarball(sdist_file,cwd=cwd)\n else:\n raise RuntimeError('could not guess format of original sdist file')", "metadata": "root.expand_sdist_file", "header": "['module', '___EOS___']", "index": 495 }, { "content": "def repack_tarball_with_debianized_dirname( orig_sdist_file,\n repacked_sdist_file,\n debianized_dirname,\n original_dirname ):\n working_dir = tempfile.mkdtemp()\n expand_sdist_file( orig_sdist_file, cwd=working_dir )\n fullpath_original_dirname = os.path.join(working_dir,original_dirname)\n fullpath_debianized_dirname = os.path.join(working_dir,debianized_dirname)\n\n # ensure sdist looks like sdist:\n assert os.path.exists( fullpath_original_dirname )\n assert len(os.listdir(working_dir))==1\n\n if fullpath_original_dirname != fullpath_debianized_dirname:\n # rename original dirname to debianized dirname\n os.rename(fullpath_original_dirname,\n fullpath_debianized_dirname)\n make_tarball(repacked_sdist_file,debianized_dirname,cwd=working_dir)\n shutil.rmtree(working_dir)", "metadata": "root.repack_tarball_with_debianized_dirname", "header": "['module', '___EOS___']", "index": 506 }, { "content": "def dpkg_buildpackage(*args,**kwargs):\n cwd=kwargs.pop('cwd',None)\n if len(kwargs)!=0:\n raise ValueError('only kwarg can be \"cwd\"')\n \"call dpkg-buildpackage [arg1] [...] [argN]\"\n args = ['/usr/bin/dpkg-buildpackage']+list(args)\n process_command(args, cwd=cwd)", "metadata": "root.dpkg_buildpackage", "header": "['module', '___EOS___']", "index": 526 }, { "content": "def dpkg_source(b_or_x,arg1,cwd=None):\n \"call dpkg-source -b|x arg1 [arg2]\"\n assert b_or_x in ['-b','-x']\n args = ['/usr/bin/dpkg-source',b_or_x,arg1]\n process_command(args, cwd=cwd)", "metadata": "root.dpkg_source", "header": "['module', '___EOS___']", "index": 534 }, { "content": "def apply_patch(patchfile,cwd=None,posix=False,level=0):\n \"\"\"call 'patch -p[level] [--posix] < arg1'\n\n posix mode is sometimes necessary. It keeps empty files so that\n dpkg-source removes their contents.\n\n \"\"\"\n if not os.path.exists(patchfile):\n raise RuntimeError('patchfile \"%s\" does not exist'%patchfile)\n fd = open(patchfile,mode='r')\n\n level_str = '-p%d'%level\n args = ['/usr/bin/patch',level_str]\n if posix:\n args.append('--posix')\n\n log.info('PATCH COMMAND: %s < %s', ' '.join(args), patchfile)\n log.info(' PATCHING in dir: %s', cwd)\n# print >> sys.stderr, 'PATCH COMMAND:',' '.join(args),'<',patchfile\n# print >> sys.stderr, ' PATCHING in dir:',cwd\n res = subprocess.Popen(\n args, cwd=cwd,\n stdin=fd,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n )\n returncode=None\n while returncode is None:\n returncode = res.poll()\n ready = select.select( [res.stdout,res.stderr],[],[],0.1)\n # XXX figure out how to do this without reading byte-by-byte\n if res.stdout in ready[0]:\n sys.stdout.write(res.stdout.read(1))\n sys.stdout.flush()\n if res.stderr in ready[0]:\n sys.stderr.write(res.stderr.read(1))\n sys.stderr.flush()\n # finish outputting file\n sys.stdout.write(res.stdout.read())\n sys.stdout.flush()\n sys.stderr.write(res.stderr.read())\n sys.stderr.flush()\n\n if returncode:\n log.error('ERROR running: %s', ' '.join(args))\n log.error('ERROR in %s', cwd)\n# print >> sys.stderr, 'ERROR running: %s'%(' '.join(args),)\n# print >> sys.stderr, 'ERROR in',cwd\n raise RuntimeError('returncode %d'%returncode)", "metadata": "root.apply_patch", "header": "['module', '___EOS___']", "index": 540 }, { "content": "def parse_vals(cfg,section,option):\n \"\"\"parse comma separated values in debian control file style from .cfg\"\"\"\n try:\n vals = cfg.get(section,option)\n except ConfigParser.NoSectionError as err:\n if section != 'DEFAULT':\n vals = cfg.get('DEFAULT',option)\n else:\n raise err\n vals = vals.split('#')[0]\n vals = vals.strip()\n vals = vals.split(',')\n vals = [v.strip() for v in vals]\n vals = [v for v in vals if len(v)]\n return vals", "metadata": "root.parse_vals", "header": "['module', '___EOS___']", "index": 590 }, { "content": "def parse_val(cfg,section,option):\n \"\"\"extract a single value from .cfg\"\"\"\n vals = parse_vals(cfg,section,option)\n if len(vals)==0:\n return ''\n else:\n assert len(vals)==1, (section, option, vals, type(vals))\n return vals[0]", "metadata": "root.parse_val", "header": "['module', '___EOS___']", "index": 606 }, { "content": "def apt_cache_info(apt_cache_cmd,package_name):\n if apt_cache_cmd not in ('showsrc','show'):\n raise NotImplementedError(\n \"don't know how to run apt-cache command '%s'\"%apt_cache_cmd)\n\n result_list = []\n args = [\"apt-cache\", apt_cache_cmd, package_name]\n cmd = subprocess.Popen(args,\n stdin=subprocess.PIPE,\n stderr=subprocess.PIPE,\n stdout=subprocess.PIPE)\n returncode = cmd.wait()\n if returncode:\n errline = cmd.stderr.read()\n if not (returncode == 100 and errline == \"E: You must put some 'source' URIs in your sources.list\\n\"):\n log.error('ERROR running: %s', ' '.join(args))\n raise RuntimeError('returncode %d from subprocess %s' % (returncode,\n args))\n inlines = cmd.stdout.read()\n version_blocks = inlines.split('\\n\\n')\n for version_block in version_blocks:\n block_dict = {}\n\n if len(version_block)==0:\n continue\n version_lines = version_block.split('\\n')\n assert version_lines[0].startswith('Package: ')\n block_dict['Package'] = version_lines[0][ len('Package: '): ]\n\n if apt_cache_cmd == 'showsrc':\n assert version_lines[1].startswith('Binary: ')\n block_dict['Binary'] = version_lines[1][ len('Binary: '): ]\n block_dict['Binary'] = block_dict['Binary'].split(', ')\n\n elif apt_cache_cmd == 'show':\n for start in ('Provides: ','Conflicts: ','Replaces: '):\n key = start[:-2]\n for line in version_lines[2:]:\n if line.startswith(start):\n unsplit_line_result = line[ len(start): ]\n split_result = unsplit_line_result.split(', ')\n block_dict[key] = split_result\n if key not in block_dict:\n block_dict[key] = []\n result_list.append(block_dict)\n return result_list", "metadata": "root.apt_cache_info", "header": "['module', '___EOS___']", "index": 615 }, { "content": "def check_cfg_files(cfg_files,module_name):\n \"\"\"check if the configuration files actually specify something\n\n If config files are given, give warning if they don't contain\n information. This may indicate a wrong module name name, for\n example.\n \"\"\"\n\n cfg = ConfigParser.SafeConfigParser()\n cfg.read(cfg_files)\n if cfg.has_section(module_name):\n section_items = cfg.items(module_name)\n else:\n section_items = []\n default_items = cfg.items('DEFAULT')\n\n n_items = len(section_items) + len(default_items)\n if n_items==0:\n log.warn('configuration files were specified, but no options were '\n 'found in \"%s\" or \"DEFAULT\" sections.' % (module_name,) )", "metadata": "root.check_cfg_files", "header": "['module', '___EOS___']", "index": 662 }, { "content": "class DebianInfo:\n \"\"\"encapsulate information for Debian distribution system\"\"\"\n", "metadata": "root.DebianInfo", "header": "['module', '___EOS___']", "index": 683 }, { "content": " def __init__(self,\n cfg_files=NotGiven,\n module_name=NotGiven,\n default_distribution=NotGiven,\n guess_maintainer=NotGiven,\n upstream_version=NotGiven,\n has_ext_modules=NotGiven,\n description=NotGiven,\n long_description=NotGiven,\n patch_file=None,\n patch_level=None,\n setup_requires=None,\n debian_version=None,\n have_script_entry_points = None,\n use_setuptools = False,\n guess_conflicts_provides_replaces = False,\n sdist_dsc_command = None,\n with_python2 = None,\n with_python3 = None,\n no_python2_scripts = None,\n no_python3_scripts = None,\n force_x_python3_version=False,\n allow_virtualenv_install_location=False,\n ):\n if cfg_files is NotGiven: raise ValueError(\"cfg_files must be supplied\")\n if module_name is NotGiven: raise ValueError(\n \"module_name must be supplied\")\n if default_distribution is NotGiven: raise ValueError(\n \"default_distribution must be supplied\")\n if guess_maintainer is NotGiven: raise ValueError(\n \"guess_maintainer must be supplied\")\n if upstream_version is NotGiven: raise ValueError(\n \"upstream_version must be supplied\")\n if has_ext_modules is NotGiven: raise ValueError(\n \"has_ext_modules must be supplied\")\n if description is NotGiven: raise ValueError(\n \"description must be supplied\")\n if long_description is NotGiven: raise ValueError(\n \"long_description must be supplied\")\n\n cfg_defaults = self._make_cfg_defaults(\n module_name=module_name,\n default_distribution=default_distribution,\n guess_maintainer=guess_maintainer,\n )\n\n if len(cfg_files):\n check_cfg_files(cfg_files,module_name)\n\n cfg = ConfigParser.SafeConfigParser(cfg_defaults)\n for cfg_file in cfg_files:\n with codecs.open( cfg_file, mode='r', encoding='utf-8') as fd:\n cfg.readfp(fd)\n\n if sdist_dsc_command is not None:\n # Allow distutils commands to override config files (this lets\n # command line options beat file options).\n for longopt, shortopt, desc in stdeb_cfg_options:\n opt_name = longopt[:-1]\n name = opt_name.replace('-','_')\n value = getattr( sdist_dsc_command, name )\n if value is not None:\n if not cfg.has_section(module_name):\n cfg.add_section(module_name)\n cfg.set( module_name, opt_name, value )\n\n self.stdeb_version = __stdeb_version__\n self.module_name = module_name\n self.source = parse_val(cfg,module_name,'Source')\n self.package = parse_val(cfg,module_name,'Package')\n self.package3 = parse_val(cfg,module_name,'Package3')\n forced_upstream_version = parse_val(cfg,module_name,\n 'Forced-Upstream-Version')\n if forced_upstream_version == '':\n upstream_version_prefix = parse_val(cfg,module_name,\n 'Upstream-Version-Prefix')\n upstream_version_suffix = parse_val(cfg,module_name,\n 'Upstream-Version-Suffix')\n self.upstream_version = (upstream_version_prefix+\n debianize_version(upstream_version)+\n upstream_version_suffix)\n else:\n if (debianize_version(forced_upstream_version) !=\n forced_upstream_version):\n raise ValueError('forced upstream version (\"%s\") not a '\n 'Debian-compatible version (e.g. \"%s\")'%(\n forced_upstream_version,\n debianize_version(forced_upstream_version)))\n self.upstream_version = forced_upstream_version\n self.epoch = parse_val(cfg,module_name,'Epoch')\n if self.epoch != '' and not self.epoch.endswith(':'):\n self.epoch = self.epoch + ':'\n self.packaging_version = parse_val(cfg,module_name,'Debian-Version')\n if debian_version is not None:\n # command-line arg overrides file\n self.packaging_version = debian_version\n self.dsc_version = '%s-%s'%(\n self.upstream_version,\n self.packaging_version)\n self.full_version = '%s%s-%s'%(\n self.epoch,\n self.upstream_version,\n self.packaging_version)\n self.distname = parse_val(cfg,module_name,'Suite')\n self.maintainer = ', '.join(parse_vals(cfg,module_name,'Maintainer'))\n self.uploaders = parse_vals(cfg,module_name,'Uploaders')\n self.date822 = get_date_822()\n\n build_deps = []\n if use_setuptools:\n if with_python2:\n build_deps.append('python-setuptools (>= 0.6b3)')\n if with_python3:\n build_deps.append('python3-setuptools')\n if setup_requires is not None and len(setup_requires):\n build_deps.extend(\n get_deb_depends_from_setuptools_requires(setup_requires))\n\n depends = ['${misc:Depends}', '${python:Depends}']\n depends3 = ['${misc:Depends}', '${python3:Depends}']\n need_custom_binary_target = False\n\n if has_ext_modules:\n self.architecture = 'any'\n if with_python2:\n build_deps.append('python-all-dev (>= %s)'%PYTHON_ALL_MIN_VERS)\n depends.append('${shlibs:Depends}')\n\n self.architecture3 = 'any'\n if with_python3:\n build_deps.append('python3-all-dev')\n depends3.append('${shlibs:Depends}')\n\n else:\n self.architecture = 'all'\n if with_python2:\n build_deps.append('python-all (>= %s)'%PYTHON_ALL_MIN_VERS)\n\n self.architecture3 = 'all'\n if with_python3:\n build_deps.append('python3-all')\n\n self.copyright_file = parse_val(cfg,module_name,'Copyright-File')\n self.mime_file = parse_val(cfg,module_name,'MIME-File')\n\n self.shared_mime_file = parse_val(cfg,module_name,'Shared-MIME-File')\n\n if self.mime_file == '' and self.shared_mime_file == '':\n self.dh_installmime_indep_line = ''\n else:\n need_custom_binary_target = True\n self.dh_installmime_indep_line = '\\tdh_installmime'\n\n mime_desktop_files = parse_vals(cfg,module_name,'MIME-Desktop-Files')\n if len(mime_desktop_files):\n need_custom_binary_target = True\n self.dh_desktop_indep_line = '\\tdh_desktop'\n else:\n self.dh_desktop_indep_line = ''\n\n # E. any mime .desktop files\n self.install_file_lines = []\n for mime_desktop_file in mime_desktop_files:\n self.install_file_lines.append(\n '%s usr/share/applications'%mime_desktop_file)\n\n depends.extend(parse_vals(cfg,module_name,'Depends') )\n depends3.extend(parse_vals(cfg,module_name,'Depends3') )\n self.depends = ', '.join(depends)\n self.depends3 = ', '.join(depends3)\n\n self.debian_section = parse_val(cfg,module_name,'Section')\n\n self.description = re.sub('\\s+', ' ', description).strip()\n if long_description != 'UNKNOWN':\n ld2=[]\n for line in long_description.split('\\n'):\n ls = line.strip()\n if len(ls):\n ld2.append(' '+line)\n else:\n ld2.append(' .')\n ld2 = ld2[:20]\n self.long_description = '\\n'.join(ld2)\n else:\n self.long_description = ''\n\n if have_script_entry_points:\n build_deps.append( 'debhelper (>= %s)'%DH_IDEAL_VERS )\n else:\n build_deps.append( 'debhelper (>= %s)'%DH_MIN_VERS )\n\n build_deps.extend( parse_vals(cfg,module_name,'Build-Depends') )\n self.build_depends = ', '.join(build_deps)\n\n suggests = ', '.join( parse_vals(cfg,module_name,'Suggests') )\n suggests3 = ', '.join( parse_vals(cfg,module_name,'Suggests3') )\n recommends = ', '.join( parse_vals(cfg,module_name,'Recommends') )\n recommends3 = ', '.join( parse_vals(cfg,module_name,'Recommends3') )\n\n self.source_stanza_extras = ''\n\n build_conflicts = parse_vals(cfg,module_name,'Build-Conflicts')\n if len(build_conflicts):\n self.source_stanza_extras += ('Build-Conflicts: '+\n ', '.join( build_conflicts )+'\\n')\n\n self.patch_file = parse_val(cfg,module_name,'Stdeb-Patch-File')\n\n if patch_file is not None:\n if self.patch_file != '':\n raise RuntimeError('A patch file was specified on the command '\n 'line and in .cfg file.')\n else:\n self.patch_file = patch_file\n\n self.patch_level = parse_val(cfg,module_name,'Stdeb-Patch-Level')\n if self.patch_level != '':\n if patch_level is not None:\n raise RuntimeError('A patch level was specified on the command '\n 'line and in .cfg file.')\n else:\n self.patch_level = int(self.patch_level)\n else:\n if patch_level is not None:\n self.patch_level = patch_level\n else:\n self.patch_level = 0\n\n xs_python_version = parse_vals(cfg,module_name,'XS-Python-Version')\n\n if len(xs_python_version)!=0:\n self.source_stanza_extras += ('X-Python-Version: '+\n ', '.join(xs_python_version)+'\\n')\n\n x_python3_version = parse_vals(cfg,module_name,'X-Python3-Version')\n x_python3_version = [v.strip('\"') for v in x_python3_version]\n\n if len(x_python3_version)!=0:\n self.source_stanza_extras += ('X-Python3-Version: '+\n ', '.join(x_python3_version)+'\\n')\n\n dpkg_shlibdeps_params = parse_val(\n cfg,module_name,'dpkg-shlibdeps-params')\n if dpkg_shlibdeps_params:\n need_custom_binary_target = True\n self.dh_binary_arch_lines = \"\"\"\\tdh binary-arch --before dh_shlibdeps\n\\tdh_shlibdeps -a --dpkg-shlibdeps-params=%s\n\\tdh binary --after dh_shlibdeps\"\"\"%dpkg_shlibdeps_params\n else:\n self.dh_binary_arch_lines = '\\tdh binary-arch'\n self.dh_binary_indep_lines = '\\tdh binary-indep'\n\n conflicts = parse_vals(cfg,module_name,'Conflicts')\n conflicts3 = parse_vals(cfg,module_name,'Conflicts3')\n provides = parse_vals(cfg,module_name,'Provides')\n provides3 = parse_vals(cfg,module_name,'Provides3')\n replaces = parse_vals(cfg,module_name,'Replaces')\n replaces3 = parse_vals(cfg,module_name,'Replaces3')\n\n if guess_conflicts_provides_replaces:\n # Find list of binaries which we will conflict/provide/replace.\n\n cpr_binaries = set()\n\n # Get original Debian information for the package named the same.\n for version_info in apt_cache_info('showsrc',self.package):\n\n # Remember each of the binary packages produced by the Debian source\n for binary in version_info['Binary']:\n cpr_binaries.add(binary)\n\n # TODO: do this for every version available , just the\n # first, or ???\n break\n\n # Descend each of the original binaries and see what\n # packages they conflict/ provide/ replace:\n for orig_binary in cpr_binaries:\n for version_info in apt_cache_info('show',orig_binary):\n provides.extend( version_info['Provides'])\n provides3.extend( version_info['Provides'])\n conflicts.extend(version_info['Conflicts'])\n conflicts3.extend(version_info['Conflicts'])\n replaces.extend( version_info['Replaces'])\n replaces3.extend( version_info['Replaces'])\n\n if self.package in cpr_binaries:\n cpr_binaries.remove(self.package) # don't include ourself\n\n cpr_binaries = list(cpr_binaries) # convert to list\n\n conflicts.extend( cpr_binaries )\n conflicts3.extend( cpr_binaries )\n provides.extend( cpr_binaries )\n provides3.extend( cpr_binaries )\n replaces.extend( cpr_binaries )\n replaces3.extend( cpr_binaries )\n\n # round-trip through set to get unique entries\n conflicts = list(set(conflicts))\n conflicts3 = list(set(conflicts3))\n provides = list(set(provides))\n provides3 = list(set(provides3))\n replaces = list(set(replaces))\n replaces3 = list(set(replaces3))\n\n self.package_stanza_extras = ''\n self.package_stanza_extras3 = ''\n\n if len(conflicts):\n self.package_stanza_extras += ('Conflicts: '+\n ', '.join( conflicts )+'\\n')\n if len(conflicts3):\n self.package_stanza_extras3 += ('Conflicts: '+\n ', '.join( conflicts3 )+'\\n')\n\n if len(provides):\n self.package_stanza_extras += ('Provides: '+\n ', '.join( provides )+'\\n')\n\n if len(provides3):\n self.package_stanza_extras3 += ('Provides: '+\n ', '.join( provides3 )+'\\n')\n\n if len(replaces):\n self.package_stanza_extras += ('Replaces: ' +\n ', '.join( replaces )+'\\n')\n if len(replaces3):\n self.package_stanza_extras3 += ('Replaces: ' +\n ', '.join( replaces3 )+'\\n')\n if len(recommends):\n self.package_stanza_extras += ('Recommends: '+recommends+'\\n')\n\n if len(recommends3):\n self.package_stanza_extras3 += ('Recommends: '+recommends3+'\\n')\n\n if len(suggests):\n self.package_stanza_extras += ('Suggests: '+suggests+'\\n')\n\n if len(suggests3):\n self.package_stanza_extras3 += ('Suggests: '+suggests3+'\\n')\n\n self.dirlist = \"\"\n\n if not (with_python2 or with_python3):\n raise RuntimeError('nothing to do - neither Python 2 or 3.')\n sequencer_with = []\n if with_python2:\n sequencer_with.append('python2')\n if with_python3:\n sequencer_with.append('python3')\n num_binary_packages = len(sequencer_with)\n\n no_script_lines=[]\n\n if no_python2_scripts:\n # install to a location where debian tools do not find them\n self.no_python2_scripts_cli_args = '--install-scripts=/trash'\n no_script_lines.append(\n 'rm -rf debian/%s/trash'%(self.package,))\n else:\n self.no_python2_scripts_cli_args = ''\n if no_python3_scripts:\n # install to a location where debian tools do not find them\n self.no_python3_scripts_cli_args = '--install-scripts=/trash'\n no_script_lines.append(\n 'rm -rf debian/%s/trash'%(self.package3,))\n else:\n self.no_python3_scripts_cli_args = ''\n\n self.scripts_cleanup = '\\n'.join([' '+s for s in no_script_lines])\n\n if sys.prefix != '/usr':\n if not allow_virtualenv_install_location:\n # virtualenv will set distutils\n # --prefix=/path/to/virtualenv, but unless explicitly\n # requested, we want to install into /usr.\n self.install_prefix = '--prefix=/usr'\n else:\n self.install_prefix = '--prefix=%s' % sys.prefix\n else:\n self.install_prefix = ''\n\n rules_override_clean_target_pythons = []\n rules_override_build_target_pythons = []\n rules_override_install_target_pythons = []\n if with_python2:\n rules_override_clean_target_pythons.append(\n RULES_OVERRIDE_CLEAN_TARGET_PY2%self.__dict__\n )\n rules_override_build_target_pythons.append(\n RULES_OVERRIDE_BUILD_TARGET_PY2%self.__dict__\n )\n rules_override_install_target_pythons.append(\n RULES_OVERRIDE_INSTALL_TARGET_PY2%self.__dict__\n )\n if with_python3:\n rules_override_clean_target_pythons.append(\n RULES_OVERRIDE_CLEAN_TARGET_PY3%self.__dict__\n )\n rules_override_build_target_pythons.append(\n RULES_OVERRIDE_BUILD_TARGET_PY3%self.__dict__\n )\n rules_override_install_target_pythons.append(\n RULES_OVERRIDE_INSTALL_TARGET_PY3%self.__dict__\n )\n self.rules_override_clean_target_pythons = '\\n'.join(rules_override_clean_target_pythons)\n self.rules_override_build_target_pythons = '\\n'.join(rules_override_build_target_pythons)\n self.rules_override_install_target_pythons = '\\n'.join(rules_override_install_target_pythons)\n\n self.override_dh_auto_clean = RULES_OVERRIDE_CLEAN_TARGET%self.__dict__\n self.override_dh_auto_build = RULES_OVERRIDE_BUILD_TARGET%self.__dict__\n self.override_dh_auto_install = RULES_OVERRIDE_INSTALL_TARGET%self.__dict__\n\n if force_x_python3_version and with_python3 and x_python3_version and \\\n x_python3_version[0]:\n # override dh_python3 target to modify the dependencies\n # to ensure that the passed minimum X-Python3-Version is usedby\n version = x_python3_version[0]\n if not version.endswith('~'):\n version += '~'\n self.override_dh_python3 = RULES_OVERRIDE_PYTHON3%{\n 'scripts': (\n ' sed -i ' +\n '\"s/\\([ =]python3:any (\\)>= [^)]*\\()\\)/\\\\1%s\\\\2/g\" ' +\n 'debian/%s.substvars') % (version, self.package3)\n }\n else:\n self.override_dh_python3 = ''\n\n sequencer_options = ['--with '+','.join(sequencer_with)]\n sequencer_options.append('--buildsystem=python_distutils')\n self.sequencer_options = ' '.join(sequencer_options)\n\n setup_env_vars = parse_vals(cfg,module_name,'Setup-Env-Vars')\n self.exports = \"\"\n if len(setup_env_vars):\n self.exports += '\\n'\n self.exports += '#exports specified using stdeb Setup-Env-Vars:\\n'\n self.exports += '\\n'.join(['export %s'%v for v in setup_env_vars])\n self.exports += '\\n'\n self.udev_rules = parse_val(cfg,module_name,'Udev-Rules')\n\n if need_custom_binary_target:\n if self.architecture == 'all':\n self.binary_target_lines = ( \\\n RULES_BINARY_ALL_TARGET%self.__dict__ + \\\n RULES_BINARY_INDEP_TARGET%self.__dict__ )\n else:\n self.binary_target_lines = ( \\\n RULES_BINARY_TARGET%self.__dict__ + \\\n RULES_BINARY_INDEP_TARGET%self.__dict__ + \\\n RULES_BINARY_ARCH_TARGET%self.__dict__ )\n else:\n self.binary_target_lines = ''\n\n if with_python2:\n self.control_py2_stanza = CONTROL_PY2_STANZA%self.__dict__\n else:\n self.control_py2_stanza = ''\n\n if with_python3:\n self.control_py3_stanza = CONTROL_PY3_STANZA%self.__dict__\n else:\n self.control_py3_stanza = ''\n\n self.with_python2 = with_python2\n self.with_python3 = with_python3\n self.no_python2_scripts = no_python2_scripts\n self.no_python3_scripts = no_python3_scripts", "metadata": "root.DebianInfo.__init__", "header": "['class', 'DebianInfo', ':', '___EOS___']", "index": 685 }, { "content": " def _make_cfg_defaults(self,\n module_name=NotGiven,\n default_distribution=NotGiven,\n guess_maintainer=NotGiven,\n ):\n defaults = {}\n default_re = re.compile(r'^.* \\(Default: (.*)\\)$')\n for longopt,shortopt,description in stdeb_cfg_options:\n assert longopt.endswith('=')\n assert longopt.lower() == longopt\n key = longopt[:-1]\n matchobj = default_re.search( description )\n if matchobj is not None:\n # has a default value\n groups = matchobj.groups()\n assert len(groups)==1\n value = groups[0]\n # A few special cases\n if value == '<source-debianized-setup-name>':\n assert key=='source'\n value = source_debianize_name(module_name)\n elif value == 'python-<debianized-setup-name>':\n assert key=='package'\n value = 'python-' + debianize_name(module_name)\n elif value == 'python3-<debianized-setup-name>':\n assert key=='package3'\n value = 'python3-' + debianize_name(module_name)\n elif value == '<setup-maintainer-or-author>':\n assert key=='maintainer'\n value = guess_maintainer\n if key=='suite':\n if default_distribution is not None:\n value = default_distribution\n log.warn('Deprecation warning: you are using the '\n '--default-distribution option. '\n 'Switch to the --suite option.')\n else:\n # no default value\n value = ''\n defaults[key] = value\n return defaults", "metadata": "root.DebianInfo._make_cfg_defaults", "header": "['class', 'DebianInfo', ':', '___EOS___']", "index": 1157 }, { "content": "def build_dsc(debinfo,\n dist_dir,\n repackaged_dirname,\n orig_sdist=None,\n patch_posix=0,\n remove_expanded_source_dir=0,\n debian_dir_only=False,\n sign_dsc=False,\n ):\n \"\"\"make debian source package\"\"\"\n # A. Find new dirname and delete any pre-existing contents\n\n # dist_dir is usually 'deb_dist'\n\n # the location of the copied original source package (it was\n # re-recreated in dist_dir)\n if debian_dir_only:\n fullpath_repackaged_dirname = os.path.abspath(os.curdir)\n else:\n fullpath_repackaged_dirname = os.path.join(dist_dir,repackaged_dirname)\n\n ###############################################\n # 1. make temporary original source tarball\n\n # Note that, for the final tarball, best practices suggest\n # using \"dpkg-source -b\". See\n # http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html\n\n # Create the name of the tarball that qualifies as the upstream\n # source. If the original was specified, we'll link to\n # it. Otherwise, we generate our own .tar.gz file from the output\n # of \"python setup.py sdist\" (done above) so that we avoid\n # packaging .svn directories, for example.\n\n if not debian_dir_only:\n repackaged_orig_tarball = ('%(source)s_%(upstream_version)s.orig.tar.gz'%\n debinfo.__dict__)\n repackaged_orig_tarball_path = os.path.join(dist_dir,\n repackaged_orig_tarball)\n if orig_sdist is not None:\n if os.path.exists(repackaged_orig_tarball_path):\n os.unlink(repackaged_orig_tarball_path)\n link_func(orig_sdist,repackaged_orig_tarball_path)\n else:\n make_tarball(repackaged_orig_tarball,\n repackaged_dirname,\n cwd=dist_dir)\n\n # apply patch\n if debinfo.patch_file != '':\n apply_patch(debinfo.patch_file,\n posix=patch_posix,\n level=debinfo.patch_level,\n cwd=fullpath_repackaged_dirname)\n\n for fname in ['Makefile','makefile']:\n if os.path.exists(os.path.join(fullpath_repackaged_dirname,fname)):\n sys.stderr.write('*'*1000 + '\\n')\n sys.stderr.write('WARNING: a Makefile exists in this package. '\n 'stdeb will tell debhelper 7 to use setup.py '\n 'to build and install the package, and the '\n 'Makefile will be ignored.\\n')\n sys.stderr.write('*'*1000 + '\\n')\n\n\n ###############################################\n # 2. create debian/ directory and contents\n debian_dir = os.path.join(fullpath_repackaged_dirname,'debian')\n if not os.path.exists(debian_dir):\n os.mkdir(debian_dir)\n\n # A. debian/changelog\n changelog = CHANGELOG_FILE%debinfo.__dict__\n with codecs.open( os.path.join(debian_dir,'changelog'),\n mode='w', encoding='utf-8') as fd:\n fd.write(changelog)\n\n # B. debian/control\n if debinfo.uploaders:\n debinfo.uploaders = 'Uploaders: %s\\n' % ', '.join(debinfo.uploaders)\n else:\n debinfo.uploaders = ''\n control = CONTROL_FILE%debinfo.__dict__\n with codecs.open( os.path.join(debian_dir,'control'),\n mode='w', encoding='utf-8') as fd:\n fd.write(control)\n\n # C. debian/rules\n debinfo.percent_symbol = '%'\n rules = RULES_MAIN%debinfo.__dict__\n\n rules = rules.replace(' ','\\t')\n rules_fname = os.path.join(debian_dir,'rules')\n with codecs.open( rules_fname,\n mode='w', encoding='utf-8') as fd:\n fd.write(rules)\n os.chmod(rules_fname,0o755)\n\n # D. debian/compat\n fd = open( os.path.join(debian_dir,'compat'), mode='w')\n fd.write('7\\n')\n fd.close()\n\n # E. debian/package.mime\n if debinfo.mime_file != '':\n if not os.path.exists(debinfo.mime_file):\n raise ValueError(\n 'a MIME file was specified, but does not exist: %s'%(\n debinfo.mime_file,))\n link_func( debinfo.mime_file,\n os.path.join(debian_dir,debinfo.package+'.mime'))\n if debinfo.shared_mime_file != '':\n if not os.path.exists(debinfo.shared_mime_file):\n raise ValueError(\n 'a shared MIME file was specified, but does not exist: %s'%(\n debinfo.shared_mime_file,))\n link_func( debinfo.shared_mime_file,\n os.path.join(debian_dir,\n debinfo.package+'.sharedmimeinfo'))\n\n # F. debian/copyright\n if debinfo.copyright_file != '':\n link_func( debinfo.copyright_file,\n os.path.join(debian_dir,'copyright'))\n\n # H. debian/<package>.install\n if len(debinfo.install_file_lines):\n fd = open( os.path.join(debian_dir,'%s.install'%debinfo.package), mode='w')\n fd.write('\\n'.join(debinfo.install_file_lines)+'\\n')\n fd.close()\n\n # I. debian/<package>.udev\n if debinfo.udev_rules != '':\n fname = debinfo.udev_rules\n if not os.path.exists(fname):\n raise ValueError('udev rules file specified, but does not exist')\n link_func(fname,\n os.path.join(debian_dir,'%s.udev'%debinfo.package))\n\n # J. debian/source/format\n os.mkdir(os.path.join(debian_dir,'source'))\n fd = open( os.path.join(debian_dir,'source','format'), mode='w')\n fd.write('3.0 (quilt)\\n')\n fd.close()\n\n fd = open( os.path.join(debian_dir,'source','options'), mode='w')\n fd.write('extend-diff-ignore=\"\\.egg-info$\"')\n fd.close()\n\n if debian_dir_only:\n return\n\n ###############################################\n # 3. unpack original source tarball\n\n debianized_package_dirname = fullpath_repackaged_dirname+'.debianized'\n if os.path.exists(debianized_package_dirname):\n raise RuntimeError('debianized_package_dirname exists: %s' %\n debianized_package_dirname)\n # A. move debianized tree away\n os.rename(fullpath_repackaged_dirname, debianized_package_dirname )\n if orig_sdist is not None:\n # B. expand repackaged original tarball\n tmp_dir = os.path.join(dist_dir,'tmp-expand')\n os.mkdir(tmp_dir)\n try:\n expand_tarball(orig_sdist,cwd=tmp_dir)\n orig_tarball_top_contents = os.listdir(tmp_dir)\n\n # make sure original tarball has exactly one directory\n assert len(orig_tarball_top_contents)==1\n orig_dirname = orig_tarball_top_contents[0]\n fullpath_orig_dirname = os.path.join(tmp_dir,orig_dirname)\n\n # C. remove original repackaged tree\n shutil.rmtree(fullpath_orig_dirname)\n\n finally:\n shutil.rmtree(tmp_dir)\n\n if 1:\n # check versions of debhelper and python-all\n debhelper_version_str = get_version_str('debhelper')\n if len(debhelper_version_str)==0:\n log.warn('This version of stdeb requires debhelper >= %s, but you '\n 'do not have debhelper installed. '\n 'Could not check compatibility.'%DH_MIN_VERS)\n else:\n if not dpkg_compare_versions(\n debhelper_version_str, 'ge', DH_MIN_VERS ):\n log.warn('This version of stdeb requires debhelper >= %s. '\n 'Use stdeb 0.3.x to generate source packages '\n 'compatible with older versions of debhelper.'%(\n DH_MIN_VERS,))\n\n python_defaults_version_str = get_version_str('python-all')\n if len(python_defaults_version_str)==0:\n log.warn('This version of stdeb requires python-all >= %s, '\n 'but you do not have this package installed. '\n 'Could not check compatibility.'%PYTHON_ALL_MIN_VERS)\n else:\n if not dpkg_compare_versions(\n python_defaults_version_str, 'ge', PYTHON_ALL_MIN_VERS):\n log.warn('This version of stdeb requires python-all >= %s. '\n 'Use stdeb 0.6.0 or older to generate source packages '\n 'that use python-support.'%(\n PYTHON_ALL_MIN_VERS,))\n\n # D. restore debianized tree\n os.rename(fullpath_repackaged_dirname+'.debianized',\n fullpath_repackaged_dirname)\n\n # Re-generate tarball using best practices see\n # http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html\n\n if sign_dsc:\n args = ()\n else:\n args = ('-uc','-us')\n\n dpkg_buildpackage('-S','-sa',*args,cwd=fullpath_repackaged_dirname)\n\n if 1:\n shutil.rmtree(fullpath_repackaged_dirname)\n\n if not remove_expanded_source_dir:\n # expand the debian source package\n dsc_name = debinfo.source + '_' + debinfo.dsc_version + '.dsc'\n dpkg_source('-x',dsc_name,\n cwd=dist_dir)", "metadata": "root.build_dsc", "header": "['module', '___EOS___']", "index": 1199 } ]
[ { "span": "import stdeb", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "module", " ", "contain", "s", " ", "most", " ", "of", " ", "the", " ", "code", " ", "of", " ", "std", "eb", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", ",_", "sys_", ",_", "os_", ",_", "shutil_", ",_", "select_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "configparser_", "as_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "std", "eb_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "std", "eb_", "import_", "log_", ",_", "\\u\\u", "version\\u\\u_", "as_", "\\u\\u", "std", "eb", "\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "os_", ",_", "'", "link", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link", "\\u", "func_", "=_", "os_", "._", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "mat", "plotlib", " ", "delete", "s", " ", "link", " ", "from", " ", "os", " ", "namespace", ",", " ", "expected", " ", "distutils", " ", "workar", "ound_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link", "\\u", "func_", "=_", "shutil_", "._", "copyfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Deb", "ian", "Info", "'_", ",_", "'", "build", "\\u", "dsc", "'_", ",_", "'", "expand", "\\u", "tarball", "'_", ",_", "'", "expand", "\\u", "zip", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "std", "eb", "\\u", "cmdline\\u", "opts", "'_", ",_", "'", "std", "eb", "\\u", "cmd", "\\u", "bool\\u", "opts", "'_", ",_", "'", "recurs", "ive", "\\u", "hard", "link", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "appl", "y", "\\u", "patch", "'_", ",_", "'", "repa", "ck", "\\u", "tarball", "\\u", "with", "\\u", "debi", "ani", "zed", "\\u", "dir", "name", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expand", "\\u", "sdist", "\\u", "file", "'_", ",_", "'", "std", "eb", "\\u", "cfg", "\\u", "options", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DH", "\\u", "MIN", "\\u", "VER", "S_", "=_", "'", "7", "'_", "#", " ", "Fund", "amental", " ", "to", " ", "std", "eb", " ", ">=", " ", "0.4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DH", "\\u", "IDE", "AL", "\\u", "VER", "S_", "=_", "'", "7.4", ".3", "'_", "#", " ", "fixes", " ", "Deb", "ian", " ", "bug", " ", "548", "392", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "S_", "=_", "'", "2.6", ".6", "-", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "exceptions_", "import_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "help", "\\u", "str", "\\u", "py2", "_", "=_", "'", "If", " ", "Tru", "e", ",", " ", "build", " ", "package", " ", "for", " ", "python", " ", "2", ".", " ", "(", "Default", "=", "Tru", "e", ").'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "help", "\\u", "str", "\\u", "py3", "_", "=_", "'", "If", " ", "Tru", "e", ",", " ", "build", " ", "package", " ", "for", " ", "python", " ", "3", ".", " ", "(", "Default", "=", "Fal", "se", ").'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "sys_", "._", "version", "\\u", "info_", "[_", "0_", "]_", "==_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "help", "\\u", "str", "\\u", "py2", "_", "=_", "'", "If", " ", "Tru", "e", ",", " ", "build", " ", "package", " ", "for", " ", "python", " ", "2", ".", " ", "(", "Default", "=", "Fal", "se", ").'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "help", "\\u", "str", "\\u", "py3", "_", "=_", "'", "If", " ", "Tru", "e", ",", " ", "build", " ", "package", " ", "for", " ", "python", " ", "3", ".", " ", "(", "Default", "=", "Tru", "e", ").'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "std", "eb", "\\u", "cmdline\\u", "opts_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "dist", "-", "dir", "='_", ",_", "'", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "director", "y", " ", "to", " ", "put", " ", "final", " ", "bui", "lt", " ", "distribu", "tion", "s", " ", "in", " ", "(", "default", "='", "deb", "\\u", "dist", "')\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "patch", "-", "alr", "ead", "y", "-", "applied", "'_", ",_", "'", "a", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "patch", " ", "was", " ", "alr", "ead", "y", " ", "applied", " ", "(", "used", " ", "whe", "n", " ", "py2", "dsc", " ", "calls", " ", "sdist", "\\u", "dsc", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "default", "-", "distribu", "tion", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "depre", "cated", " ", "(", "see", " ", "--", "suit", "e", ")\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "suit", "e", "='_", ",_", "'", "z", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "distribu", "tion", " ", "name", " ", "to", " ", "use", " ", "if", " ", "not", " ", "specified", " ", "in", " ", ".", "cfg", " ", "(", "default", "='", "unstable", "')\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "default", "-", "maintainer", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "depre", "cated", " ", "(", "see", " ", "--", "maintainer", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "maintainer", "='_", ",_", "'", "m", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "maintainer", " ", "name", " ", "and", " ", "email", " ", "to", " ", "use", " ", "if", " ", "not", " ", "specified", " ", "in", " ", ".", "cfg", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "default", " ", "from", " ", "setup", ".", "py", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "extra", "-", "cfg", "-", "file", "='_", ",_", "'", "x", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "addition", "al", " ", ".", "cfg", " ", "file", " ", "(", "in", " ", "addition", " ", "to", " ", "std", "eb", ".", "cfg", " ", "if", " ", "presen", "t", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "patch", "-", "file", "='_", ",_", "'", "p", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "patch", " ", "file", " ", "applied", " ", "bef", "ore", " ", "setup", ".", "py", " ", "call", "ed", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "incomp", "atible", " ", "with", " ", "file", " ", "specified", " ", "in", " ", ".", "cfg", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "patch", "-", "level", "='_", ",_", "'", "l", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "patch", " ", "file", " ", "applied", " ", "bef", "ore", " ", "setup", ".", "py", " ", "call", "ed", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'(", "incomp", "atible", " ", "with", " ", "file", " ", "specified", " ", "in", " ", ".", "cfg", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "patch", "-", "posix", "'_", ",_", "'", "q", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "appl", "y", " ", "the", " ", "patch", " ", "with", " ", "--", "posix", " ", "mode", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "remove", "-", "expand", "ed", "-", "source", "-", "dir", "'_", ",_", "'", "r", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "remove", " ", "the", " ", "expand", "ed", " ", "source", " ", "director", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "ignore", "-", "install", "-", "require", "s", "'_", ",_", "'", "i", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ignore", " ", "the", " ", "require", "ment", "s", " ", "from", " ", "require", "s", ".", "txt", " ", "in", " ", "the", " ", "egg", "-", "info", " ", "director", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "pyc", "entr", "al", "-", "back", "ward", "s", "-", "compatibility", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Thi", "s", " ", "option", " ", "has", " ", "no", " ", "effect", ",", " ", "is", " ", "here", " ", "for", " ", "back", "ward", "s", " ", "compatibility", ",", " ", "and", " ", "may", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "be", " ", "remove", "d", " ", "some", "day", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "workar", "ound", "-", "548", "392", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Thi", "s", " ", "option", " ", "has", " ", "no", " ", "effect", ",", " ", "is", " ", "here", " ", "for", " ", "back", "ward", "s", " ", "compatibility", ",", " ", "and", " ", "may", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "be", " ", "remove", "d", " ", "some", "day", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "no", "-", "back", "ward", "s", "-", "compatibility", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Thi", "s", " ", "option", " ", "has", " ", "no", " ", "effect", ",", " ", "is", " ", "here", " ", "for", " ", "back", "ward", "s", " ", "compatibility", ",", " ", "and", " ", "may", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "be", " ", "remove", "d", " ", "some", "day", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "guess", "-", "confl", "icts", "-", "provide", "s", "-", "replace", "s", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", " ", "Tru", "e", ",", " ", "atte", "mpt", " ", "to", " ", "guess", " ", "Confl", "icts", "/", "Prov", "ides", "/", "Replace", "s", " ", "in", " ", "debi", "an", "/", "control", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "based", " ", "on", " ", "apt", "-", "cache", " ", "output", ".", " ", "(", "Default", "=", "Fal", "se", ").'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "with", "-", "python", "2", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help", "\\u", "str", "\\u", "py2", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "with", "-", "python", "3", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help", "\\u", "str", "\\u", "py3", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "no", "-", "python", "2", "-", "scripts", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", " ", "Tru", "e", ",", " ", "do", " ", "not", " ", "install", " ", "scripts", " ", "for", " ", "python", " ", "2", ".", " ", "(", "Default", "=", "Fal", "se", ").'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "no", "-", "python", "3", "-", "scripts", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "If", " ", "Tru", "e", ",", " ", "do", " ", "not", " ", "install", " ", "scripts", " ", "for", " ", "python", " ", "3", ".", " ", "(", "Default", "=", "Fal", "se", ").'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "force", "-", "x", "-", "python", "3", "-", "version", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Override", " ", "default", " ", "minim", "um", " ", "python", "3", ":", "any", " ", "dependen", "cy", " ", "with", " ", "value", " ", "from", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "x", "-", "python", "3", "-", "version", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "allow", "-", "virtualenv", "-", "install", "-", "location", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "All", "ow", " ", "install", "ing", " ", "int", "o", " ", "/", "some", "/", "random", "/", "virtualenv", "-", "path", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "sign", "-", "results", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Us", "e", " ", "gpg", " ", "to", " ", "sign", " ", "the", " ", "result", "ing", " ", ".", "dsc", " ", "and", " ", ".", "change", "s", " ", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "old", " ", "entri", "es", " ", "from", " ", "std", "eb", ".", "cfg", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "shou", "ld", " ", "be", " ", "sett", "able", " ", "as", " ", "distutils", " ", "command", " ", "options", ",", " ", "but", " ", "in", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "want", " ", "to", " ", "support", " ", "other", " ", "packaging", " ", "method", "s", ",", " ", "the", "y", " ", "shou", "ld", " ", "als", "o", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sett", "able", " ", "outsi", "de", " ", "distutils", ".", " ", "Conse", "que", "ntl", "y", ",", " ", "we", " ", "keep", " ", "the", " ", "abilit", "y", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "Config", "Parser", " ", "files", " ", "(", "specified", " ", "with", " ", "--", "extra", "-", "cfg", "-", "file", ").", " ", "TOD", "O", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "so", ",", " ", "some", " ", "(", "most", ",", " ", "in", " ", "fact", ")", " ", "of", " ", "the", " ", "above", " ", "options", " ", "shou", "ld", " ", "als", "o", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sett", "able", " ", "in", " ", "the", " ", "Config", "Parser", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "std", "eb", "\\u", "cfg", "\\u", "options_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "With", " ", "defaults_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "source", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debi", "an", "/", "control", " ", "Sou", "rce", ":", " ", "(", "Default", ":", " ", "<", "source", "-", "debi", "ani", "zed", "-", "setup", "-", "name", ">)", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "package", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debi", "an", "/", "control", " ", "Packa", "ge", ":", " ", "(", "Default", ":", " ", "python", "-", "<", "debi", "ani", "zed", "-", "setup", "-", "name", ">)", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "package", "3", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debi", "an", "/", "control", " ", "Packa", "ge", ":", " ", "(", "Default", ":", " ", "python", "3", "-", "<", "debi", "ani", "zed", "-", "setup", "-", "name", ">)", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "suit", "e", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "suit", "e", " ", "(", "e", ".", "g", ".", " ", "stable", ",", " ", "luc", "id", ")", " ", "in", " ", "change", "log", " ", "(", "Default", ":", " ", "unstable", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "maintainer", "='_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debi", "an", "/", "control", " ", "Maint", "aine", "r", ":", " ", "(", "Default", ":", " ", "<", "setup", "-", "maintainer", "-", "or", "-", "author", ">)", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "debi", "an", "-", "version", "='_", ",_", "None_", ",_", "'", "debi", "an", " ", "version", " ", "(", "Default", ":", " ", "1", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "section", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Sect", "ion", ":", " ", "(", "Default", ":", " ", "python", ")'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "With", " ", "no", " ", "defaults_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "epoch", "='_", ",_", "None_", ",_", "'", "version", " ", "epoch", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "forced", "-", "ups", "tream", "-", "version", "='_", ",_", "None_", ",_", "'", "forced", " ", "ups", "tream", " ", "version", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "ups", "tream", "-", "version", "-", "prefix", "='_", ",_", "None_", ",_", "'", "ups", "tream", " ", "version", " ", "prefix", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "ups", "tream", "-", "version", "-", "suff", "ix", "='_", ",_", "None_", ",_", "'", "ups", "tream", " ", "version", " ", "suff", "ix", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "uploade", "rs", "='_", ",_", "None_", ",_", "'", "uploade", "rs", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "copyr", "ight", "-", "file", "='_", ",_", "None_", ",_", "'", "copyr", "ight", " ", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "build", "-", "depend", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Build", "-", "Depend", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "build", "-", "confl", "icts", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Build", "-", "Confl", "icts", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "std", "eb", "-", "patch", "-", "file", "='_", ",_", "None_", ",_", "'", "file", " ", "contain", "ing", " ", "patche", "s", " ", "for", " ", "std", "eb", " ", "to", " ", "appl", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "std", "eb", "-", "patch", "-", "level", "='_", ",_", "None_", ",_", "'", "patch", " ", "level", " ", "provided", " ", "to", " ", "patch", " ", "command", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "depend", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Depend", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "depend", "s3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Depend", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "suggest", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Sug", "gest", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "suggest", "s3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Sug", "gest", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "recommend", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Recommend", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "recommend", "s3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Recommend", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "xs", "-", "python", "-", "version", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "XS", "-", "Pyth", "on", "-", "Version", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "x", "-", "python", "3", "-", "version", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "X", "-", "Pyth", "on", "3", "-", "Version", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "dpkg", "-", "shl", "ib", "dep", "s", "-", "params", "='_", ",_", "None_", ",_", "'", "parameter", "s", " ", "pass", "ed", " ", "to", " ", "dpkg", "-", "shl", "ib", "dep", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "confl", "icts", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Confl", "icts", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "confl", "icts", "3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Confl", "icts", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "provide", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Prov", "ides", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "provide", "s3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Prov", "ides", "3", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "replace", "s", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Replace", "s", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "replace", "s3", "='_", ",_", "None_", ",_", "'", "debi", "an", "/", "control", " ", "Replace", "s3", ":'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "mime", "-", "desk", "top", "-", "files", "='_", ",_", "None_", ",_", "'", "MIME", " ", "desk", "top", " ", "files", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "mime", "-", "file", "='_", ",_", "None_", ",_", "'", "MIME", " ", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "shared", "-", "mime", "-", "file", "='_", ",_", "None_", ",_", "'", "shared", " ", "MIME", " ", "file", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "setup", "-", "env", "-", "vars", "='_", ",_", "None_", ",_", "'", "environ", "ment", " ", "variab", "les", " ", "pass", "ed", " ", "to", " ", "setup", ".", "py", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "udev", "-", "rule", "s", "='_", ",_", "None_", ",_", "'", "file", " ", "with", " ", "rule", "s", " ", "to", " ", "install", " ", "to", " ", "udev", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "std", "eb", "\\u", "cmd", "\\u", "bool\\u", "opts_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "patch", "-", "alr", "ead", "y", "-", "applied", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "remove", "-", "expand", "ed", "-", "source", "-", "dir", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "patch", "-", "posix", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ignore", "-", "install", "-", "require", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "no", "-", "back", "ward", "s", "-", "compatibility", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "force", "-", "x", "-", "python", "3", "-", "version", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "allow", "-", "virtualenv", "-", "install", "-", "location", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sign", "-", "results", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "CHANGE", "LOG", "\\u", "FILE_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "%", "(", "source", ")", "s", " ", "(%", "(", "full", "\\u", "version", ")", "s", ")", " ", "%", "(", "dist", "name", ")", "s", ";", " ", "urgen", "cy", "=", "low", "\\", "10", ";", "\\", "10", ";", " ", " ", "*", " ", "source", " ", "package", " ", "automati", "call", "y", " ", "created", " ", "by", " ", "std", "eb", " ", "%", "(", "std", "eb", "\\u", "version", ")", "s", "\\", "10", ";", "\\", "10", ";", " ", "--", " ", "%", "(", "maintainer", ")", "s", " ", " ", "%", "(", "date", "822", ")", "s", "\\\\", "n", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CONTR", "OL", "\\u", "FILE_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "Sou", "rce", ":", " ", "%", "(", "source", ")", "s", "\\", "10", ";", "Maint", "aine", "r", ":", " ", "%", "(", "maintainer", ")", "s", "\\", "10", ";", "%", "(", "uploade", "rs", ")", "s", "Sect", "ion", ":", " ", "%", "(", "debi", "an", "\\u", "section", ")", "s", "\\", "10", ";", "Prior", "it", "y", ":", " ", "option", "al", "\\", "10", ";", "Build", "-", "Depend", "s", ":", " ", "%", "(", "build", "\\u", "depend", "s", ")", "s", "\\", "10", ";", "Standard", "s", "-", "Version", ":", " ", "3.9", ".1", "\\", "10", ";", "%", "(", "source", "\\u", "stanza", "\\u", "extra", "s", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "control", "\\u", "py2", "\\u", "stanza", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "control", "\\u", "py3", "\\u", "stanza", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CONTR", "OL", "\\u", "PY", "2", "\\u", "STAN", "ZA", "_", "=_", "\"\"\"", "\\", "10", ";", "Packa", "ge", ":", " ", "%", "(", "package", ")", "s", "\\", "10", ";", "Architecture", ":", " ", "%", "(", "architecture", ")", "s", "\\", "10", ";", "Depend", "s", ":", " ", "%", "(", "depend", "s", ")", "s", "\\", "10", ";", "%", "(", "package", "\\u", "stanza", "\\u", "extra", "s", ")", "s", "Descripti", "on", ":", " ", "%", "(", "description", ")", "s", "\\", "10", ";", "%", "(", "long", "\\u", "description", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CONTR", "OL", "\\u", "PY", "3", "\\u", "STAN", "ZA", "_", "=_", "\"\"\"", "\\", "10", ";", "Packa", "ge", ":", " ", "%", "(", "package", "3", ")", "s", "\\", "10", ";", "Architecture", ":", " ", "%", "(", "architecture", "3", ")", "s", "\\", "10", ";", "Depend", "s", ":", " ", "%", "(", "depend", "s3", ")", "s", "\\", "10", ";", "%", "(", "package", "\\u", "stanza", "\\u", "extra", "s3", ")", "s", "Descripti", "on", ":", " ", "%", "(", "description", ")", "s", "\\", "10", ";", "%", "(", "long", "\\u", "description", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "MAIN", "_", "=_", "\"\"\"", "\\\\", "\\", "10", ";", "#!", "/", "usr", "/", "bin", "/", "make", " ", "-", "f", "\\", "10", ";", "\\", "10", ";", "#", " ", "Thi", "s", " ", "file", " ", "was", " ", "automati", "call", "y", " ", "generat", "ed", " ", "by", " ", "std", "eb", " ", "%", "(", "std", "eb", "\\u", "version", ")", "s", " ", "at", "\\", "10", ";", "#", " ", "%", "(", "date", "822", ")", "s", "\\", "10", ";", "%", "(", "export", "s", ")", "s", "\\", "10", ";", "%", "(", "percent", "\\u", "symbol", ")", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "dh", " ", "$", "@", " ", "%", "(", "sequence", "r", "\\u", "options", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "override", "\\u", "dh", "\\u", "auto", "\\u", "clean", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "override", "\\u", "dh", "\\u", "auto", "\\u", "build", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "override", "\\u", "dh", "\\u", "auto", "\\u", "install", ")", "s", "\\", "10", ";", "\\", "10", ";", "override", "\\u", "dh", "\\u", "python", "2", ":", "\\", "10", ";", " ", " ", " ", " ", "dh", "\\u", "python", "2", " ", "--", "no", "-", "guess", "ing", "-", "version", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "override", "\\u", "dh", "\\u", "python", "3", ")", "s", "\\", "10", ";", "\\", "10", ";", "%", "(", "binar", "y", "\\u", "target", "\\u", "lines", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET", "\\u", "PY", "2_", "=_", "\"", " ", " ", " ", " ", "python", " ", "setup", ".", "py", " ", "clean", " ", "-", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET", "\\u", "PY", "3_", "=_", "\"", " ", " ", " ", " ", "python", "3", " ", "setup", ".", "py", " ", "clean", " ", "-", "a", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "override", "\\u", "dh", "\\u", "auto", "\\u", "clean", ":", "\\", "10", ";", "%", "(", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s", ")", "s", "\\", "10", ";", " ", " ", " ", " ", "find", " ", ".", " ", "-", "name", " ", "\\\\*", ".", "pyc", " ", "-", "exec", " ", "rm", " ", "{}", " ", "\\\\", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET", "\\u", "PY", "2_", "=_", "\"", " ", " ", " ", " ", "python", " ", "setup", ".", "py", " ", "build", " ", "--", "force", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET", "\\u", "PY", "3_", "=_", "\"", " ", " ", " ", " ", "python", "3", " ", "setup", ".", "py", " ", "build", " ", "--", "force", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "override", "\\u", "dh", "\\u", "auto", "\\u", "build", ":", "\\", "10", ";", "%", "(", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET", "\\u", "PY", "2_", "=_", "\"", " ", " ", " ", " ", "python", " ", "setup", ".", "py", " ", "install", " ", "--", "force", " ", "--", "root", "=", "debi", "an", "/", "%", "(", "package", ")", "s", " ", "--", "no", "-", "compile", " ", "-", "O0", " ", "--", "install", "-", "layout", "=", "deb", " ", "%", "(", "install", "\\u", "prefix", ")", "s", " ", "%", "(", "no", "\\u", "python", "2", "\\u", "scripts", "\\u", "cli", "\\u", "args", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET", "\\u", "PY", "3_", "=_", "\"", " ", " ", " ", " ", "python", "3", " ", "setup", ".", "py", " ", "install", " ", "--", "force", " ", "--", "root", "=", "debi", "an", "/", "%", "(", "package", "3", ")", "s", " ", "--", "no", "-", "compile", " ", "-", "O0", " ", "--", "install", "-", "layout", "=", "deb", " ", "%", "(", "install", "\\u", "prefix", ")", "s", " ", "%", "(", "no", "\\u", "python", "3", "\\u", "scripts", "\\u", "cli", "\\u", "args", ")", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "override", "\\u", "dh", "\\u", "auto", "\\u", "install", ":", "\\", "10", ";", "%", "(", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s", ")", "s", "\\", "10", ";", "%", "(", "scripts", "\\u", "clean", "up", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "PYTHON", "3_", "=_", "\"\"\"", "\\", "10", ";", "override", "\\u", "dh", "\\u", "python", "3", ":", "\\", "10", ";", " ", " ", " ", " ", "dh", "\\u", "python", "3", "\\", "10", ";", "%", "(", "scripts", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "BIN", "ARY", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "binar", "y", ":", " ", "binar", "y", "-", "arch", " ", "binar", "y", "-", "indep", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "BIN", "ARY", "\\u", "ALL", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "binar", "y", ":", " ", "binar", "y", "-", "indep", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "BIN", "ARY", "\\u", "ARCH", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "binar", "y", "-", "arch", ":", " ", "build", "\\", "10", ";", "%", "(", "dh", "\\u", "binar", "y", "\\u", "arch", "\\u", "lines", ")", "s", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "BIN", "ARY", "\\u", "INDE", "P", "\\u", "TARGET_", "=_", "\"\"\"", "\\", "10", ";", "binar", "y", "-", "indep", ":", " ", "build", "\\", "10", ";", "%", "(", "dh", "\\u", "binar", "y", "\\u", "indep", "\\u", "lines", ")", "s", "\\", "10", ";", "%", "(", "dh", "\\u", "install", "mime", "\\u", "indep", "\\u", "line", ")", "s", "\\", "10", ";", "%", "(", "dh", "\\u", "desk", "top", "\\u", "indep", "\\u", "line", ")", "s", "\\", "10", ";\"\"\"_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Call", "ed", "Process", "Error_", "(_", "Exception_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Cant", "Sat", "isf", "y", "Requirement", "_", "(_", "Exception_", ")_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "check", "\\u", "call_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retcode_", "=_", "subprocess_", "._", "call_", "(_", "*_", "popen", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "retcode_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Call", "ed", "Process", "Error_", "(_", "retcode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Not", "Give", "n_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "args_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "args", " ", "pass", "ed", " ", "must", " ", "be", " ", "in", " ", "a", " ", "list", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "check", "\\u", "call_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "recurs", "ive", "\\u", "hard", "link_", "(_", "src_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dst_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "curdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "src_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "root_", ",_", "dirs_", ",_", "files_", "in_", "os_", "._", "walk_", "(_", "os_", "._", "curdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "file_", "in_", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fullpath_", "=_", "os_", "._", "path_", "._", "normpath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "root_", ",_", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dirname_", ",_", "fname_", "=_", "os_", "._", "path_", "._", "split_", "(_", "fullpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dst", "dir_", "=_", "os_", "._", "path_", "._", "normpath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "dst_", ",_", "dirname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "dst", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "makedirs_", "(_", "dst", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "newpath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dst", "dir_", ",_", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "newpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "os_", "._", "path_", "._", "same", "file_", "(_", "fullpath_", ",_", "newpath_", ")_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "os_", "._", "unlink_", "(_", "newpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "'", "linking", " ", "%", "s", " ", "->", " ", "%", "s", "'%", "(", "full", "path", ",", "newpa", "th", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "\\u", "func_", "(_", "fullpath_", ",_", "newpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "chdir_", "(_", "orig", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "debi", "ani", "ze", "\\u", "name_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "make", " ", "name", " ", "acceptabl", "e", " ", "as", " ", "a", " ", "Deb", "ian", " ", "(", "binar", "y", ")", " ", "package", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "name_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "source", "\\u", "debi", "ani", "ze", "\\u", "name_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "make", " ", "name", " ", "acceptabl", "e", " ", "as", " ", "a", " ", "Deb", "ian", " ", "source", " ", "package", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "name_", "._", "replace_", "(_", "'\\u'_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "name_", "._", "replace_", "(_", "'.'_", ",_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "name_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "debi", "ani", "ze", "\\u", "version_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "make", " ", "name", " ", "acceptabl", "e", " ", "as", " ", "a", " ", "Deb", "ian", " ", "package", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "shou", "ld", " ", "use", " ", "setup", "tool", "s", "'", " ", "version", " ", "sorting", " ", "and", " ", "do", " ", "this", " ", "proper", "ly", ":_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "._", "replace_", "(_", "'.", "dev", "'_", ",_", "'", "~", "dev", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "dpkg", "\\u", "compare", "\\u", "versions_", "(_", "v1_", ",_", "op_", ",_", "v2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "'/", "usr", "/", "bin", "/", "dpkg", "'_", ",_", "'--", "compare", "-", "version", "s", "'_", ",_", "v1_", ",_", "op_", ",_", "v2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "subprocess_", "._", "Popen_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returncode_", "=_", "cmd_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "cmd", "\\u", "stdout_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "subprocess_", "._", "Popen_", "(_", "args_", ",_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returncode_", "=_", "cmd_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "return", "code", " ", "%", "d", "'_", ",_", "returncode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "norms", "tr_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "str_", "(_", "s_", ",_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2", ".", "x_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "date", "\\u", "822", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "output", " ", "of", " ", "822", "-", "date", " ", "command", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "'/", "bin", "/", "date", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'%", "s", " ", "command", " ", "doe", "s", " ", "not", " ", "exist", ".'_", "%_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "[_", "cmd_", ",_", "'-", "R", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "get", "\\u", "cmd", "\\u", "stdout_", "(_", "args_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "norms", "tr_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "version", "\\u", "str_", "(_", "pkg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "'/", "usr", "/", "bin", "/", "dpkg", "-", "query", "'_", ",_", "'--", "show", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "show", "format", "=$", "{", "Version", "}'_", ",_", "pkg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stdout_", "=_", "get", "\\u", "cmd", "\\u", "stdout_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "stdout_", "._", "strip_", "(_", ")_", "._", "decode_", "(_", "'", "ascii", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "module_", "(_", "name_", ",_", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "imp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suffix_", "=_", "'.", "py", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "description_", "in_", "imp_", "._", "get", "\\u", "suffixes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "description_", "[_", "0_", "]_", "==_", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fd_", "=_", "open_", "(_", "fname_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module_", "=_", "imp_", "._", "load", "\\u", "module_", "(_", "name_", ",_", "fd_", ",_", "fname_", ",_", "description_", ")_", "\\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 ", " _", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "module_", "\\u\\u\\uNEWLINE\\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", "deb", "\\u", "depend", "s", "\\u", "from", "\\u", "setup", "tool", "s", "\\u", "requires_", "(_", "requirements_", ",_", "on", "\\u", "failure_", "=_", "\"", "warn", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Supp", "ose", " ", "you", " ", "can", "'", "t", " ", "confi", "dent", "ly", " ", "figure", " ", "out", " ", "a", " ", ".", "deb", " ", "whi", "ch", " ", "satisf", "ies", " ", "a", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "require", "ment", ".", " ", " ", "If", " ", "on", "\\u", "fail", "ure", " ", "==", " ", "'", "warn", "',", " ", "then", " ", "log", " ", "a", " ", "warn", "ing", ".", " ", " ", "If", " ", "on", "\\u", "fail", "ure", "\\", "10", ";", " ", " ", " ", " ", "==", " ", "'", "raise", "'", " ", "then", " ", "raise", " ", "Cant", "Sat", "isf", "y", "Requirement", " ", "exception", ".", " ", " ", "If", " ", "on", "\\u", "fail", "ure", " ", "==", "\\", "10", ";", " ", " ", " ", " ", "'", "guess", "'", " ", "then", " ", "guess", " ", "tha", "t", " ", "python", "-", "$", "FOO", " ", "will", " ", "satisfy", " ", "the", " ", "dependen", "cy", " ", "and", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "Pyth", "on", " ", "version", " ", "numbers", " ", "will", " ", "appl", "y", " ", "to", " ", "the", " ", "Deb", "ian", " ", "package", "s", " ", "(", "in", " ", "addition", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "logg", "ing", " ", "a", " ", "warn", "ing", " ", "message", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "on", "\\u", "failure_", "in_", "(_", "\"", "raise", "\"_", ",_", "\"", "warn", "\"_", ",_", "\"", "guess", "\"_", ")_", ",_", "on", "\\u", "failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pkg", "\\u", "resources_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "depends_", "=_", "[_", "]_", "#", " ", "Thi", "s", " ", "will", " ", "be", " ", "the", " ", "return", " ", "value", " ", "from", " ", "this", " ", "function", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parsed", "\\u", "reqs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "extra_", ",_", "reqs_", "in_", "pkg", "\\u", "resources_", "._", "split", "\\u", "sections_", "(_", "requirements_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "extra_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed", "\\u", "reqs_", "._", "extend_", "(_", "pkg", "\\u", "resources_", "._", "parse", "\\u", "requirements_", "(_", "reqs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "parsed", "\\u", "reqs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "depends_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "'/", "usr", "/", "bin", "/", "apt", "-", "file", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "apt", "-", "file", " ", "not", " ", "in", " ", "/", "usr", "/", "bin", ".", " ", "Ple", "ase", " ", "install", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "with", ":", " ", "sudo", " ", "apt", "-", "get", " ", "install", " ", "apt", "-", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", "k", " ", "apt", "-", "file", " ", "for", " ", "any", " ", "package", "s", " ", "whi", "ch", " ", "have", " ", "a", " ", ".", "egg", "-", "info", " ", "file", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "these", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "apt", "-", "file", " ", "appear", "s", " ", "to", " ", "think", " ", "tha", "t", " ", "some", " ", "packages_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "e", ".", "g", ".", " ", "setup", "tool", "s", " ", "its", "elf", " ", "have", " ", "\"", "foo", ".", "egg", "-", "info", "/", "BLA", "H", "\"", " ", "files", " ", "but", " ", "not", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "foo", ".", "egg", "-", "info", "\"", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "egg", "info", "re_", "=_", "(_", "\"(", "/(", "%", "s", ")(?", ":-", "[", "^", "/]+", ")?(", "?:", "-", "py", "[", "0", "-", "9", "]\\\\", ".", "[", "0", "-", "9", ".]+", ")?", "\\\\.", "egg", "-", "info", ")\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "'|'_", "._", "join_", "(_", "req_", "._", "project", "\\u", "name_", "._", "replace_", "(_", "'-'_", ",_", "'\\u'_", ")_", "for_", "req_", "in_", "parsed", "\\u", "reqs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "[_", "\"", "apt", "-", "file", "\"_", ",_", "\"", "search", "\"_", ",_", "\"--", "ignore", "-", "case", "\"_", ",_", "\"--", "regexp", "\"_", ",_", "egg", "info", "re_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "dry", " ", "run", " ", "on", " ", "apt", "-", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dry", "\\u", "run", "\\u", "args_", "=_", "args_", "[_", ":_", "]_", "+_", "[_", "'--", "dummy", "'_", ",_", "'--", "non", "-", "interactive", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "subprocess_", "._", "Popen_", "(_", "dry", "\\u", "run", "\\u", "args_", ",_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returncode_", "=_", "cmd_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "output_", "=_", "cmd_", "._", "stderr_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "Error", " ", "runn", "ing", " ", "\"", "apt", "-", "file", " ", "search", "\":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "err", "\\u", "output_", "._", "strip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "subprocess_", "._", "Popen_", "(_", "args_", ",_", "stdin_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "universal", "\\u", "newlines_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "le_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "catch", " ", "rc", "=", "1", " ", "and", " ", "\"", "E", ":", " ", "The", " ", "cache", " ", "director", "y", " ", "is", " ", "empty", ".", " ", "You", " ", "need", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "'", "apt", "-", "file", " ", "update", "'", " ", "first", ".\",", " ", "and", " ", "tell", " ", "the", " ", "user", " ", "to", " ", "follow", " ", "tho", "se_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instruct", "ion", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "exception", " ", "%", "s", " ", "from", " ", "subproc", "ess", " ", "%", "s", "'_", "%_", "(_", "le_", ",_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "returncode_", "=_", "cmd_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "return", "code", " ", "%", "d", " ", "from", " ", "subproc", "ess", " ", "%", "s", "'_", "%_", "(_", "returncode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "inlines_", "=_", "cmd_", "._", "stdout_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dd_", "=_", "{_", "}_", "#", " ", "{", "pyd", "ist", "name", ":", " ", "{", "pyd", "ist", ":", " ", "set", "(", "deb", "package", "name", ")}", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "E_", "=_", "re_", "._", "compile_", "(_", "egg", "info", "re_", ",_", "re_", "._", "I_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "D_", "=_", "re_", "._", "compile_", "(_", "\"", "^", "([", "^", ":]", "*)", ":\"_", ",_", "re_", "._", "I_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "egg", "snd", "ebs", "_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "l_", "in_", "inlines_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "l_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "emo", "_", "=_", "E_", "._", "search_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "emo", "_", ",_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dmo", "_", "=_", "D_", "._", "search_", "(_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "dmo", "_", ",_", "l_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "egg", "snd", "ebs", "_", "._", "add_", "(_", "(_", "emo", "_", "._", "group_", "(_", "1_", ")_", ",_", "dmo", "_", "._", "group_", "(_", "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_", "for_", "(_", "egg", "info_", ",_", "deb", "name_", ")_", "in_", "egg", "snd", "ebs", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyd", "ist_", "=_", "pkg", "\\u", "resources_", "._", "Distribution_", "._", "from", "\\u", "filename_", "(_", "egg", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dd_", "._", "setdefault_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pyd", "ist_", "._", "project", "\\u", "name_", "._", "lower_", "(_", ")_", ",_", "{_", "}_", ")_", "._", "setdefault_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pyd", "ist_", ",_", "set_", "(_", ")_", ")_", "._", "add_", "(_", "deb", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", "as_", "le_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "\"", "I", " ", "got", " ", "an", " ", "error", " ", "pars", "ing", " ", "a", " ", ".", "egg", "-", "info", " ", "file", " ", "named", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "from", " ", "Deb", "ian", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "as", " ", "a", " ", "pkg", "\\u", "resource", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Distribut", "ion", ":", " ", "%", "s", "\"_", "%_", "(_", "egg", "info_", ",_", "deb", "name_", ",_", "le_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "for", " ", "each", " ", "require", "ment", ",", " ", "see", " ", "if", " ", "a", " ", "Deb", "ian", " ", "package", " ", "satisf", "ies", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ops_", "=_", "{_", "'<'_", ":_", "'<<", "'_", ",_", "'>'_", ":_", "'>>", "'_", ",_", "'=='_", ":_", "'='_", ",_", "'<='_", ":_", "'<='_", ",_", "'>='_", ":_", "'>='_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "req_", "in_", "parsed", "\\u", "reqs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "req", "name_", "=_", "req_", "._", "project", "\\u", "name_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "deb", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pyd", "ist_", ",_", "deb", "s_", "in_", "dd_", "._", "get_", "(_", "req", "name_", ",_", "{_", "}_", ")_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pyd", "ist_", "in_", "req_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "log", ".", "info", "(\"", "I", " ", "found", " ", "Deb", "ian", " ", "package", "s", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "whi", "ch", " ", "provide", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "\"", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\",", " ", "version", " ", "\\\\\"", "%", "s", "\\\\\",", " ", "whi", "ch", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "\"", "satisf", "ies", " ", "our", " ", "version", " ", "require", "ment", "s", ":", " ", "\\\\\"", "%", "s", "\\\\\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "%", " ", "('", ",", " ", "'.", "join", "(", "deb", "s", "),", " ", "req", ".", "project", "\\u", "name", ",", " ", "ver", ",", " ", "req", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "good", "deb", "s_", "|=_", "(_", "deb", "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 ", " _", "log_", "._", "info_", "(_", "\"", "I", " ", "found", " ", "Deb", "ian", " ", "package", "s", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "whi", "ch", " ", "provide", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "whi", "ch", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "doe", "s", " ", "not", " ", "satisfy", " ", "our", " ", "version", " ", "require", "ment", "s", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\\"", "%", "s", "\\\\\"", " ", "--", " ", "ign", "orin", "g", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "',", " ", "'_", "._", "join_", "(_", "deb", "s_", ")_", ",_", "req_", "._", "project", "\\u", "name_", ",_", "req_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "good", "deb", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "on", "\\u", "failure_", "==_", "'", "warn", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "I", " ", "found", " ", "no", " ", "Deb", "ian", " ", "package", " ", "whi", "ch", " ", "provide", "s", " ", "the", " ", "require", "d", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "with", " ", "version", " ", "require", "ment", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\\"", "%", "s", "\\\\\".", "\"_", "%_", "(_", "req_", "._", "project", "\\u", "name_", ",_", "req_", "._", "specs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "on", "\\u", "failure_", "==_", "\"", "raise", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Cant", "Sat", "isf", "y", "Requirement", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "I", " ", "found", " ", "no", " ", "Deb", "ian", " ", "package", " ", "whi", "ch", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "provide", "s", " ", "the", " ", "require", "d", " ", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "with", " ", "version", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "require", "ment", "s", " ", "\\\\\"", "%", "s", "\\\\\".", "\"_", "%_", "(_", "req_", "._", "project", "\\u", "name_", ",_", "req_", "._", "specs_", ")_", ",_", "req_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "on", "\\u", "failure_", "==_", "\"", "guess", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "\"", "I", " ", "found", " ", "no", " ", "Deb", "ian", " ", "package", " ", "whi", "ch", " ", "provide", "s", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "require", "d", " ", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "with", " ", "version", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "require", "ment", "s", " ", "\\\\\"", "%", "s", "\\\\\".", " ", " ", "Guess", "ing", " ", "blind", "ly", " ", "tha", "t", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", " ", "\\\\\"", "python", "-%", "s", "\\\\\"", " ", "will", " ", "be", " ", "it", ",", " ", "and", " ", "tha", "t", " ", "the", " ", "Pyth", "on", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "package", " ", "version", " ", "number", " ", "require", "ment", "s", " ", "will", " ", "appl", "y", " ", "to", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "Deb", "ian", " ", "package", ".\"_", "%_", "(_", "req_", "._", "project", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "req_", "._", "specs_", ",_", "req", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "deb", "s_", "._", "add_", "(_", "\"", "python", "-\"_", "+_", "req", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "good", "deb", "s_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "\"", "I", " ", "found", " ", "a", " ", "Deb", "ian", " ", "package", " ", "whi", "ch", " ", "provide", "s", " ", "the", " ", "require", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Pyth", "on", " ", "package", ".", " ", " ", "Pyth", "on", " ", "package", ":", " ", "\\\\\"", "%", "s", "\\\\\",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Deb", "ian", " ", "package", ":", " ", "\\\\\"", "%", "s", "\\\\\"", ";", " ", " ", "addin", "g", " ", "Depend", "s", " ", "specifica", "tion", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "for", " ", "the", " ", "follow", "ing", " ", "version", "(", "s", "):", " ", "\\\\\"", "%", "s", "\\\\\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "req_", "._", "project", "\\u", "name_", ",_", "tuple_", "(_", "good", "deb", "s_", ")_", "[_", "0_", "]_", ",_", "req_", "._", "specs_", ")_", ")_", "\\u\\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_", "._", "warn_", "(_", "\"", "I", " ", "found", " ", "multiple", " ", "Deb", "ian", " ", "package", "s", " ", "whi", "ch", " ", "provide", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Pyth", "on", " ", "distribu", "tion", " ", "require", "d", ".", " ", " ", "I", "'", "m", " ", "listi", "ng", " ", "them", " ", "all", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "as", " ", "alternat", "es", ".", " ", " ", "Candidate", " ", "deb", "s", " ", "whi", "ch", " ", "claim", " ", "to", " ", "provide", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "the", " ", "Pyth", "on", " ", "package", " ", "\\\\\"", "%", "s", "\\\\\"", " ", "are", ":", " ", "\\\\\"", "%", "s", "\\\\\"\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "req_", "._", "project", "\\u", "name_", ",_", "',", " ", "'_", "._", "join_", "(_", "good", "deb", "s_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "alts", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "deb", "_", "in_", "good", "deb", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "adde", "d\\u", "any", "\\u", "alt_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "spec_", "in_", "req_", "._", "specs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Her", "e", " ", "we", " ", "blit", "hel", "y", " ", "assume", " ", "tha", "t", " ", "the", " ", "Deb", "ian", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "version", "s", " ", "are", " ", "eno", "ugh", " ", "like", " ", "the", " ", "Pyth", "on", " ", "package", " ", "versions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tha", "t", " ", "the", " ", "require", "ment", " ", "can", " ", "be", " ", "porte", "d", " ", "straight", " ", "over", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alts", "_", "._", "append_", "(_", "\"%", "s", " ", "(%", "s", " ", "%", "s", ")\"_", "%_", "(_", "deb", "_", ",_", "ops_", "[_", "spec_", "[_", "0_", "]_", "]_", ",_", "spec_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adde", "d\\u", "any", "\\u", "alt_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "adde", "d\\u", "any", "\\u", "alt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "alternat", "es", " ", "wer", "e", " ", "adde", "d", ",", " ", "but", " ", "we", " ", "have", " ", "the", " ", "name", " ", "of", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "good", " ", "package", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alts", "_", "._", "append_", "(_", "\"%", "s", "\"_", "%_", "deb", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "alts", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "depends_", "._", "append_", "(_", "'", " ", "|", " ", "'_", "._", "join_", "(_", "alts", "_", ")_", ")_", "\\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_", "depends_", "\\u\\u\\uNEWLINE\\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", "tarball", "_", "(_", "tarball", "\\u", "fname_", ",_", "directory_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "create", " ", "a", " ", "tarball", " ", "from", " ", "a", " ", "director", "y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tarball", "\\u", "fname_", "._", "endswith_", "(_", "'.", "gz", "'_", ")_", ":_", "opts_", "=_", "'", "cz", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "opts_", "=_", "'", "cf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'/", "bin", "/", "tar", "'_", ",_", "opts_", ",_", "tarball", "\\u", "fname_", ",_", "directory_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "expand", "\\u", "tarball", "_", "(_", "tarball", "\\u", "fname_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "expand", " ", "a", " ", "tarball", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tarball", "\\u", "fname_", "._", "endswith_", "(_", "'.", "gz", "'_", ")_", ":_", "opts_", "=_", "'", "xz", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "tarball", "\\u", "fname_", "._", "endswith_", "(_", "'.", "bz2", "'_", ")_", ":_", "opts_", "=_", "'", "xj", "f", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "opts_", "=_", "'", "xf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'/", "bin", "/", "tar", "'_", ",_", "opts_", ",_", "tarball", "\\u", "fname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "expand", "\\u", "zip_", "(_", "zip", "\\u", "fname_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "expand", " ", "a", " ", "zip", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unzip", "\\u", "path_", "=_", "'/", "usr", "/", "bin", "/", "unzip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "unzip", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", ":", " ", "{}", " ", "doe", "s", " ", "not", " ", "exist", "'_", "._", "format_", "(_", "unzip", "\\u", "path_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "=_", "[_", "unzip", "\\u", "path_", ",_", "zip", "\\u", "fname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", "es", " ", "it", " ", "have", " ", "a", " ", "top", " ", "dir_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "args_", "[_", "0_", "]_", ",_", "'-", "l", "'_", ",_", "args_", "[_", "1_", "]_", "]_", ",_", "cwd_", "=_", "cwd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "contents_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "res_", "._", "stdout_", "._", "readlines_", "(_", ")_", "[_", "3_", ":_", "-_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "contents_", "._", "append_", "(_", "line_", "._", "split_", "(_", ")_", "[_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common", "prefix_", "=_", "os_", "._", "path_", "._", "common", "prefix_", "(_", "contents_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "common", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ext", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "cwd_", ",_", "os_", "._", "path_", "._", "basename_", "(_", "zip", "\\u", "fname_", "[_", ":_", "-_", "4_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "extend_", "(_", "[_", "'-", "d", "'_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "ext", "dir_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "expand", "\\u", "sdist", "\\u", "file_", "(_", "sdist", "\\u", "file_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lower", "\\u", "sdist", "\\u", "file_", "=_", "sdist", "\\u", "file_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lower", "\\u", "sdist", "\\u", "file_", "._", "endswith_", "(_", "'.", "zip", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expand", "\\u", "zip_", "(_", "sdist", "\\u", "file_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lower", "\\u", "sdist", "\\u", "file_", "._", "endswith_", "(_", "'.", "tar", ".", "bz2", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expand", "\\u", "tarball", "_", "(_", "sdist", "\\u", "file_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "lower", "\\u", "sdist", "\\u", "file_", "._", "endswith_", "(_", "'.", "tar", ".", "gz", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expand", "\\u", "tarball", "_", "(_", "sdist", "\\u", "file_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\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_", "Run", "time", "Error_", "(_", "'", "coul", "d", " ", "not", " ", "guess", " ", "format", " ", "of", " ", "original", " ", "sdist", " ", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "repa", "ck", "\\u", "tarball", "\\u", "with", "\\u", "debi", "ani", "zed", "\\u", "dirname_", "(_", "orig", "\\u", "sdist", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repa", "cked", "\\u", "sdist", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "ani", "zed", "\\u", "dirname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "original", "\\u", "dirname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "working", "\\u", "dir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expand", "\\u", "sdist", "\\u", "file_", "(_", "orig", "\\u", "sdist", "\\u", "file_", ",_", "cwd_", "=_", "working", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "path", "\\u", "original", "\\u", "dirname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "working", "\\u", "dir_", ",_", "original", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "path", "\\u", "debi", "ani", "zed", "\\u", "dirname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "working", "\\u", "dir_", ",_", "debi", "ani", "zed", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ensure", " ", "sdist", " ", "look", "s", " ", "like", " ", "sdist", ":_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "os_", "._", "path_", "._", "exists_", "(_", "full", "path", "\\u", "original", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "os_", "._", "listdir_", "(_", "working", "\\u", "dir_", ")_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "full", "path", "\\u", "original", "\\u", "dirname_", "!=_", "full", "path", "\\u", "debi", "ani", "zed", "\\u", "dirname_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "rename", " ", "original", " ", "dir", "name", " ", "to", " ", "debi", "ani", "zed", " ", "dirname_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "rename_", "(_", "full", "path", "\\u", "original", "\\u", "dirname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "full", "path", "\\u", "debi", "ani", "zed", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "make", "\\u", "tarball", "_", "(_", "repa", "cked", "\\u", "sdist", "\\u", "file_", ",_", "debi", "ani", "zed", "\\u", "dirname_", ",_", "cwd_", "=_", "working", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "working", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dpkg", "\\u", "build", "package_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cwd_", "=_", "kwargs_", "._", "pop_", "(_", "'", "cw", "d", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "kwargs_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "only", " ", "kwarg", " ", "can", " ", "be", " ", "\"", "cw", "d", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\"", "call", " ", "dpkg", "-", "build", "package", " ", "[", "arg", "1", "]", " ", "[...", "]", " ", "[", "arg", "N", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'/", "usr", "/", "bin", "/", "dpkg", "-", "build", "package", "'_", "]_", "+_", "list_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dpkg", "\\u", "source_", "(_", "b", "\\u", "or", "\\u", "x_", ",_", "arg1_", ",_", "cwd_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "call", " ", "dpkg", "-", "source", " ", "-", "b", "|", "x", " ", "arg", "1", " ", "[", "arg", "2", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "b", "\\u", "or", "\\u", "x_", "in_", "[_", "'-", "b", "'_", ",_", "'-", "x", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'/", "usr", "/", "bin", "/", "dpkg", "-", "source", "'_", ",_", "b", "\\u", "or", "\\u", "x_", ",_", "arg1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "process", "\\u", "command_", "(_", "args_", ",_", "cwd_", "=_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\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", "patch_", "(_", "patch", "file_", ",_", "cwd_", "=_", "None_", ",_", "posix_", "=_", "False_", ",_", "level_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "call", " ", "'", "patch", " ", "-", "p", "[", "level", "]", " ", "[-", "-", "posix", "]", " ", "<", " ", "arg", "1", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "posix", " ", "mode", " ", "is", " ", "somet", "imes", " ", "necessar", "y", ".", " ", "It", " ", "keep", "s", " ", "empty", " ", "files", " ", "so", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "dpkg", "-", "source", " ", "remove", "s", " ", "thei", "r", " ", "content", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "patch", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "patch", "file", " ", "\"%", "s", "\"", " ", "doe", "s", " ", "not", " ", "exist", "'_", "%_", "patch", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fd_", "=_", "open_", "(_", "patch", "file_", ",_", "mode_", "=_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "level", "\\u", "str_", "=_", "'-", "p", "%", "d", "'_", "%_", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'/", "usr", "/", "bin", "/", "patch", "'_", ",_", "level", "\\u", "str_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "posix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "append_", "(_", "'--", "posix", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "PATCH", " ", "COMMA", "ND", ":", " ", "%", "s", " ", "<", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ",_", "patch", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", " ", " ", "PATCH", "ING", " ", "in", " ", "dir", ":", " ", "%", "s", "'_", ",_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", ">>", " ", "sys", ".", "std", "err", ",", " ", "'", "PATCH", " ", "COMMA", "ND", ":'", ",'", " ", "'.", "join", "(", "args", "),", "'<", "',", "patch", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", ">>", " ", "sys", ".", "std", "err", ",", " ", "'", " ", " ", "PATCH", "ING", " ", "in", " ", "dir", ":'", ",", "cwd_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "subprocess_", "._", "Popen_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ",_", "cwd_", "=_", "cwd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "fd_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returncode_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "returncode_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "returncode_", "=_", "res_", "._", "poll_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ready_", "=_", "select_", "._", "select_", "(_", "[_", "res_", "._", "stdout_", ",_", "res_", "._", "stderr_", "]_", ",_", "[_", "]_", ",_", "[_", "]_", ",_", "0.1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", " ", "figure", " ", "out", " ", "how", " ", "to", " ", "do", " ", "this", " ", "with", "out", " ", "readi", "ng", " ", "byte", "-", "by", "-", "byte_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "res_", "._", "stdout_", "in_", "ready_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "res_", "._", "stdout_", "._", "read_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "res_", "._", "stderr_", "in_", "ready_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "res_", "._", "stderr_", "._", "read_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "finish", " ", "output", "ting", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "res_", "._", "stdout_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "res_", "._", "stderr_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "flush_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "error_", "(_", "'", "ERROR", " ", "in", " ", "%", "s", "'_", ",_", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", ">>", " ", "sys", ".", "std", "err", ",", " ", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'%", "('", " ", "'.", "join", "(", "args", "),", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "print", " ", ">>", " ", "sys", ".", "std", "err", ",", " ", "'", "ERROR", " ", "in", "',", "cwd_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "return", "code", " ", "%", "d", "'_", "%_", "returncode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "vals_", "(_", "cfg_", ",_", "section_", ",_", "option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "parse", " ", "comma", " ", "separate", "d", " ", "values", " ", "in", " ", "debi", "an", " ", "control", " ", "file", " ", "style", " ", "from", " ", ".", "cfg", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vals_", "=_", "cfg_", "._", "get_", "(_", "section_", ",_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Config", "Parser_", "._", "No", "Sect", "ion", "Error_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "section_", "!=_", "'", "DEF", "AUL", "T", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vals_", "=_", "cfg_", "._", "get_", "(_", "'", "DEF", "AUL", "T", "'_", ",_", "option_", ")_", "\\u\\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_", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vals_", "=_", "vals_", "._", "split_", "(_", "'#'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "vals_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "vals_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "[_", "v_", "._", "strip_", "(_", ")_", "for_", "v_", "in_", "vals_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "[_", "v_", "for_", "v_", "in_", "vals_", "if_", "len_", "(_", "v_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vals_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "section_", ",_", "option_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "extract", " ", "a", " ", "single", " ", "value", " ", "from", " ", ".", "cfg", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "section_", ",_", "option_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "vals_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "len_", "(_", "vals_", ")_", "==_", "1_", ",_", "(_", "section_", ",_", "option_", ",_", "vals_", ",_", "type_", "(_", "vals_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "vals_", "[_", "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_", "apt", "\\u", "cache", "\\u", "info_", "(_", "apt", "\\u", "cache", "\\u", "cmd_", ",_", "package", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "apt", "\\u", "cache", "\\u", "cmd_", "not_", "in_", "(_", "'", "show", "src", "'_", ",_", "'", "show", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "don", "'", "t", " ", "know", " ", "how", " ", "to", " ", "run", " ", "apt", "-", "cache", " ", "command", " ", "'%", "s", "'\"_", "%_", "apt", "\\u", "cache", "\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "\"", "apt", "-", "cache", "\"_", ",_", "apt", "\\u", "cache", "\\u", "cmd_", ",_", "package", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "subprocess_", "._", "Popen_", "(_", "args_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdin_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stdout_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "returncode_", "=_", "cmd_", "._", "wait_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "returncode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "line_", "=_", "cmd_", "._", "stderr_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "(_", "returncode_", "==_", "100_", "and_", "err", "line_", "==_", "\"", "E", ":", " ", "You", " ", "must", " ", "put", " ", "some", " ", "'", "source", "'", " ", "URI", "s", " ", "in", " ", "your", " ", "source", "s", ".", "list", "\\\\", "n", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "ERROR", " ", "runn", "ing", ":", " ", "%", "s", "'_", ",_", "'", " ", "'_", "._", "join_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Run", "time", "Error_", "(_", "'", "return", "code", " ", "%", "d", " ", "from", " ", "subproc", "ess", " ", "%", "s", "'_", "%_", "(_", "returncode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "inlines_", "=_", "cmd_", "._", "stdout_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version", "\\u", "blocks_", "=_", "inlines_", "._", "split_", "(_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "version", "\\u", "block_", "in_", "version", "\\u", "blocks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "block", "\\u", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "version", "\\u", "block_", ")_", "==_", "0_", ":_", "\\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_", "version", "\\u", "lines_", "=_", "version", "\\u", "block_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "version", "\\u", "lines_", "[_", "0_", "]_", "._", "startswith_", "(_", "'", "Packa", "ge", ":", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "\\u", "dict_", "[_", "'", "Packa", "ge", "'_", "]_", "=_", "version", "\\u", "lines_", "[_", "0_", "]_", "[_", "len_", "(_", "'", "Packa", "ge", ":", " ", "'_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "apt", "\\u", "cache", "\\u", "cmd_", "==_", "'", "show", "src", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "version", "\\u", "lines_", "[_", "1_", "]_", "._", "startswith_", "(_", "'", "Bin", "ary", ":", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "\\u", "dict_", "[_", "'", "Bin", "ary", "'_", "]_", "=_", "version", "\\u", "lines_", "[_", "1_", "]_", "[_", "len_", "(_", "'", "Bin", "ary", ":", " ", "'_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "\\u", "dict_", "[_", "'", "Bin", "ary", "'_", "]_", "=_", "block", "\\u", "dict_", "[_", "'", "Bin", "ary", "'_", "]_", "._", "split_", "(_", "',", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "apt", "\\u", "cache", "\\u", "cmd_", "==_", "'", "show", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "start_", "in_", "(_", "'", "Prov", "ides", ":", " ", "'_", ",_", "'", "Confl", "icts", ":", " ", "'_", ",_", "'", "Replace", "s", ":", " ", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "start_", "[_", ":_", "-_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "version", "\\u", "lines_", "[_", "2_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "line_", "._", "startswith_", "(_", "start_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "uns", "plit", "\\u", "line", "\\u", "result_", "=_", "line_", "[_", "len_", "(_", "start_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "split", "\\u", "result_", "=_", "uns", "plit", "\\u", "line", "\\u", "result_", "._", "split_", "(_", "',", " ", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "\\u", "dict_", "[_", "key_", "]_", "=_", "split", "\\u", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key_", "not_", "in_", "block", "\\u", "dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "block", "\\u", "dict_", "[_", "key_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result", "\\u", "list_", "._", "append_", "(_", "block", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result", "\\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_", "check", "\\u", "cfg", "\\u", "files_", "(_", "cfg", "\\u", "files_", ",_", "module", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "check", " ", "if", " ", "the", " ", "configura", "tion", " ", "files", " ", "actual", "ly", " ", "speci", "fy", " ", "somet", "hing", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "config", " ", "files", " ", "are", " ", "give", "n", ",", " ", "give", " ", "warn", "ing", " ", "if", " ", "the", "y", " ", "don", "'", "t", " ", "contain", "\\", "10", ";", " ", " ", " ", " ", "informati", "on", ".", " ", "Thi", "s", " ", "may", " ", "indicat", "e", " ", "a", " ", "wrong", " ", "module", " ", "name", " ", "name", ",", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "example", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", "=_", "Config", "Parser_", "._", "Safe", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "._", "read_", "(_", "cfg", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cfg_", "._", "has", "\\u", "section_", "(_", "module", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section", "\\u", "items_", "=_", "cfg_", "._", "items_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "section", "\\u", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "default", "\\u", "items_", "=_", "cfg_", "._", "items_", "(_", "'", "DEF", "AUL", "T", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "items_", "=_", "len_", "(_", "section", "\\u", "items_", ")_", "+_", "len_", "(_", "default", "\\u", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "n", "\\u", "items_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "'", "configura", "tion", " ", "files", " ", "wer", "e", " ", "specified", ",", " ", "but", " ", "no", " ", "options", " ", "wer", "e", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "found", " ", "in", " ", "\"%", "s", "\"", " ", "or", " ", "\"", "DEF", "AUL", "T", "\"", " ", "section", "s", ".'_", "%_", "(_", "module", "\\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_", "class_", "Deb", "ian", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "encapsulat", "e", " ", "informati", "on", " ", "for", " ", "Deb", "ian", " ", "distribu", "tion", " ", "system", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Deb", "ian", "Info_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cfg", "\\u", "files_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "name_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "distribution_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "guess", "\\u", "maintainer_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ups", "tream", "\\u", "version_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "has", "\\u", "ext", "\\u", "modules_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long", "\\u", "description_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "patch", "\\u", "file_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "patch", "\\u", "level_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "\\u", "requires_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "an", "\\u", "version_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "have", "\\u", "script", "\\u", "entry", "\\u", "points_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "setuptools_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "guess", "\\u", "confl", "icts", "\\u", "provide", "s", "\\u", "replace", "s_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sdist", "\\u", "dsc", "\\u", "command_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "\\u", "python", "2_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "\\u", "python", "3_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "no", "\\u", "python", "2", "\\u", "scripts_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "no", "\\u", "python", "3", "\\u", "scripts_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "force", "\\u", "x", "\\u", "python", "3", "\\u", "version_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "virtualenv", "\\u", "install", "\\u", "location_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cfg", "\\u", "files_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\"", "cfg", "\\u", "files", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "\\u", "name_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "module", "\\u", "name", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default", "\\u", "distribution_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "default", "\\u", "distribu", "tion", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "guess", "\\u", "maintainer_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "guess", "\\u", "maintainer", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ups", "tream", "\\u", "version_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ups", "tream", "\\u", "version", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "has", "\\u", "ext", "\\u", "modules_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "has", "\\u", "ext", "\\u", "module", "s", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "description_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "description", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "long", "\\u", "description_", "is_", "Not", "Give", "n_", ":_", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "long", "\\u", "description", " ", "must", " ", "be", " ", "supplie", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cfg", "\\u", "defaults_", "=_", "self_", "._", "\\u", "make", "\\u", "cfg", "\\u", "defaults_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "name_", "=_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "distribution_", "=_", "default", "\\u", "distribution_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "guess", "\\u", "maintainer_", "=_", "guess", "\\u", "maintainer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "cfg", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "cfg", "\\u", "files_", "(_", "cfg", "\\u", "files_", ",_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cfg_", "=_", "Config", "Parser_", "._", "Safe", "Config", "Parser_", "(_", "cfg", "\\u", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cfg", "\\u", "file_", "in_", "cfg", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "codecs_", "._", "open_", "(_", "cfg", "\\u", "file_", ",_", "mode_", "=_", "'", "r", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfg_", "._", "readf", "p_", "(_", "fd_", ")_", "\\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_", "sdist", "\\u", "dsc", "\\u", "command_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", " ", "distutils", " ", "command", "s", " ", "to", " ", "override", " ", "config", " ", "files", " ", "(", "this", " ", "lets", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "command", " ", "line", " ", "options", " ", "beat", " ", "file", " ", "options", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "long", "opt_", ",_", "short", "opt_", ",_", "desc_", "in_", "std", "eb", "\\u", "cfg", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opt", "\\u", "name_", "=_", "long", "opt_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "opt", "\\u", "name_", "._", "replace_", "(_", "'-'_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "getattr_", "(_", "sdist", "\\u", "dsc", "\\u", "command_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "cfg_", "._", "has", "\\u", "section_", "(_", "module", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cfg_", "._", "add", "\\u", "section_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cfg_", "._", "set_", "(_", "module", "\\u", "name_", ",_", "opt", "\\u", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "std", "eb", "\\u", "version_", "=_", "\\u\\u", "std", "eb", "\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "module", "\\u", "name_", "=_", "module", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Sou", "rce", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Packa", "ge", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "3_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Packa", "ge", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "forced", "\\u", "ups", "tream", "\\u", "version_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Force", "d", "-", "Ups", "tream", "-", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "forced", "\\u", "ups", "tream", "\\u", "version_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ups", "tream", "\\u", "version", "\\u", "prefix_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ups", "tream", "-", "Version", "-", "Pref", "ix", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ups", "tream", "\\u", "version", "\\u", "suffix_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ups", "tream", "-", "Version", "-", "Su", "ffi", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ups", "tream", "\\u", "version_", "=_", "(_", "ups", "tream", "\\u", "version", "\\u", "prefix_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "ani", "ze", "\\u", "version_", "(_", "ups", "tream", "\\u", "version_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "ups", "tream", "\\u", "version", "\\u", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "debi", "ani", "ze", "\\u", "version_", "(_", "forced", "\\u", "ups", "tream", "\\u", "version_", ")_", "!=_", "\\u\\u\\uNL\\u\\u\\u_", "forced", "\\u", "ups", "tream", "\\u", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "forced", " ", "ups", "tream", " ", "version", " ", "(\"", "%", "s", "\")", " ", "not", " ", "a", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Deb", "ian", "-", "compatible", " ", "version", " ", "(", "e", ".", "g", ".", " ", "\"%", "s", "\")'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "forced", "\\u", "ups", "tream", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "ani", "ze", "\\u", "version_", "(_", "forced", "\\u", "ups", "tream", "\\u", "version_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "ups", "tream", "\\u", "version_", "=_", "forced", "\\u", "ups", "tream", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "epoch_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Epoch", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "epoch_", "!=_", "''_", "and_", "not_", "self_", "._", "epoch_", "._", "endswith_", "(_", "':'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "epoch_", "=_", "self_", "._", "epoch_", "+_", "':'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "packaging", "\\u", "version_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Deb", "ian", "-", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debi", "an", "\\u", "version_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "command", "-", "line", " ", "arg", " ", "override", "s", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "packaging", "\\u", "version_", "=_", "debi", "an", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dsc", "\\u", "version_", "=_", "'%", "s", "-%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ups", "tream", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "packaging", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "full", "\\u", "version_", "=_", "'%", "s", "%", "s", "-%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "epoch_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ups", "tream", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "packaging", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dist", "name_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Suit", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "maintainer_", "=_", "',", " ", "'_", "._", "join_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Maint", "aine", "r", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "uploade", "rs_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Upload", "ers", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "date", "822", "_", "=_", "get", "\\u", "date", "\\u", "822", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build", "\\u", "deps_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "use", "\\u", "setuptools_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "-", "setup", "tool", "s", " ", "(>", "=", " ", "0.", "6b", "3", ")'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "3", "-", "setup", "tool", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "setup", "\\u", "requires_", "is_", "not_", "None_", "and_", "len_", "(_", "setup", "\\u", "requires_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "extend_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "get", "\\u", "deb", "\\u", "depend", "s", "\\u", "from", "\\u", "setup", "tool", "s", "\\u", "requires_", "(_", "setup", "\\u", "requires_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "depends_", "=_", "[_", "'$", "{", "misc", ":", "Depend", "s", "}'_", ",_", "'$", "{", "python", ":", "Depend", "s", "}'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "depend", "s3_", "=_", "[_", "'$", "{", "misc", ":", "Depend", "s", "}'_", ",_", "'$", "{", "python", "3", ":", "Depend", "s", "}'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "need", "\\u", "custom", "\\u", "binar", "y", "\\u", "target_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "has", "\\u", "ext", "\\u", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "architecture_", "=_", "'", "any", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "-", "all", "-", "dev", " ", "(>", "=", " ", "%", "s", ")'_", "%_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "depends_", "._", "append_", "(_", "'$", "{", "shl", "ib", "s", ":", "Depend", "s", "}'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "architecture", "3_", "=_", "'", "any", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "3", "-", "all", "-", "dev", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "depend", "s3_", "._", "append_", "(_", "'$", "{", "shl", "ib", "s", ":", "Depend", "s", "}'_", ")_", "\\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 ", " _", "self_", "._", "architecture_", "=_", "'", "all", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "-", "all", " ", "(>", "=", " ", "%", "s", ")'_", "%_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "architecture", "3_", "=_", "'", "all", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "python", "3", "-", "all", "'_", ")_", "\\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_", "._", "copyr", "ight", "\\u", "file_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Copy", "right", "-", "File", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mime", "\\u", "file_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "MIME", "-", "File", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shared", "\\u", "mime", "\\u", "file_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Share", "d", "-", "MIME", "-", "File", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "mime", "\\u", "file_", "==_", "''_", "and_", "self_", "._", "shared", "\\u", "mime", "\\u", "file_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dh", "\\u", "install", "mime", "\\u", "indep", "\\u", "line_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "\\u", "custom", "\\u", "binar", "y", "\\u", "target_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dh", "\\u", "install", "mime", "\\u", "indep", "\\u", "line_", "=_", "'\\\\", "td", "h", "\\u", "install", "mime", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mime", "\\u", "desk", "top", "\\u", "files_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "MIME", "-", "Des", "kto", "p", "-", "Files", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "mime", "\\u", "desk", "top", "\\u", "files_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "\\u", "custom", "\\u", "binar", "y", "\\u", "target_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dh", "\\u", "desk", "top", "\\u", "indep", "\\u", "line_", "=_", "'\\\\", "td", "h", "\\u", "desk", "top", "'_", "\\u\\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_", "._", "dh", "\\u", "desk", "top", "\\u", "indep", "\\u", "line_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "E", ".", " ", "any", " ", "mime", " ", ".", "desk", "top", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "install", "\\u", "file", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mime", "\\u", "desk", "top", "\\u", "file_", "in_", "mime", "\\u", "desk", "top", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "install", "\\u", "file", "\\u", "lines_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'%", "s", " ", "usr", "/", "share", "/", "applica", "tion", "s", "'_", "%_", "mime", "\\u", "desk", "top", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "depends_", "._", "extend_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Depend", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "depend", "s3_", "._", "extend_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Depend", "s3", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "depends_", "=_", "',", " ", "'_", "._", "join_", "(_", "depends_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "depend", "s3_", "=_", "',", " ", "'_", "._", "join_", "(_", "depend", "s3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "debi", "an", "\\u", "section_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Sect", "ion", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "description_", "=_", "re_", "._", "sub_", "(_", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "description_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "long", "\\u", "description_", "!=_", "'", "UNK", "NOW", "N", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ld", "2_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "line_", "in_", "long", "\\u", "description_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ls_", "=_", "line_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "ls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ld", "2_", "._", "append_", "(_", "'", " ", "'_", "+_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ld", "2_", "._", "append_", "(_", "'", " ", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ld", "2_", "=_", "ld", "2_", "[_", ":_", "20_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "long", "\\u", "description_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "ld", "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 ", " _", "self_", "._", "long", "\\u", "description_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "have", "\\u", "script", "\\u", "entry", "\\u", "points_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "deb", "help", "er", " ", "(>", "=", " ", "%", "s", ")'_", "%_", "DH", "\\u", "IDE", "AL", "\\u", "VER", "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 ", " _", "build", "\\u", "deps_", "._", "append_", "(_", "'", "deb", "help", "er", " ", "(>", "=", " ", "%", "s", ")'_", "%_", "DH", "\\u", "MIN", "\\u", "VER", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "build", "\\u", "deps_", "._", "extend_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Build", "-", "Depend", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "build", "\\u", "depends_", "=_", "',", " ", "'_", "._", "join_", "(_", "build", "\\u", "deps_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "suggest", "s_", "=_", "',", " ", "'_", "._", "join_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Sug", "gest", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suggest", "s3_", "=_", "',", " ", "'_", "._", "join_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Sug", "gest", "s3", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recommend", "s_", "=_", "',", " ", "'_", "._", "join_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Recommend", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "recommend", "s3_", "=_", "',", " ", "'_", "._", "join_", "(_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Recommend", "s3", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "source", "\\u", "stanza", "\\u", "extras_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build", "\\u", "conflicts_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Build", "-", "Confl", "icts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "build", "\\u", "conflicts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Build", "-", "Confl", "icts", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "build", "\\u", "conflicts_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "patch", "\\u", "file_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Std", "eb", "-", "Pat", "ch", "-", "File", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "patch", "\\u", "file_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "patch", "\\u", "file_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "A", " ", "patch", " ", "file", " ", "was", " ", "specified", " ", "on", " ", "the", " ", "command", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", " ", "and", " ", "in", " ", ".", "cfg", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "file_", "=_", "patch", "\\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_", "self_", "._", "patch", "\\u", "level_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Std", "eb", "-", "Pat", "ch", "-", "Leve", "l", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "patch", "\\u", "level_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "patch", "\\u", "level_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "A", " ", "patch", " ", "level", " ", "was", " ", "specified", " ", "on", " ", "the", " ", "command", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "line", " ", "and", " ", "in", " ", ".", "cfg", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "level_", "=_", "int_", "(_", "self_", "._", "patch", "\\u", "level_", ")_", "\\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_", "patch", "\\u", "level_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "level_", "=_", "patch", "\\u", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "level_", "=_", "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_", "xs", "\\u", "python", "\\u", "version_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "XS", "-", "Pyth", "on", "-", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "xs", "\\u", "python", "\\u", "version_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "X", "-", "Pyth", "on", "-", "Version", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "xs", "\\u", "python", "\\u", "version_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x", "\\u", "python", "3", "\\u", "version_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "X", "-", "Pyth", "on", "3", "-", "Version", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "python", "3", "\\u", "version_", "=_", "[_", "v_", "._", "strip_", "(_", "'\"'_", ")_", "for_", "v_", "in_", "x", "\\u", "python", "3", "\\u", "version_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "x", "\\u", "python", "3", "\\u", "version_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "source", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "X", "-", "Pyth", "on", "3", "-", "Version", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "x", "\\u", "python", "3", "\\u", "version_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dpkg", "\\u", "shl", "ib", "dep", "s", "\\u", "params_", "=_", "parse", "\\u", "val_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "dpkg", "-", "shl", "ib", "dep", "s", "-", "params", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dpkg", "\\u", "shl", "ib", "dep", "s", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "need", "\\u", "custom", "\\u", "binar", "y", "\\u", "target_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "dh", "\\u", "binar", "y", "\\u", "arch", "\\u", "lines_", "=_", "\"\"\"", "\\\\", "td", "h", " ", "binar", "y", "-", "arch", " ", "--", "bef", "ore", " ", "dh", "\\u", "shl", "ib", "dep", "s", "\\", "10", ";\\\\", "td", "h", "\\u", "shl", "ib", "dep", "s", " ", "-", "a", " ", "--", "dpkg", "-", "shl", "ib", "dep", "s", "-", "params", "=", "%", "s", "\\", "10", ";\\\\", "td", "h", " ", "binar", "y", " ", "--", "after", " ", "dh", "\\u", "shl", "ib", "dep", "s", "\"\"\"_", "%_", "dpkg", "\\u", "shl", "ib", "dep", "s", "\\u", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "dh", "\\u", "binar", "y", "\\u", "arch", "\\u", "lines_", "=_", "'\\\\", "td", "h", " ", "binar", "y", "-", "arch", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dh", "\\u", "binar", "y", "\\u", "indep", "\\u", "lines_", "=_", "'\\\\", "td", "h", " ", "binar", "y", "-", "indep", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conflicts_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Confl", "icts", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confl", "icts", "3_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Confl", "icts", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provides_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Prov", "ides", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provide", "s3_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Prov", "ides", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Replace", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s3_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Replace", "s3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "guess", "\\u", "confl", "icts", "\\u", "provide", "s", "\\u", "replace", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fin", "d", " ", "list", " ", "of", " ", "binaries", " ", "whi", "ch", " ", "we", " ", "will", " ", "confl", "ict", "/", "provide", "/", "replace", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cpr", "\\u", "binaries", "_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "original", " ", "Deb", "ian", " ", "informati", "on", " ", "for", " ", "the", " ", "package", " ", "named", " ", "the", " ", "same", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "version", "\\u", "info_", "in_", "apt", "\\u", "cache", "\\u", "info_", "(_", "'", "show", "src", "'_", ",_", "self_", "._", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reme", "mber", " ", "each", " ", "of", " ", "the", " ", "binar", "y", " ", "package", "s", " ", "produce", "d", " ", "by", " ", "the", " ", "Deb", "ian", " ", "source_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "binary_", "in_", "version", "\\u", "info_", "[_", "'", "Bin", "ary", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cpr", "\\u", "binaries", "_", "._", "add_", "(_", "binary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "do", " ", "this", " ", "for", " ", "every", " ", "version", " ", "avail", "able", " ", ",", " ", "just", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", ",", " ", "or", " ", "???", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Descen", "d", " ", "each", " ", "of", " ", "the", " ", "original", " ", "binaries", " ", "and", " ", "see", " ", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "package", "s", " ", "the", "y", " ", "confl", "ict", "/", " ", "provide", "/", " ", "replace", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "orig", "\\u", "binary_", "in_", "cpr", "\\u", "binaries", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "version", "\\u", "info_", "in_", "apt", "\\u", "cache", "\\u", "info_", "(_", "'", "show", "'_", ",_", "orig", "\\u", "binary_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "provides_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Prov", "ides", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provide", "s3_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Prov", "ides", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conflicts_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Confl", "icts", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confl", "icts", "3_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Confl", "icts", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Replace", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s3_", "._", "extend_", "(_", "version", "\\u", "info_", "[_", "'", "Replace", "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_", "if_", "self_", "._", "package_", "in_", "cpr", "\\u", "binaries", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cpr", "\\u", "binaries", "_", "._", "remove_", "(_", "self_", "._", "package_", ")_", "#", " ", "don", "'", "t", " ", "include", " ", "ours", "elf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cpr", "\\u", "binaries", "_", "=_", "list_", "(_", "cpr", "\\u", "binaries", "_", ")_", "#", " ", "convert", " ", "to", " ", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conflicts_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confl", "icts", "3_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provides_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provide", "s3_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s3_", "._", "extend_", "(_", "cpr", "\\u", "binaries", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "round", "-", "trip", " ", "through", " ", "set", " ", "to", " ", "get", " ", "unique", " ", "entries_", "\\u\\u\\uNL\\u\\u\\u_", "conflicts_", "=_", "list_", "(_", "set_", "(_", "conflicts_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confl", "icts", "3_", "=_", "list_", "(_", "set_", "(_", "confl", "icts", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provides_", "=_", "list_", "(_", "set_", "(_", "provides_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "provide", "s3_", "=_", "list_", "(_", "set_", "(_", "provide", "s3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s_", "=_", "list_", "(_", "set_", "(_", "replace", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "replace", "s3_", "=_", "list_", "(_", "set_", "(_", "replace", "s3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "conflicts_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Confl", "icts", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "conflicts_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "confl", "icts", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "+=_", "(_", "'", "Confl", "icts", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "confl", "icts", "3_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "provides_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Prov", "ides", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "provides_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "provide", "s3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "+=_", "(_", "'", "Prov", "ides", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "provide", "s3_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "replace", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Replace", "s", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "replace", "s_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "replace", "s3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "+=_", "(_", "'", "Replace", "s", ":", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "',", " ", "'_", "._", "join_", "(_", "replace", "s3_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "recommend", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Recommend", "s", ":", " ", "'_", "+_", "recommend", "s_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "recommend", "s3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "+=_", "(_", "'", "Recommend", "s", ":", " ", "'_", "+_", "recommend", "s3_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "suggest", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extras_", "+=_", "(_", "'", "Sug", "gest", "s", ":", " ", "'_", "+_", "suggest", "s_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "suggest", "s3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "package", "\\u", "stanza", "\\u", "extra", "s3_", "+=_", "(_", "'", "Sug", "gest", "s", ":", " ", "'_", "+_", "suggest", "s3_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "dir", "list_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "(_", "with", "\\u", "python", "2_", "or_", "with", "\\u", "python", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "not", "hing", " ", "to", " ", "do", " ", "-", " ", "nei", "ther", " ", "Pyth", "on", " ", "2", " ", "or", " ", "3", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sequence", "r", "\\u", "with_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sequence", "r", "\\u", "with_", "._", "append_", "(_", "'", "python", "2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sequence", "r", "\\u", "with_", "._", "append_", "(_", "'", "python", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "num", "\\u", "binar", "y", "\\u", "packages_", "=_", "len_", "(_", "sequence", "r", "\\u", "with_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "no", "\\u", "script", "\\u", "lines_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "no", "\\u", "python", "2", "\\u", "scripts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "install", " ", "to", " ", "a", " ", "location", " ", "where", " ", "debi", "an", " ", "tool", "s", " ", "do", " ", "not", " ", "find", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "no", "\\u", "python", "2", "\\u", "scripts", "\\u", "cli", "\\u", "args_", "=_", "'--", "install", "-", "scripts", "=", "/", "trash", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "script", "\\u", "lines_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rm", " ", "-", "rf", " ", "debi", "an", "/", "%", "s", "/", "trash", "'_", "%_", "(_", "self_", "._", "package_", ",_", ")_", ")_", "\\u\\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_", "._", "no", "\\u", "python", "2", "\\u", "scripts", "\\u", "cli", "\\u", "args_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "no", "\\u", "python", "3", "\\u", "scripts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "install", " ", "to", " ", "a", " ", "location", " ", "where", " ", "debi", "an", " ", "tool", "s", " ", "do", " ", "not", " ", "find", " ", "them", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "no", "\\u", "python", "3", "\\u", "scripts", "\\u", "cli", "\\u", "args_", "=_", "'--", "install", "-", "scripts", "=", "/", "trash", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "no", "\\u", "script", "\\u", "lines_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rm", " ", "-", "rf", " ", "debi", "an", "/", "%", "s", "/", "trash", "'_", "%_", "(_", "self_", "._", "package", "3_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "no", "\\u", "python", "3", "\\u", "scripts", "\\u", "cli", "\\u", "args_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "scripts", "\\u", "cleanup_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "'", " ", " ", " ", " ", "'_", "+_", "s_", "for_", "s_", "in_", "no", "\\u", "script", "\\u", "lines_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "prefix_", "!=_", "'/", "usr", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "allow", "\\u", "virtualenv", "\\u", "install", "\\u", "location_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "virtualenv", " ", "will", " ", "set", " ", "distutils_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", "prefix", "=", "/", "path", "/", "to", "/", "virtualenv", ",", " ", "but", " ", "unl", "ess", " ", "explicit", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "request", "ed", ",", " ", "we", " ", "want", " ", "to", " ", "install", " ", "int", "o", " ", "/", "usr", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "install", "\\u", "prefix_", "=_", "'--", "prefix", "=", "/", "usr", "'_", "\\u\\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_", "._", "install", "\\u", "prefix_", "=_", "'--", "prefix", "=", "%", "s", "'_", "%_", "sys_", "._", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "install", "\\u", "prefix_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET", "\\u", "PY", "2_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET", "\\u", "PY", "2_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET", "\\u", "PY", "2_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET", "\\u", "PY", "3_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET", "\\u", "PY", "3_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET", "\\u", "PY", "3_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "rule", "s", "\\u", "override", "\\u", "clean", "\\u", "target", "\\u", "python", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "rule", "s", "\\u", "override", "\\u", "build", "\\u", "target", "\\u", "python", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "rule", "s", "\\u", "override", "\\u", "install", "\\u", "target", "\\u", "python", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "override", "\\u", "dh", "\\u", "auto", "\\u", "clean_", "=_", "RULES", "\\u", "OVERRIDE", "\\u", "CLEAN", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "override", "\\u", "dh", "\\u", "auto", "\\u", "build_", "=_", "RULES", "\\u", "OVERRIDE", "\\u", "BUILD", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "override", "\\u", "dh", "\\u", "auto", "\\u", "install_", "=_", "RULES", "\\u", "OVERRIDE", "\\u", "INSTA", "LL", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "force", "\\u", "x", "\\u", "python", "3", "\\u", "version_", "and_", "with", "\\u", "python", "3_", "and_", "x", "\\u", "python", "3", "\\u", "version_", "and_", "x", "\\u", "python", "3", "\\u", "version_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "override", " ", "dh", "\\u", "python", "3", " ", "target", " ", "to", " ", "modif", "y", " ", "the", " ", "dependencies_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "ensure", " ", "tha", "t", " ", "the", " ", "pass", "ed", " ", "minim", "um", " ", "X", "-", "Pyth", "on", "3", "-", "Version", " ", "is", " ", "used", "by_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "x", "\\u", "python", "3", "\\u", "version_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "version_", "._", "endswith_", "(_", "'~'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "+=_", "'~'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "override", "\\u", "dh", "\\u", "python", "3_", "=_", "RULES", "\\u", "OVERRIDE", "\\u", "PYTHON", "3_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scripts", "'_", ":_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", " ", " ", " ", " ", "sed", " ", "-", "i", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "s", "/\\\\", "([", " ", "=", "]", "python", "3", ":", "any", " ", "(\\\\", ")>", "=", " ", "[", "^", ")]", "*\\\\", "()", "\\\\)", "/\\\\\\\\", "1", "%", "s", "\\\\\\\\", "2", "/", "g", "\"", " ", "'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debi", "an", "/", "%", "s", ".", "subst", "vars", "'_", ")_", "%_", "(_", "version_", ",_", "self_", "._", "package", "3_", ")_", "\\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_", "._", "override", "\\u", "dh", "\\u", "python", "3_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sequence", "r", "\\u", "options_", "=_", "[_", "'--", "with", " ", "'_", "+_", "','_", "._", "join_", "(_", "sequence", "r", "\\u", "with_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sequence", "r", "\\u", "options_", "._", "append_", "(_", "'--", "builds", "yste", "m", "=", "python", "\\u", "distutils", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sequence", "r", "\\u", "options_", "=_", "'", " ", "'_", "._", "join_", "(_", "sequence", "r", "\\u", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "setup", "\\u", "env", "\\u", "vars_", "=_", "parse", "\\u", "vals_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Set", "up", "-", "Env", "-", "Var", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exports_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "setup", "\\u", "env", "\\u", "vars_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "exports_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exports_", "+=_", "'#", "export", "s", " ", "specified", " ", "usi", "ng", " ", "std", "eb", " ", "Set", "up", "-", "Env", "-", "Var", "s", ":\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exports_", "+=_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "'", "export", " ", "%", "s", "'_", "%_", "v_", "for_", "v_", "in_", "setup", "\\u", "env", "\\u", "vars_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "exports_", "+=_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "udev", "\\u", "rules_", "=_", "parse", "\\u", "val_", "(_", "cfg_", ",_", "module", "\\u", "name_", ",_", "'", "Ud", "ev", "-", "Rule", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "need", "\\u", "custom", "\\u", "binar", "y", "\\u", "target_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "architecture_", "==_", "'", "all", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "binar", "y", "\\u", "target", "\\u", "lines_", "=_", "(_", "RULES", "\\u", "BIN", "ARY", "\\u", "ALL", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "+_", "RULES", "\\u", "BIN", "ARY", "\\u", "INDE", "P", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\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_", "._", "binar", "y", "\\u", "target", "\\u", "lines_", "=_", "(_", "RULES", "\\u", "BIN", "ARY", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "+_", "RULES", "\\u", "BIN", "ARY", "\\u", "INDE", "P", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", "+_", "RULES", "\\u", "BIN", "ARY", "\\u", "ARCH", "\\u", "TARGET_", "%_", "self_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "binar", "y", "\\u", "target", "\\u", "lines_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "python", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "control", "\\u", "py2", "\\u", "stanza_", "=_", "CONTR", "OL", "\\u", "PY", "2", "\\u", "STAN", "ZA", "_", "%_", "self_", "._", "\\u\\u", "dict\\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_", "._", "control", "\\u", "py2", "\\u", "stanza_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "\\u", "python", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "control", "\\u", "py3", "\\u", "stanza_", "=_", "CONTR", "OL", "\\u", "PY", "3", "\\u", "STAN", "ZA", "_", "%_", "self_", "._", "\\u\\u", "dict\\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_", "._", "control", "\\u", "py3", "\\u", "stanza_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "with", "\\u", "python", "2_", "=_", "with", "\\u", "python", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "with", "\\u", "python", "3_", "=_", "with", "\\u", "python", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "no", "\\u", "python", "2", "\\u", "scripts_", "=_", "no", "\\u", "python", "2", "\\u", "scripts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "no", "\\u", "python", "3", "\\u", "scripts_", "=_", "no", "\\u", "python", "3", "\\u", "scripts_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Deb", "ian", "Info_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "make", "\\u", "cfg", "\\u", "defaults_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "name_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "distribution_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "guess", "\\u", "maintainer_", "=_", "Not", "Give", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "defaults_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", ".*", " ", "\\\\(", "Default", ":", " ", "(.*)", "\\\\)", "$'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "long", "opt_", ",_", "short", "opt_", ",_", "description_", "in_", "std", "eb", "\\u", "cfg", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "long", "opt_", "._", "endswith_", "(_", "'='_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "long", "opt_", "._", "lower_", "(_", ")_", "==_", "long", "opt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "long", "opt_", "[_", ":_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matcho", "bj_", "=_", "default", "\\u", "re_", "._", "search_", "(_", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "matcho", "bj_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "has", " ", "a", " ", "default", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "groups_", "=_", "matcho", "bj_", "._", "groups_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "groups_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "groups_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "few", " ", "special", " ", "cases_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "value_", "==_", "'<", "source", "-", "debi", "ani", "zed", "-", "setup", "-", "name", ">'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "key_", "==_", "'", "source", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "source", "\\u", "debi", "ani", "ze", "\\u", "name_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "'", "python", "-", "<", "debi", "ani", "zed", "-", "setup", "-", "name", ">'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "key_", "==_", "'", "package", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "python", "-'_", "+_", "debi", "ani", "ze", "\\u", "name_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "'", "python", "3", "-", "<", "debi", "ani", "zed", "-", "setup", "-", "name", ">'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "key_", "==_", "'", "package", "3", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "'", "python", "3", "-'_", "+_", "debi", "ani", "ze", "\\u", "name_", "(_", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "value_", "==_", "'<", "setup", "-", "maintainer", "-", "or", "-", "author", ">'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "assert_", "key_", "==_", "'", "maintainer", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "guess", "\\u", "maintainer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "key_", "==_", "'", "suit", "e", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "default", "\\u", "distribution_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "value_", "=_", "default", "\\u", "distribution_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "warn_", "(_", "'", "Dep", "reca", "tion", " ", "warn", "ing", ":", " ", "you", " ", "are", " ", "usi", "ng", " ", "the", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'--", "default", "-", "distribu", "tion", " ", "option", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Switch", " ", "to", " ", "the", " ", "--", "suit", "e", " ", "option", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "default", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defaults_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "defaults_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "dsc", "_", "(_", "debi", "nfo_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dist", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repa", "ckage", "d\\u", "dirname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "orig", "\\u", "sdist", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "patch", "\\u", "posix_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "remove", "\\u", "expand", "ed", "\\u", "source", "\\u", "dir_", "=_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "an", "\\u", "dir\\u", "only_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sign", "\\u", "dsc", "_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "make", " ", "debi", "an", " ", "source", " ", "package", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "A", ".", " ", "Fin", "d", " ", "new", " ", "dir", "name", " ", "and", " ", "delete", " ", "any", " ", "pre", "-", "exist", "ing", " ", "contents_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dist", "\\u", "dir", " ", "is", " ", "usual", "ly", " ", "'", "deb", "\\u", "dist", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "location", " ", "of", " ", "the", " ", "copie", "d", " ", "original", " ", "source", " ", "package", " ", "(", "it", " ", "was", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "re", "-", "recreate", "d", " ", "in", " ", "dist", "\\u", "dir", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "debi", "an", "\\u", "dir\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "curdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dist", "\\u", "dir_", ",_", "repa", "ckage", "d\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "make", " ", "temporar", "y", " ", "original", " ", "source", " ", "tarball", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", ",", " ", "for", " ", "the", " ", "final", " ", "tarball", ",", " ", "best", " ", "practic", "es", " ", "suggest", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "usi", "ng", " ", "\"", "dpkg", "-", "source", " ", "-", "b", "\".", " ", " ", "See", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "http", "://", "www", ".", "debi", "an", ".", "org", "/", "doc", "/", "developer", "s", "-", "reference", "/", "ch", "-", "best", "-", "pkg", "ing", "-", "practic", "es", ".", "en", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "name", " ", "of", " ", "the", " ", "tarball", " ", "tha", "t", " ", "quali", "fie", "s", " ", "as", " ", "the", " ", "upstream_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "source", ".", " ", "If", " ", "the", " ", "original", " ", "was", " ", "specified", ",", " ", "we", "'", "ll", " ", "link", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", ".", " ", "Ot", "her", "wis", "e", ",", " ", "we", " ", "generat", "e", " ", "our", " ", "own", " ", ".", "tar", ".", "gz", " ", "file", " ", "from", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "\"", "python", " ", "setup", ".", "py", " ", "sdist", "\"", " ", "(", "don", "e", " ", "above", ")", " ", "so", " ", "tha", "t", " ", "we", " ", "avoid", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "packaging", " ", ".", "svn", " ", "director", "ies", ",", " ", "for", " ", "example", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "debi", "an", "\\u", "dir\\u", "only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "_", "=_", "(_", "'%", "(", "source", ")", "s", "\\u", "%", "(", "ups", "tream", "\\u", "version", ")", "s", ".", "orig", ".", "tar", ".", "gz", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "nfo_", "._", "\\u\\u", "dict\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dist", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "orig", "\\u", "sdist", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "exists_", "(_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "unlink_", "(_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "\\u", "func_", "(_", "orig", "\\u", "sdist", "_", ",_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "make", "\\u", "tarball", "_", "(_", "repa", "ckage", "d\\u", "orig", "\\u", "tarball", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "repa", "ckage", "d\\u", "dirname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "dist", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appl", "y", " ", "patch_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debi", "nfo_", "._", "patch", "\\u", "file_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appl", "y", "\\u", "patch_", "(_", "debi", "nfo_", "._", "patch", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "posix_", "=_", "patch", "\\u", "posix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "debi", "nfo_", "._", "patch", "\\u", "level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ")_", "\\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_", "fname_", "in_", "[_", "'", "Make", "file", "'_", ",_", "'", "makefile", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "exists_", "(_", "os_", "._", "path_", "._", "join_", "(_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ",_", "fname_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stderr_", "._", "write_", "(_", "'*'_", "*_", "1000_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "'", "WARN", "ING", ":", " ", "a", " ", "Make", "file", " ", "exist", "s", " ", "in", " ", "this", " ", "package", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "std", "eb", " ", "will", " ", "tell", " ", "deb", "help", "er", " ", "7", " ", "to", " ", "use", " ", "setup", ".", "py", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", " ", "build", " ", "and", " ", "install", " ", "the", " ", "package", ",", " ", "and", " ", "the", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Make", "file", " ", "will", " ", "be", " ", "ignore", "d", ".\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stderr_", "._", "write_", "(_", "'*'_", "*_", "1000_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "create", " ", "debi", "an", "/", " ", "director", "y", " ", "and", " ", "contents_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debi", "an", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ",_", "'", "debi", "an", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "debi", "an", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "debi", "an", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "A", ".", " ", "debi", "an", "/", "changelog_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "changelog_", "=_", "CHANGE", "LOG", "\\u", "FILE_", "%_", "debi", "nfo_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "codecs_", "._", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "change", "log", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "w", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "._", "write_", "(_", "changelog_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "B", ".", " ", "debi", "an", "/", "control_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debi", "nfo_", "._", "uploade", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debi", "nfo_", "._", "uploade", "rs_", "=_", "'", "Upload", "ers", ":", " ", "%", "s", "\\\\", "n", "'_", "%_", "',", " ", "'_", "._", "join_", "(_", "debi", "nfo_", "._", "uploade", "rs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debi", "nfo_", "._", "uploade", "rs_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "control_", "=_", "CONTR", "OL", "\\u", "FILE_", "%_", "debi", "nfo_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "codecs_", "._", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "control", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "w", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "._", "write_", "(_", "control_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "C", ".", " ", "debi", "an", "/", "rules_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debi", "nfo_", "._", "percent", "\\u", "symbol_", "=_", "'%'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "RULES", "\\u", "MAIN", "_", "%_", "debi", "nfo_", "._", "\\u\\u", "dict\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rules_", "=_", "rules_", "._", "replace_", "(_", "'", " ", " ", " ", " ", "'_", ",_", "'\\\\", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "s", "\\u", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "rule", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "codecs_", "._", "open_", "(_", "rule", "s", "\\u", "fname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mode_", "=_", "'", "w", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "as_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "._", "write_", "(_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chmod_", "(_", "rule", "s", "\\u", "fname_", ",_", "0o7", "55_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "D", ".", " ", "debi", "an", "/", "compat_", "\\u\\u\\uNL\\u\\u\\u_", "fd_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "compa", "t", "'_", ")_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "write_", "(_", "'", "7", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "E", ".", " ", "debi", "an", "/", "package", ".", "mime_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "debi", "nfo_", "._", "mime", "\\u", "file_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "debi", "nfo_", "._", "mime", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", " ", "MIME", " ", "file", " ", "was", " ", "specified", ",", " ", "but", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "nfo_", "._", "mime", "\\u", "file_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "\\u", "func_", "(_", "debi", "nfo_", "._", "mime", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "debi", "nfo_", "._", "package_", "+_", "'.", "mime", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debi", "nfo_", "._", "shared", "\\u", "mime", "\\u", "file_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "debi", "nfo_", "._", "shared", "\\u", "mime", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", " ", "shared", " ", "MIME", " ", "file", " ", "was", " ", "specified", ",", " ", "but", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "nfo_", "._", "shared", "\\u", "mime", "\\u", "file_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "\\u", "func_", "(_", "debi", "nfo_", "._", "shared", "\\u", "mime", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "nfo_", "._", "package_", "+_", "'.", "shared", "mime", "info", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "F", ".", " ", "debi", "an", "/", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debi", "nfo_", "._", "copyr", "ight", "\\u", "file_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link", "\\u", "func_", "(_", "debi", "nfo_", "._", "copyr", "ight", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "copyr", "ight", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "H", ".", " ", "debi", "an", "/", "<", "package", ">.", "install_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "debi", "nfo_", "._", "install", "\\u", "file", "\\u", "lines_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'%", "s", ".", "install", "'_", "%_", "debi", "nfo_", "._", "package_", ")_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "write_", "(_", "'\\\\", "n", "'_", "._", "join_", "(_", "debi", "nfo_", "._", "install", "\\u", "file", "\\u", "lines_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "I", ".", " ", "debi", "an", "/", "<", "package", ">.", "udev", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "debi", "nfo_", "._", "udev", "\\u", "rules_", "!=_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fname_", "=_", "debi", "nfo_", "._", "udev", "\\u", "rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "'", "udev", " ", "rule", "s", " ", "file", " ", "specified", ",", " ", "but", " ", "doe", "s", " ", "not", " ", "exist", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "link", "\\u", "func_", "(_", "fname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'%", "s", ".", "udev", "'_", "%_", "debi", "nfo_", "._", "package_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "J", ".", " ", "debi", "an", "/", "source", "/", "format_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "mkdir_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "source", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "source", "'_", ",_", "'", "format", "'_", ")_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "write_", "(_", "'", "3.0", " ", "(", "qui", "lt", ")\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fd_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "debi", "an", "\\u", "dir_", ",_", "'", "source", "'_", ",_", "'", "options", "'_", ")_", ",_", "mode_", "=_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "write_", "(_", "'", "extend", "-", "diff", "-", "ignore", "=\"\\\\", ".", "egg", "-", "info", "$", "\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "debi", "an", "\\u", "dir\\u", "only_", ":_", "\\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\\uNL\\u\\u\\u_", "#", " ", "3", ".", " ", "unpack", " ", "original", " ", "source", " ", "tarball", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debi", "ani", "zed", "\\u", "package", "\\u", "dirname_", "=_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", "+_", "'.", "debi", "ani", "zed", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "debi", "ani", "zed", "\\u", "package", "\\u", "dirname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "'", "debi", "ani", "zed", "\\u", "package", "\\u", "dir", "name", " ", "exist", "s", ":", " ", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "debi", "ani", "zed", "\\u", "package", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "A", ".", " ", "move", " ", "debi", "ani", "zed", " ", "tree", " ", "away_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "rename_", "(_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ",_", "debi", "ani", "zed", "\\u", "package", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "orig", "\\u", "sdist", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "B", ".", " ", "expand", " ", "repa", "ckage", "d", " ", "original", " ", "tarball", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tmp", "\\u", "dir_", "=_", "os_", "._", "path_", "._", "join_", "(_", "dist", "\\u", "dir_", ",_", "'", "tmp", "-", "expand", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "mkdir_", "(_", "tmp", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expand", "\\u", "tarball", "_", "(_", "orig", "\\u", "sdist", "_", ",_", "cwd_", "=_", "tmp", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig", "\\u", "tarball", "\\u", "top", "\\u", "contents_", "=_", "os_", "._", "listdir_", "(_", "tmp", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "original", " ", "tarball", " ", "has", " ", "exact", "ly", " ", "one", " ", "directory_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "orig", "\\u", "tarball", "\\u", "top", "\\u", "contents_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "orig", "\\u", "dirname_", "=_", "orig", "\\u", "tarball", "\\u", "top", "\\u", "contents_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "full", "path", "\\u", "orig", "\\u", "dirname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tmp", "\\u", "dir_", ",_", "orig", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "C", ".", " ", "remove", " ", "original", " ", "repa", "ckage", "d", " ", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "full", "path", "\\u", "orig", "\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shutil_", "._", "rmtree_", "(_", "tmp", "\\u", "dir_", ")_", "\\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_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "version", "s", " ", "of", " ", "deb", "help", "er", " ", "and", " ", "python", "-", "all_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deb", "help", "er", "\\u", "version", "\\u", "str_", "=_", "get", "\\u", "version", "\\u", "str_", "(_", "'", "deb", "help", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "deb", "help", "er", "\\u", "version", "\\u", "str_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "'", "Thi", "s", " ", "version", " ", "of", " ", "std", "eb", " ", "require", "s", " ", "deb", "help", "er", " ", ">=", " ", "%", "s", ",", " ", "but", " ", "you", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "do", " ", "not", " ", "have", " ", "deb", "help", "er", " ", "install", "ed", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cou", "ld", " ", "not", " ", "check", " ", "compatibility", ".'_", "%_", "DH", "\\u", "MIN", "\\u", "VER", "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 ", " _", "if_", "not_", "dpkg", "\\u", "compare", "\\u", "versions_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "deb", "help", "er", "\\u", "version", "\\u", "str_", ",_", "'", "ge", "'_", ",_", "DH", "\\u", "MIN", "\\u", "VER", "S_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "'", "Thi", "s", " ", "version", " ", "of", " ", "std", "eb", " ", "require", "s", " ", "deb", "help", "er", " ", ">=", " ", "%", "s", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Us", "e", " ", "std", "eb", " ", "0.", "3", ".", "x", " ", "to", " ", "generat", "e", " ", "source", " ", "package", "s", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "compatible", " ", "with", " ", "older", " ", "version", "s", " ", "of", " ", "deb", "help", "er", ".'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "DH", "\\u", "MIN", "\\u", "VER", "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_", "python", "\\u", "default", "s", "\\u", "version", "\\u", "str_", "=_", "get", "\\u", "version", "\\u", "str_", "(_", "'", "python", "-", "all", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "python", "\\u", "default", "s", "\\u", "version", "\\u", "str_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "'", "Thi", "s", " ", "version", " ", "of", " ", "std", "eb", " ", "require", "s", " ", "python", "-", "all", " ", ">=", " ", "%", "s", ",", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "but", " ", "you", " ", "do", " ", "not", " ", "have", " ", "this", " ", "package", " ", "install", "ed", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cou", "ld", " ", "not", " ", "check", " ", "compatibility", ".'_", "%_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "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 ", " _", "if_", "not_", "dpkg", "\\u", "compare", "\\u", "versions_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "python", "\\u", "default", "s", "\\u", "version", "\\u", "str_", ",_", "'", "ge", "'_", ",_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "S_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "warn_", "(_", "'", "Thi", "s", " ", "version", " ", "of", " ", "std", "eb", " ", "require", "s", " ", "python", "-", "all", " ", ">=", " ", "%", "s", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Us", "e", " ", "std", "eb", " ", "0.", "6.0", " ", "or", " ", "older", " ", "to", " ", "generat", "e", " ", "source", " ", "package", "s", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tha", "t", " ", "use", " ", "python", "-", "support", ".'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "PYTHON", "\\u", "ALL", "\\u", "MIN", "\\u", "VER", "S_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "D", ".", " ", "restore", " ", "debi", "ani", "zed", " ", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "rename_", "(_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", "+_", "'.", "debi", "ani", "zed", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Re", "-", "generat", "e", " ", "tarball", " ", "usi", "ng", " ", "best", " ", "practic", "es", " ", "see", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "http", "://", "www", ".", "debi", "an", ".", "org", "/", "doc", "/", "developer", "s", "-", "reference", "/", "ch", "-", "best", "-", "pkg", "ing", "-", "practic", "es", ".", "en", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sign", "\\u", "dsc", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "(_", "'-", "uc", "'_", ",_", "'-", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dpkg", "\\u", "build", "package_", "(_", "'-", "S", "'_", ",_", "'-", "sa", "'_", ",_", "*_", "args_", ",_", "cwd_", "=_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "shutil_", "._", "rmtree_", "(_", "full", "path", "\\u", "repa", "ckage", "d\\u", "dirname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "remove", "\\u", "expand", "ed", "\\u", "source", "\\u", "dir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "expand", " ", "the", " ", "debi", "an", " ", "source", " ", "package_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dsc", "\\u", "name_", "=_", "debi", "nfo_", "._", "source_", "+_", "'\\u'_", "+_", "debi", "nfo_", "._", "dsc", "\\u", "version_", "+_", "'.", "dsc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dpkg", "\\u", "source_", "(_", "'-", "x", "'_", ",_", "dsc", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cwd_", "=_", "dist", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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numbers = 1", "metadata": "root.cfg", "header": "['module', '___EOS___']", "index": 58 } ]
[ { "span": "reverse ", "start_line": 60, "start_column": 4, "end_line": 60, "end_column": 11 }, { "span": "numbers ", "start_line": 61, "start_column": 4, "end_line": 61, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "ex_", "._", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cfg_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reverse_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numbers_", "=_", "1_", "\\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, 0, 2, 2, 2, 0, 2, 2, 2 ]
Unused import
stephenmcd/django-forms-builder/forms_builder/forms/south_migrations/0006_auto__del_unique_field_slug_form.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'forms.field': {\n 'Meta': {'ordering': \"('order',)\", 'object_name': 'Field'},\n 'choices': ('django.db.models.fields.CharField', [], {'max_length': '1000', 'blank': 'True'}),\n 'default': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'blank': 'True'}),\n 'field_type': ('django.db.models.fields.IntegerField', [], {}),\n 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'fields'\", 'to': u\"orm['forms.Form']\"}),\n 'help_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}),\n 'order': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'placeholder_text': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'default': \"''\", 'max_length': '100', 'blank': 'True'}),\n 'visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'})\n },\n u'forms.fieldentry': {\n 'Meta': {'object_name': 'FieldEntry'},\n 'entry': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'fields'\", 'to': u\"orm['forms.FormEntry']\"}),\n 'field_id': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'value': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True'})\n },\n u'forms.form': {\n 'Meta': {'object_name': 'Form'},\n 'button_text': ('django.db.models.fields.CharField', [], {'default': \"u'Submit'\", 'max_length': '50'}),\n 'email_copies': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),\n 'email_from': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'email_message': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'email_subject': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),\n 'expiry_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'intro': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'publish_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),\n 'response': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'send_email': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'sites': ('django.db.models.fields.related.ManyToManyField', [], {'default': '[1]', 'to': u\"orm['sites.Site']\", 'symmetrical': 'False'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}),\n 'status': ('django.db.models.fields.IntegerField', [], {'default': '2'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n u'forms.formentry': {\n 'Meta': {'object_name': 'FormEntry'},\n 'entry_time': ('django.db.models.fields.DateTimeField', [], {}),\n 'form': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'entries'\", 'to': u\"orm['forms.Form']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n },\n u'sites.site': {\n 'Meta': {'ordering': \"(u'domain',)\", 'object_name': 'Site', 'db_table': \"u'django_site'\"},\n 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n }\n }\n\n complete_apps = ['forms']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Removing unique constraint on 'Field', fields ['slug', 'form']\n db.delete_unique(u'forms_field', ['slug', 'form_id'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Adding unique constraint on 'Field', fields ['slug', 'form']\n db.create_unique(u'forms_field', ['slug', 'form_id'])", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 14 } ]
[ { "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", "'", "forms", ".", "field", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "order", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Field", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "choice", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2000", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "field", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "fields", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "forms", ".", "Form", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "help", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "order", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "placehold", "er", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "require", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "visi", "ble", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "forms", ".", "field", "entry", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Field", "Entr", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entry", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "fields", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "forms", ".", "Form", "Entr", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "field", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "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_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2000", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "forms", ".", "form", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Form", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "button", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"", "u", "'", "Submit", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "copie", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "from", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "message", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "\\u", "subject", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "expir", "y", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "intro", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "login", "\\u", "require", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "publi", "sh", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "send", "\\u", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sites", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'[", "1", "]'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "sites", ".", "Site", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "2", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "forms", ".", "form", "entry", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Form", "Entr", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "entry", "\\u", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "form", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "entri", "es", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "forms", ".", "Form", "']\"_", "}_", ")_", ",_", "\\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", "'", "sites", ".", "site", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "u", "'", "domain", "',)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Site", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"", "u", "'", "django", "\\u", "site", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "domain", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "forms", "'_", "]_", "[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_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Field", "',", " ", "fields", " ", "['", "slug", "',", " ", "'", "form", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "unique_", "(_", "u", "'", "forms", "\\u", "field", "'_", ",_", "[_", "'", "slug", "'_", ",_", "'", "form", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Field", "',", " ", "fields", " ", "['", "slug", "',", " ", "'", "form", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "unique_", "(_", "u", "'", "forms", "\\u", "field", "'_", ",_", "[_", "'", "slug", "'_", ",_", "'", "form", "\\u", "id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2,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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Conflicting attributes in base classes
kayhayen/Nuitka/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Action.py
[ { "content": "class ActionBase(object):\n \"\"\"Base class for all types of action objects that can be held by\n other objects (Builders, Executors, etc.) This provides the\n common methods for manipulating and combining those actions.\"\"\"\n\n\n\n batch_key = no_batch_key\n\n\n\n\n\n\n", "metadata": "root.ActionBase", "header": "['module', '___EOS___']", "index": 418 }, { "content": " def __cmp__(self, other):\n return cmp(self.__dict__, other)", "metadata": "root.ActionBase.__cmp__", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 423 }, { "content": " def no_batch_key(self, env, target, source):\n return None", "metadata": "root.ActionBase.no_batch_key", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 426 }, { "content": " def genstring(self, target, source, env):\n return str(self)", "metadata": "root.ActionBase.genstring", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 431 }, { "content": " def get_contents(self, target, source, env):\n result = [ self.get_presig(target, source, env) ]\n # This should never happen, as the Action() factory should wrap\n # the varlist, but just in case an action is created directly,\n # we duplicate this check here.\n vl = self.get_varlist(target, source, env)\n if is_String(vl): vl = (vl,)\n for v in vl:\n # do the subst this way to ignore $(...$) parts:\n result.append(env.subst_target_source('${'+v+'}', SCons.Subst.SUBST_SIG, target, source))\n return ''.join(result)", "metadata": "root.ActionBase.get_contents", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 434 }, { "content": " def __add__(self, other):\n return _actionAppend(self, other)", "metadata": "root.ActionBase.__add__", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 446 }, { "content": " def __radd__(self, other):\n return _actionAppend(other, self)", "metadata": "root.ActionBase.__radd__", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 449 }, { "content": " def presub_lines(self, env):\n # CommandGeneratorAction needs a real environment\n # in order to return the proper string here, since\n # it may call LazyAction, which looks up a key\n # in that env. So we temporarily remember the env here,\n # and CommandGeneratorAction will use this env\n # when it calls its _generate method.\n self.presub_env = env\n lines = str(self).split('\\n')\n self.presub_env = None # don't need this any more\n return lines", "metadata": "root.ActionBase.presub_lines", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 452 }, { "content": " def get_varlist(self, target, source, env, executor=None):\n return self.varlist", "metadata": "root.ActionBase.get_varlist", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 464 }, { "content": " def get_targets(self, env, executor):\n \"\"\"\n Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used\n by this action.\n \"\"\"\n return self.targets", "metadata": "root.ActionBase.get_targets", "header": "['class', 'ActionBase', '(', 'object', ')', ':', '___EOS___']", "index": 467 }, { "content": "class _ActionAction(ActionBase):\n \"\"\"Base class for actions that create output objects.\"\"\"\n\n", "metadata": "root._ActionAction", "header": "['module', '___EOS___']", "index": 474 }, { "content": " def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),\n presub=_null, chdir=None, exitstatfunc=None,\n batch_key=None, targets='$TARGETS',\n **kw):\n self.cmdstr = cmdstr\n if strfunction is not _null:\n if strfunction is None:\n self.cmdstr = None\n else:\n self.strfunction = strfunction\n self.varlist = varlist\n self.presub = presub\n self.chdir = chdir\n if not exitstatfunc:\n exitstatfunc = default_exitstatfunc\n self.exitstatfunc = exitstatfunc\n\n self.targets = targets\n\n if batch_key:\n if not callable(batch_key):\n # They have set batch_key, but not to their own\n # callable. The default behavior here will batch\n # *all* targets+sources using this action, separated\n # for each construction environment.\n def default_batch_key(self, env, target, source):\n return (id(self), id(env))\n batch_key = default_batch_key\n SCons.Util.AddMethod(self, batch_key, 'batch_key')", "metadata": "root._ActionAction.__init__", "header": "['class', '_ActionAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 476 }, { "content": " def print_cmd_line(self, s, target, source, env):\n # In python 3, and in some of our tests, sys.stdout is\n # a String io object, and it takes unicode strings only\n # In other cases it's a regular Python 2.x file object\n # which takes strings (bytes), and if you pass those a\n # unicode object they try to decode with 'ascii' codec\n # which fails if the cmd line has any hi-bit-set chars.\n # This code assumes s is a regular string, but should\n # work if it's unicode too.\n try:\n sys.stdout.write(unicode(s + \"\\n\"))\n except UnicodeDecodeError:\n sys.stdout.write(s + \"\\n\")", "metadata": "root._ActionAction.print_cmd_line", "header": "['class', '_ActionAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 506 }, { "content": " def __call__(self, target, source, env,\n exitstatfunc=_null,\n presub=_null,\n show=_null,\n execute=_null,\n chdir=_null,\n executor=None):\n if not is_List(target):\n target = [target]\n if not is_List(source):\n source = [source]\n\n if presub is _null:\n presub = self.presub\n if presub is _null:\n presub = print_actions_presub\n if exitstatfunc is _null: exitstatfunc = self.exitstatfunc\n if show is _null: show = print_actions\n if execute is _null: execute = execute_actions\n if chdir is _null: chdir = self.chdir\n save_cwd = None\n if chdir:\n save_cwd = os.getcwd()\n try:\n chdir = str(chdir.abspath)\n except AttributeError:\n if not is_String(chdir):\n if executor:\n chdir = str(executor.batches[0].targets[0].dir)\n else:\n chdir = str(target[0].dir)\n if presub:\n if executor:\n target = executor.get_all_targets()\n source = executor.get_all_sources()\n t = ' and '.join(map(str, target))\n l = '\\n '.join(self.presub_lines(env))\n out = u\"Building %s with action:\\n %s\\n\" % (t, l)\n sys.stdout.write(out)\n cmd = None\n if show and self.strfunction:\n if executor:\n target = executor.get_all_targets()\n source = executor.get_all_sources()\n try:\n cmd = self.strfunction(target, source, env, executor)\n except TypeError:\n cmd = self.strfunction(target, source, env)\n if cmd:\n if chdir:\n cmd = ('os.chdir(%s)\\n' % repr(chdir)) + cmd\n try:\n get = env.get\n except AttributeError:\n print_func = self.print_cmd_line\n else:\n print_func = get('PRINT_CMD_LINE_FUNC')\n if not print_func:\n print_func = self.print_cmd_line\n print_func(cmd, target, source, env)\n stat = 0\n if execute:\n if chdir:\n os.chdir(chdir)\n try:\n stat = self.execute(target, source, env, executor=executor)\n if isinstance(stat, SCons.Errors.BuildError):\n s = exitstatfunc(stat.status)\n if s:\n stat.status = s\n else:\n stat = s\n else:\n stat = exitstatfunc(stat)\n finally:\n if save_cwd:\n os.chdir(save_cwd)\n if cmd and save_cwd:\n print_func('os.chdir(%s)' % repr(save_cwd), target, source, env)\n\n return stat", "metadata": "root._ActionAction.__call__", "header": "['class', '_ActionAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 520 }, { "content": "class CommandAction(_ActionAction):\n \"\"\"Class for command-execution actions.\"\"\"\n\n\n\n\n\n", "metadata": "root.CommandAction", "header": "['module', '___EOS___']", "index": 691 }, { "content": " def __init__(self, cmd, **kw):\n # Cmd can actually be a list or a single item; if it's a\n # single item it should be the command string to execute; if a\n # list then it should be the words of the command string to\n # execute. Only a single command should be executed by this\n # object; lists of commands should be handled by embedding\n # these objects in a ListAction object (which the Action()\n # factory above does). cmd will be passed to\n # Environment.subst_list() for substituting environment\n # variables.\n if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandAction')\n\n _ActionAction.__init__(self, **kw)\n if is_List(cmd):\n if list(filter(is_List, cmd)):\n raise TypeError(\"CommandAction should be given only \" \\\n \"a single command\")\n self.cmd_list = cmd", "metadata": "root.CommandAction.__init__", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 693 }, { "content": " def __str__(self):\n if is_List(self.cmd_list):\n return ' '.join(map(str, self.cmd_list))\n return str(self.cmd_list)", "metadata": "root.CommandAction.__str__", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 712 }, { "content": " def process(self, target, source, env, executor=None):\n if executor:\n result = env.subst_list(self.cmd_list, 0, executor=executor)\n else:\n result = env.subst_list(self.cmd_list, 0, target, source)\n silent = None\n ignore = None\n while True:\n try: c = result[0][0][0]\n except IndexError: c = None\n if c == '@': silent = 1\n elif c == '-': ignore = 1\n else: break\n result[0][0] = result[0][0][1:]\n try:\n if not result[0][0]:\n result[0] = result[0][1:]\n except IndexError:\n pass\n return result, ignore, silent", "metadata": "root.CommandAction.process", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 717 }, { "content": " def strfunction(self, target, source, env, executor=None):\n if self.cmdstr is None:\n return None\n if self.cmdstr is not _null:\n from SCons.Subst import SUBST_RAW\n if executor:\n c = env.subst(self.cmdstr, SUBST_RAW, executor=executor)\n else:\n c = env.subst(self.cmdstr, SUBST_RAW, target, source)\n if c:\n return c\n cmd_list, ignore, silent = self.process(target, source, env, executor)\n if silent:\n return ''\n return _string_from_cmd_list(cmd_list[0])", "metadata": "root.CommandAction.strfunction", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 738 }, { "content": " def execute(self, target, source, env, executor=None):\n \"\"\"Execute a command action.\n\n This will handle lists of commands as well as individual commands,\n because construction variable substitution may turn a single\n \"command\" into a list. This means that this class can actually\n handle lists of commands, even though that's not how we use it\n externally.\n \"\"\"\n escape_list = SCons.Subst.escape_list\n flatten_sequence = SCons.Util.flatten_sequence\n\n try:\n shell = env['SHELL']\n except KeyError:\n raise SCons.Errors.UserError('Missing SHELL construction variable.')\n\n try:\n spawn = env['SPAWN']\n except KeyError:\n raise SCons.Errors.UserError('Missing SPAWN construction variable.')\n else:\n if is_String(spawn):\n spawn = env.subst(spawn, raw=1, conv=lambda x: x)\n\n escape = env.get('ESCAPE', lambda x: x)\n\n ENV = get_default_ENV(env)\n\n # Ensure that the ENV values are all strings:\n for key, value in ENV.items():\n if not is_String(value):\n if is_List(value):\n # If the value is a list, then we assume it is a\n # path list, because that's a pretty common list-like\n # value to stick in an environment variable:\n value = flatten_sequence(value)\n ENV[key] = os.pathsep.join(map(str, value))\n else:\n # If it isn't a string or a list, then we just coerce\n # it to a string, which is the proper way to handle\n # Dir and File instances and will produce something\n # reasonable for just about everything else:\n ENV[key] = str(value)\n\n if executor:\n target = executor.get_all_targets()\n source = executor.get_all_sources()\n cmd_list, ignore, silent = self.process(target, list(map(rfile, source)), env, executor)\n\n # Use len() to filter out any \"command\" that's zero-length.\n for cmd_line in filter(len, cmd_list):\n # Escape the command line for the interpreter we are using.\n cmd_line = escape_list(cmd_line, escape)\n result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)\n if not ignore and result:\n msg = \"Error %s\" % result\n return SCons.Errors.BuildError(errstr=msg,\n status=result,\n action=self,\n command=cmd_line)\n return 0", "metadata": "root.CommandAction.execute", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 754 }, { "content": " def get_presig(self, target, source, env, executor=None):\n \"\"\"Return the signature contents of this action's command line.\n\n This strips $(-$) and everything in between the string,\n since those parts don't affect signatures.\n \"\"\"\n from SCons.Subst import SUBST_SIG\n cmd = self.cmd_list\n if is_List(cmd):\n cmd = ' '.join(map(str, cmd))\n else:\n cmd = str(cmd)\n if executor:\n return env.subst_target_source(cmd, SUBST_SIG, executor=executor)\n else:\n return env.subst_target_source(cmd, SUBST_SIG, target, source)", "metadata": "root.CommandAction.get_presig", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 817 }, { "content": " def get_implicit_deps(self, target, source, env, executor=None):\n icd = env.get('IMPLICIT_COMMAND_DEPENDENCIES', True)\n if is_String(icd) and icd[:1] == '$':\n icd = env.subst(icd)\n if not icd or icd in ('0', 'None'):\n return []\n from SCons.Subst import SUBST_SIG\n if executor:\n cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, executor=executor)\n else:\n cmd_list = env.subst_list(self.cmd_list, SUBST_SIG, target, source)\n res = []\n for cmd_line in cmd_list:\n if cmd_line:\n d = str(cmd_line[0])\n m = strip_quotes.match(d)\n if m:\n d = m.group(1)\n d = env.WhereIs(d)\n if d:\n res.append(env.fs.File(d))\n return res", "metadata": "root.CommandAction.get_implicit_deps", "header": "['class', 'CommandAction', '(', '_ActionAction', ')', ':', '___EOS___']", "index": 834 }, { "content": "class CommandGeneratorAction(ActionBase):\n \"\"\"Class for command-generator actions.\"\"\"\n\n\n\n\n\n\n\n\n", "metadata": "root.CommandGeneratorAction", "header": "['module', '___EOS___']", "index": 857 }, { "content": " def __init__(self, generator, kw):\n if SCons.Debug.track_instances: logInstanceCreation(self, 'Action.CommandGeneratorAction')\n self.generator = generator\n self.gen_kw = kw\n self.varlist = kw.get('varlist', ())\n self.targets = kw.get('targets', '$TARGETS')", "metadata": "root.CommandGeneratorAction.__init__", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 859 }, { "content": " def _generate(self, target, source, env, for_signature, executor=None):\n # ensure that target is a list, to make it easier to write\n # generator functions:\n if not is_List(target):\n target = [target]\n\n if executor:\n target = executor.get_all_targets()\n source = executor.get_all_sources()\n ret = self.generator(target=target,\n source=source,\n env=env,\n for_signature=for_signature)\n gen_cmd = Action(ret, **self.gen_kw)\n if not gen_cmd:\n raise SCons.Errors.UserError(\"Object returned from command generator: %s cannot be used to create an Action.\" % repr(ret))\n return gen_cmd", "metadata": "root.CommandGeneratorAction._generate", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 866 }, { "content": " def __str__(self):\n try:\n env = self.presub_env\n except AttributeError:\n env = None\n if env is None:\n env = SCons.Defaults.DefaultEnvironment()\n act = self._generate([], [], env, 1)\n return str(act)", "metadata": "root.CommandGeneratorAction.__str__", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 884 }, { "content": " def batch_key(self, env, target, source):\n return self._generate(target, source, env, 1).batch_key(env, target, source)", "metadata": "root.CommandGeneratorAction.batch_key", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 894 }, { "content": " def genstring(self, target, source, env, executor=None):\n return self._generate(target, source, env, 1, executor).genstring(target, source, env)", "metadata": "root.CommandGeneratorAction.genstring", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 897 }, { "content": " def __call__(self, target, source, env, exitstatfunc=_null, presub=_null,\n show=_null, execute=_null, chdir=_null, executor=None):\n act = self._generate(target, source, env, 0, executor)\n if act is None:\n raise SCons.Errors.UserError(\"While building `%s': \"\n \"Cannot deduce file extension from source files: %s\"\n % (repr(list(map(str, target))), repr(list(map(str, source)))))\n return act(target, source, env, exitstatfunc, presub,\n show, execute, chdir, executor)", "metadata": "root.CommandGeneratorAction.__call__", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 900 }, { "content": " def get_presig(self, target, source, env, executor=None):\n \"\"\"Return the signature contents of this action's command line.\n\n This strips $(-$) and everything in between the string,\n since those parts don't affect signatures.\n \"\"\"\n return self._generate(target, source, env, 1, executor).get_presig(target, source, env)", "metadata": "root.CommandGeneratorAction.get_presig", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 910 }, { "content": " def get_implicit_deps(self, target, source, env, executor=None):\n return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env)", "metadata": "root.CommandGeneratorAction.get_implicit_deps", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 918 }, { "content": " def get_varlist(self, target, source, env, executor=None):\n return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor)", "metadata": "root.CommandGeneratorAction.get_varlist", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 921 }, { "content": " def get_targets(self, env, executor):\n return self._generate(None, None, env, 1, executor).get_targets(env, executor)", "metadata": "root.CommandGeneratorAction.get_targets", "header": "['class', 'CommandGeneratorAction', '(', 'ActionBase', ')', ':', '___EOS___']", "index": 924 }, { "content": "class LazyAction(CommandGeneratorAction, CommandAction):\n\n\n\n\n\n\n", "metadata": "root.LazyAction", "header": "['module', '___EOS___']", "index": 946 } ]
[ { "span": "class LazyAction(CommandGeneratorAction, CommandAction):", "start_line": 946, "start_column": 0, "end_line": 946, "end_column": 56 } ]
[ { "span": "def get_implicit_deps(self, target, source, env, executor=None):", "start_line": 834, "start_column": 4, "end_line": 834, "end_column": 68 }, { "span": "def get_implicit_deps(self, target, source, env, executor=None):", "start_line": 918, "start_column": 4, "end_line": 918, "end_column": 68 } ]
1
false
[ "[CLS]_", "Confl", "ict", "ing_", "attributes_", "in_", "base_", "classes_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "all", " ", "types", " ", "of", " ", "action", " ", "object", "s", " ", "tha", "t", " ", "can", " ", "be", " ", "hel", "d", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "other", " ", "object", "s", " ", "(", "Build", "ers", ",", " ", "Execut", "ors", ",", " ", "etc", ".)", " ", " ", "Thi", "s", " ", "provide", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "common", " ", "method", "s", " ", "for", " ", "manipulati", "ng", " ", "and", " ", "combin", "ing", " ", "tho", "se", " ", "action", "s", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "batch", "\\u", "key_", "=_", "no", "\\u", "batch", "\\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_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "cmp", "\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmp_", "(_", "self_", "._", "\\u\\u", "dict\\u\\u_", ",_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "no", "\\u", "batch", "\\u", "key_", "(_", "self_", ",_", "env_", ",_", "target_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "gens", "tring_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "str_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "contents_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "[_", "self_", "._", "get", "\\u", "presi", "g_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "shou", "ld", " ", "neve", "r", " ", "happ", "en", ",", " ", "as", " ", "the", " ", "Action", "()", " ", "factor", "y", " ", "shou", "ld", " ", "wrap_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "varli", "st", ",", " ", "but", " ", "just", " ", "in", " ", "case", " ", "an", " ", "action", " ", "is", " ", "created", " ", "direct", "ly", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "duplicat", "e", " ", "this", " ", "check", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "vl_", "=_", "self_", "._", "get", "\\u", "varli", "st_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "String_", "(_", "vl_", ")_", ":_", "vl_", "=_", "(_", "vl_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "vl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "the", " ", "subst", " ", "this", " ", "way", " ", "to", " ", "ignore", " ", "$(", "...", "$)", " ", "part", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "._", "append_", "(_", "env_", "._", "subst", "\\u", "target", "\\u", "source_", "(_", "'$", "{'_", "+_", "v_", "+_", "'}'_", ",_", "SC", "ons_", "._", "Subst", "_", "._", "SUBST", "\\u", "SIG", "_", ",_", "target_", ",_", "source_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "''_", "._", "join_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "add\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "action", "Append_", "(_", "self_", ",_", "other_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "rad", "d\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "action", "Append_", "(_", "other_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "presu", "b", "\\u", "lines_", "(_", "self_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Command", "Generat", "or", "Action", " ", "need", "s", " ", "a", " ", "real", " ", "environment_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "order", " ", "to", " ", "return", " ", "the", " ", "proper", " ", "string", " ", "here", ",", " ", "since_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "may", " ", "call", " ", "La", "zy", "Action", ",", " ", "whi", "ch", " ", "look", "s", " ", "up", " ", "a", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "tha", "t", " ", "env", ".", " ", " ", "So", " ", "we", " ", "temporar", "il", "y", " ", "remember", " ", "the", " ", "env", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "Command", "Generat", "or", "Action", " ", "will", " ", "use", " ", "this", " ", "env_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "it", " ", "calls", " ", "its", " ", "\\u", "generat", "e", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "presu", "b", "\\u", "env_", "=_", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "str_", "(_", "self_", ")_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "presu", "b", "\\u", "env_", "=_", "None_", "#", " ", "don", "'", "t", " ", "need", " ", "this", " ", "any", " ", "more_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "lines_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "varli", "st_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "varli", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Action", "Base_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "targets_", "(_", "self_", ",_", "env_", ",_", "executor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "type", " ", "of", " ", "target", "s", " ", "($", "TARGET", "S", ",", " ", "$", "CHANGED", "\\u", "TARGET", "S", ")", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "this", " ", "action", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "targets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "\\u", "Action", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Base", " ", "class", " ", "for", " ", "action", "s", " ", "tha", "t", " ", "create", " ", "output", " ", "object", "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_", "[SEP]_", "class_", "\\u", "Action", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cmds", "tr_", "=_", "\\u", "null_", ",_", "strf", "unction_", "=_", "\\u", "null_", ",_", "varli", "st_", "=_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "presu", "b_", "=_", "\\u", "null_", ",_", "chdir_", "=_", "None_", ",_", "exits", "tat", "func_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "key_", "=_", "None_", ",_", "targets_", "=_", "'$", "TARGET", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cmds", "tr_", "=_", "cmds", "tr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "strf", "unction_", "is_", "not_", "\\u", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "strf", "unction_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cmds", "tr_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "strf", "unction_", "=_", "strf", "unction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "varli", "st_", "=_", "varli", "st_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "presu", "b_", "=_", "presu", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "chdir_", "=_", "chdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "exits", "tat", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exits", "tat", "func_", "=_", "default", "\\u", "exits", "tat", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "exits", "tat", "func_", "=_", "exits", "tat", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "targets_", "=_", "targets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "batch", "\\u", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "callable_", "(_", "batch", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", "y", " ", "have", " ", "set", " ", "batch", "\\u", "key", ",", " ", "but", " ", "not", " ", "to", " ", "thei", "r", " ", "own_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "calla", "ble", ".", " ", " ", "The", " ", "default", " ", "behavior", " ", "here", " ", "will", " ", "batch_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", "all", "*", " ", "target", "s", "+", "source", "s", " ", "usi", "ng", " ", "this", " ", "action", ",", " ", "separate", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "each", " ", "constructi", "on", " ", "environ", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "default", "\\u", "batch", "\\u", "key_", "(_", "self_", ",_", "env_", ",_", "target_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "(_", "id_", "(_", "self_", ")_", ",_", "id_", "(_", "env_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "batch", "\\u", "key_", "=_", "default", "\\u", "batch", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "SC", "ons_", "._", "Util_", "._", "Add", "Method_", "(_", "self_", ",_", "batch", "\\u", "key_", ",_", "'", "batch", "\\u", "key", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Action", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "cmd", "\\u", "line_", "(_", "self_", ",_", "s_", ",_", "target_", ",_", "source_", ",_", "env_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "In", " ", "python", " ", "3", ",", " ", "and", " ", "in", " ", "some", " ", "of", " ", "our", " ", "tests", ",", " ", "sys", ".", "stdout", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "String", " ", "io", " ", "object", ",", " ", "and", " ", "it", " ", "take", "s", " ", "unicode", " ", "string", "s", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "other", " ", "case", "s", " ", "it", "'", "s", " ", "a", " ", "regular", " ", "Pyth", "on", " ", "2", ".", "x", " ", "file", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "take", "s", " ", "string", "s", " ", "(", "bytes", "),", " ", "and", " ", "if", " ", "you", " ", "pass", " ", "tho", "se", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unicode", " ", "object", " ", "the", "y", " ", "try", " ", "to", " ", "decode", " ", "with", " ", "'", "ascii", "'", " ", "codec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "fail", "s", " ", "if", " ", "the", " ", "cmd", " ", "line", " ", "has", " ", "any", " ", "hi", "-", "bit", "-", "set", " ", "char", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "code", " ", "assume", "s", " ", "s", " ", "is", " ", "a", " ", "regular", " ", "string", ",", " ", "but", " ", "should_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "work", " ", "if", " ", "it", "'", "s", " ", "unicode", " ", "too", "._", "\\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 ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "unicode_", "(_", "s_", "+_", "\"\\\\", "n", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unic", "ode", "Decode", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys_", "._", "stdout_", "._", "write_", "(_", "s_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Action", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exits", "tat", "func_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "presu", "b_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "show_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "execute_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "chdir_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "is", "\\u", "List_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "[_", "target_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "is", "\\u", "List_", "(_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source_", "=_", "[_", "source_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "presu", "b_", "is_", "\\u", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "presu", "b_", "=_", "self_", "._", "presu", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "presu", "b_", "is_", "\\u", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "presu", "b_", "=_", "print", "\\u", "action", "s", "\\u", "presu", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "exits", "tat", "func_", "is_", "\\u", "null_", ":_", "exits", "tat", "func_", "=_", "self_", "._", "exits", "tat", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show_", "is_", "\\u", "null_", ":_", "show_", "=_", "print", "\\u", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "execute_", "is_", "\\u", "null_", ":_", "execute_", "=_", "execute", "\\u", "actions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "chdir_", "is_", "\\u", "null_", ":_", "chdir_", "=_", "self_", "._", "chdir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "\\u", "cwd_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "chdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "\\u", "cwd_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chdir_", "=_", "str_", "(_", "chdir_", "._", "abspath_", ")_", "\\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 ", " _", "if_", "not_", "is", "\\u", "String_", "(_", "chdir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "chdir_", "=_", "str_", "(_", "executor_", "._", "batches_", "[_", "0_", "]_", "._", "targets_", "[_", "0_", "]_", "._", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "chdir_", "=_", "str_", "(_", "target_", "[_", "0_", "]_", "._", "dir_", ")_", "\\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_", "if_", "presu", "b_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "targets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "sources_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "t_", "=_", "'", " ", "and", " ", "'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "target_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l_", "=_", "'\\\\", "n", " ", " ", "'_", "._", "join_", "(_", "self_", "._", "presu", "b", "\\u", "lines_", "(_", "env_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "u", "\"", "Building", " ", "%", "s", " ", "with", " ", "action", ":\\\\", "n", " ", " ", "%", "s", "\\\\", "n", "\"_", "%_", "(_", "t_", ",_", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "show_", "and_", "self_", "._", "strf", "unction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "targets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "sources_", "(_", ")_", "\\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 ", " _", "cmd_", "=_", "self_", "._", "strf", "unction_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "self_", "._", "strf", "unction_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cmd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "chdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "cmd_", "=_", "(_", "'", "os", ".", "chd", "ir", "(%", "s", ")\\\\", "n", "'_", "%_", "repr_", "(_", "chdir_", ")_", ")_", "+_", "cmd_", "\\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 ", " ", "_", "get_", "=_", "env_", "._", "get_", "\\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 ", " ", "_", "print", "\\u", "func_", "=_", "self_", "._", "print", "\\u", "cmd", "\\u", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print", "\\u", "func_", "=_", "get_", "(_", "'", "PRINT", "\\u", "CMD", "\\u", "LINE", "\\u", "FUNC", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "print", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print", "\\u", "func_", "=_", "self_", "._", "print", "\\u", "cmd", "\\u", "line_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print", "\\u", "func_", "(_", "cmd_", ",_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "stat_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "execute_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "chdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "chdir_", "(_", "chdir_", ")_", "\\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 ", " _", "stat_", "=_", "self_", "._", "execute_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "stat_", ",_", "SC", "ons_", "._", "Errors_", "._", "Build", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "=_", "exits", "tat", "func_", "(_", "stat_", "._", "status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "stat_", "._", "status_", "=_", "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 ", " ", " _", "stat_", "=_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "stat_", "=_", "exits", "tat", "func_", "(_", "stat_", ")_", "\\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_", "save", "\\u", "cwd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "chdir_", "(_", "save", "\\u", "cwd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cmd_", "and_", "save", "\\u", "cwd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "func_", "(_", "'", "os", ".", "chd", "ir", "(%", "s", ")'_", "%_", "repr_", "(_", "save", "\\u", "cwd_", ")_", ",_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "stat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Class", " ", "for", " ", "command", "-", "executi", "on", " ", "action", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "cmd_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cmd", " ", "can", " ", "actual", "ly", " ", "be", " ", "a", " ", "list", " ", "or", " ", "a", " ", "single", " ", "item", ";", " ", "if", " ", "it", "'", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "single", " ", "item", " ", "it", " ", "shou", "ld", " ", "be", " ", "the", " ", "command", " ", "string", " ", "to", " ", "execute", ";", " ", "if", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "list", " ", "then", " ", "it", " ", "shou", "ld", " ", "be", " ", "the", " ", "words", " ", "of", " ", "the", " ", "command", " ", "string", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "execute", ".", " ", " ", "On", "ly", " ", "a", " ", "single", " ", "command", " ", "shou", "ld", " ", "be", " ", "executed", " ", "by", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "object", ";", " ", "lists", " ", "of", " ", "command", "s", " ", "shou", "ld", " ", "be", " ", "handle", "d", " ", "by", " ", "embedding_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "these", " ", "object", "s", " ", "in", " ", "a", " ", "List", "Action", " ", "object", " ", "(", "whi", "ch", " ", "the", " ", "Action", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "factor", "y", " ", "above", " ", "doe", "s", ").", " ", " ", "cmd", " ", "will", " ", "be", " ", "pass", "ed", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Environ", "ment", ".", "subst", "\\u", "list", "()", " ", "for", " ", "subst", "itut", "ing", " ", "environment_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "les", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "SC", "ons_", "._", "Debug_", "._", "track", "\\u", "instances_", ":_", "log", "Insta", "nce", "Creat", "ion_", "(_", "self_", ",_", "'", "Action", ".", "Command", "Action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Action", "Action_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "**_", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "List_", "(_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "list_", "(_", "filter_", "(_", "is", "\\u", "List_", ",_", "cmd_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "Command", "Action", " ", "shou", "ld", " ", "be", " ", "give", "n", " ", "only", " ", "\"_", "\"", "a", " ", "single", " ", "command", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "cmd", "\\u", "list_", "=_", "cmd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "List_", "(_", "self_", "._", "cmd", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", " ", "'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "self_", "._", "cmd", "\\u", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "str_", "(_", "self_", "._", "cmd", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "env_", "._", "subst", "\\u", "list_", "(_", "self_", "._", "cmd", "\\u", "list_", ",_", "0_", ",_", "executor_", "=_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "env_", "._", "subst", "\\u", "list_", "(_", "self_", "._", "cmd", "\\u", "list_", ",_", "0_", ",_", "target_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "silent_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ignore_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "c_", "=_", "result_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", "Index", "Error_", ":_", "c_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", "==_", "'@'_", ":_", "silent_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "c_", "==_", "'-'_", ":_", "ignore_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "[_", "0_", "]_", "[_", "0_", "]_", "=_", "result_", "[_", "0_", "]_", "[_", "0_", "]_", "[_", "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 ", " _", "if_", "not_", "result_", "[_", "0_", "]_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "0_", "]_", "=_", "result_", "[_", "0_", "]_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Index", "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_", "result_", ",_", "ignore_", ",_", "silent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "strf", "unction_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "cmds", "tr_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "cmds", "tr_", "is_", "not_", "\\u", "null_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "SC", "ons_", "._", "Subst", "_", "import_", "SUBST", "\\u", "RAW_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "env_", "._", "subst_", "(_", "self_", "._", "cmds", "tr_", ",_", "SUBST", "\\u", "RAW_", ",_", "executor_", "=_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "env_", "._", "subst_", "(_", "self_", "._", "cmds", "tr_", ",_", "SUBST", "\\u", "RAW_", ",_", "target_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "list_", ",_", "ignore_", ",_", "silent_", "=_", "self_", "._", "process_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "silent_", ":_", "\\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_", "\\u", "string", "\\u", "from", "\\u", "cmd", "\\u", "list_", "(_", "cmd", "\\u", "list_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Execut", "e", " ", "a", " ", "command", " ", "action", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "will", " ", "handle", " ", "lists", " ", "of", " ", "command", "s", " ", "as", " ", "well", " ", "as", " ", "individual", " ", "command", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "bec", "aus", "e", " ", "constructi", "on", " ", "variab", "le", " ", "substitution", " ", "may", " ", "turn", " ", "a", " ", "single", "\\", "10", ";", " ", " ", " ", " ", "\"", "command", "\"", " ", "int", "o", " ", "a", " ", "list", ".", " ", " ", "Thi", "s", " ", "means", " ", "tha", "t", " ", "this", " ", "class", " ", "can", " ", "actual", "ly", "\\", "10", ";", " ", " ", " ", " ", "handle", " ", "lists", " ", "of", " ", "command", "s", ",", " ", "even", " ", "tho", "ugh", " ", "tha", "t", "'", "s", " ", "not", " ", "how", " ", "we", " ", "use", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "external", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "escape", "\\u", "list_", "=_", "SC", "ons_", "._", "Subst", "_", "._", "escape", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flat", "ten", "\\u", "sequence_", "=_", "SC", "ons_", "._", "Util_", "._", "flat", "ten", "\\u", "sequence_", "\\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 ", " _", "shell_", "=_", "env_", "[_", "'", "SHELL", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "SC", "ons_", "._", "Errors_", "._", "User", "Error_", "(_", "'", "Missing", " ", "SHELL", " ", "constructi", "on", " ", "variab", "le", ".'_", ")_", "\\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 ", " _", "spawn_", "=_", "env_", "[_", "'", "SPA", "WN", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "SC", "ons_", "._", "Errors_", "._", "User", "Error_", "(_", "'", "Missing", " ", "SPA", "WN", " ", "constructi", "on", " ", "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 ", " _", "if_", "is", "\\u", "String_", "(_", "spawn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spawn_", "=_", "env_", "._", "subst_", "(_", "spawn_", ",_", "raw_", "=_", "1_", ",_", "conv_", "=_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "escape_", "=_", "env_", "._", "get_", "(_", "'", "ESCAPE", "'_", ",_", "lambda_", "x_", ":_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ENV_", "=_", "get", "\\u", "default", "\\u", "ENV_", "(_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "the", " ", "ENV", " ", "values", " ", "are", " ", "all", " ", "string", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "ENV_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "is", "\\u", "String_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "is", "\\u", "List_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "value", " ", "is", " ", "a", " ", "list", ",", " ", "then", " ", "we", " ", "assume", " ", "it", " ", "is", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "path", " ", "list", ",", " ", "bec", "aus", "e", " ", "tha", "t", "'", "s", " ", "a", " ", "pretty", " ", "common", " ", "list", "-", "like_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", " ", "to", " ", "stick", " ", "in", " ", "an", " ", "environ", "ment", " ", "variab", "le", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "value_", "=_", "flat", "ten", "\\u", "sequence_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ENV_", "[_", "key_", "]_", "=_", "os_", "._", "pathsep_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "value_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "it", " ", "isn", "'", "t", " ", "a", " ", "string", " ", "or", " ", "a", " ", "list", ",", " ", "then", " ", "we", " ", "just", " ", "coerce", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", " ", "to", " ", "a", " ", "string", ",", " ", "whi", "ch", " ", "is", " ", "the", " ", "proper", " ", "way", " ", "to", " ", "handle_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dir", " ", "and", " ", "File", " ", "instance", "s", " ", "and", " ", "will", " ", "produce", " ", "something_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reason", "able", " ", "for", " ", "just", " ", "abo", "ut", " ", "every", "thing", " ", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "ENV_", "[_", "key_", "]_", "=_", "str_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "targets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "sources_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "\\u", "list_", ",_", "ignore_", ",_", "silent_", "=_", "self_", "._", "process_", "(_", "target_", ",_", "list_", "(_", "map_", "(_", "rfile_", ",_", "source_", ")_", ")_", ",_", "env_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "len", "()", " ", "to", " ", "filter", " ", "out", " ", "any", " ", "\"", "command", "\"", " ", "tha", "t", "'", "s", " ", "zero", "-", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "cmd", "\\u", "line_", "in_", "filter_", "(_", "len_", ",_", "cmd", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Esc", "ape", " ", "the", " ", "command", " ", "line", " ", "for", " ", "the", " ", "interprete", "r", " ", "we", " ", "are", " ", "usi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "line_", "=_", "escape", "\\u", "list_", "(_", "cmd", "\\u", "line_", ",_", "escape_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "spawn_", "(_", "shell_", ",_", "escape_", ",_", "cmd", "\\u", "line_", "[_", "0_", "]_", ",_", "cmd", "\\u", "line_", ",_", "ENV_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ignore_", "and_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Error", " ", "%", "s", "\"_", "%_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "SC", "ons_", "._", "Errors_", "._", "Build", "Error_", "(_", "errst", "r_", "=_", "msg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "=_", "result_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "command_", "=_", "cmd", "\\u", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "presi", "g_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "signa", "ture", " ", "content", "s", " ", "of", " ", "this", " ", "action", "'", "s", " ", "command", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "strip", "s", " ", "$(", "-", "$)", " ", "and", " ", "every", "thing", " ", "in", " ", "bet", "ween", " ", "the", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "sinc", "e", " ", "tho", "se", " ", "part", "s", " ", "don", "'", "t", " ", "affect", " ", "signa", "tures", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "SC", "ons_", "._", "Subst", "_", "import_", "SUBST", "\\u", "SIG", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "self_", "._", "cmd", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "List_", "(_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "'", " ", "'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "str_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "env_", "._", "subst", "\\u", "target", "\\u", "source_", "(_", "cmd_", ",_", "SUBST", "\\u", "SIG", "_", ",_", "executor_", "=_", "executor_", ")_", "\\u\\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_", "env_", "._", "subst", "\\u", "target", "\\u", "source_", "(_", "cmd_", ",_", "SUBST", "\\u", "SIG", "_", ",_", "target_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Action_", "(_", "\\u", "Action", "Action_", ")_", ":_", "\\u\\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", "implicit", "\\u", "deps_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ic", "d_", "=_", "env_", "._", "get_", "(_", "'", "IMPL", "ICIT", "\\u", "COMMA", "ND", "\\u", "DEPENDEN", "CIE", "S", "'_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "String_", "(_", "ic", "d_", ")_", "and_", "ic", "d_", "[_", ":_", "1_", "]_", "==_", "'$'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ic", "d_", "=_", "env_", "._", "subst_", "(_", "ic", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "ic", "d_", "or_", "ic", "d_", "in_", "(_", "'", "0", "'_", ",_", "'", "Non", "e", "'_", ")_", ":_", "\\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_", "from_", "SC", "ons_", "._", "Subst", "_", "import_", "SUBST", "\\u", "SIG", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "list_", "=_", "env_", "._", "subst", "\\u", "list_", "(_", "self_", "._", "cmd", "\\u", "list_", ",_", "SUBST", "\\u", "SIG", "_", ",_", "executor_", "=_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "list_", "=_", "env_", "._", "subst", "\\u", "list_", "(_", "self_", "._", "cmd", "\\u", "list_", ",_", "SUBST", "\\u", "SIG", "_", ",_", "target_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cmd", "\\u", "line_", "in_", "cmd", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cmd", "\\u", "line_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "str_", "(_", "cmd", "\\u", "line_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "strip", "\\u", "quotes_", "._", "match_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "d_", "=_", "m_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d_", "=_", "env_", "._", "Whe", "re", "Is_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res_", "._", "append_", "(_", "env_", "._", "fs_", "._", "File_", "(_", "d_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Class", " ", "for", " ", "command", "-", "generat", "or", " ", "action", "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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "generator_", ",_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "SC", "ons_", "._", "Debug_", "._", "track", "\\u", "instances_", ":_", "log", "Insta", "nce", "Creat", "ion_", "(_", "self_", ",_", "'", "Action", ".", "Command", "Generat", "or", "Action", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "generator_", "=_", "generator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "gen", "\\u", "kw_", "=_", "kw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "varli", "st_", "=_", "kw_", "._", "get_", "(_", "'", "varli", "st", "'_", ",_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "targets_", "=_", "kw_", "._", "get_", "(_", "'", "target", "s", "'_", ",_", "'$", "TARGET", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "generate_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "for", "\\u", "signature_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ensure", " ", "tha", "t", " ", "target", " ", "is", " ", "a", " ", "list", ",", " ", "to", " ", "make", " ", "it", " ", "easi", "er", " ", "to", " ", "write_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "generat", "or", " ", "function", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "is", "\\u", "List_", "(_", "target_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "[_", "target_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "executor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "targets_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "executor_", "._", "get", "\\u", "all", "\\u", "sources_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "=_", "self_", "._", "generator_", "(_", "target_", "=_", "target_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "source_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "env_", "=_", "env_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "for", "\\u", "signature_", "=_", "for", "\\u", "signature_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gen", "\\u", "cmd_", "=_", "Action_", "(_", "ret_", ",_", "**_", "self_", "._", "gen", "\\u", "kw_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "gen", "\\u", "cmd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "SC", "ons_", "._", "Errors_", "._", "User", "Error_", "(_", "\"", "Object", " ", "return", "ed", " ", "from", " ", "command", " ", "generat", "or", ":", " ", "%", "s", " ", "cann", "ot", " ", "be", " ", "used", " ", "to", " ", "create", " ", "an", " ", "Action", ".\"_", "%_", "repr_", "(_", "ret_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "gen", "\\u", "cmd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "=_", "self_", "._", "presu", "b", "\\u", "env_", "\\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 ", " _", "env_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "env_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "env_", "=_", "SC", "ons_", "._", "Defaults_", "._", "Default", "Environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "act_", "=_", "self_", "._", "\\u", "generate_", "(_", "[_", "]_", ",_", "[_", "]_", ",_", "env_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "(_", "act_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "batch", "\\u", "key_", "(_", "self_", ",_", "env_", ",_", "target_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "1_", ")_", "._", "batch", "\\u", "key_", "(_", "env_", ",_", "target_", ",_", "source_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gens", "tring_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "1_", ",_", "executor_", ")_", "._", "gens", "tring_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "exits", "tat", "func_", "=_", "\\u", "null_", ",_", "presu", "b_", "=_", "\\u", "null_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "show_", "=_", "\\u", "null_", ",_", "execute_", "=_", "\\u", "null_", ",_", "chdir_", "=_", "\\u", "null_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "act_", "=_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "0_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "act_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "SC", "ons_", "._", "Errors_", "._", "User", "Error_", "(_", "\"", "Whi", "le", " ", "buildi", "ng", " ", "`", "%", "s", "':", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Cann", "ot", " ", "deduc", "e", " ", "file", " ", "extensi", "on", " ", "from", " ", "source", " ", "files", ":", " ", "%", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "repr_", "(_", "list_", "(_", "map_", "(_", "str_", ",_", "target_", ")_", ")_", ")_", ",_", "repr_", "(_", "list_", "(_", "map_", "(_", "str_", ",_", "source_", ")_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "act_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "exits", "tat", "func_", ",_", "presu", "b_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "show_", ",_", "execute_", ",_", "chdir_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "presi", "g_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "the", " ", "signa", "ture", " ", "content", "s", " ", "of", " ", "this", " ", "action", "'", "s", " ", "command", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "strip", "s", " ", "$(", "-", "$)", " ", "and", " ", "every", "thing", " ", "in", " ", "bet", "ween", " ", "the", " ", "string", ",", "\\", "10", ";", " ", " ", " ", " ", "sinc", "e", " ", "tho", "se", " ", "part", "s", " ", "don", "'", "t", " ", "affect", " ", "signa", "tures", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "1_", ",_", "executor_", ")_", "._", "get", "\\u", "presi", "g_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "implicit", "\\u", "deps_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "1_", ",_", "executor_", ")_", "._", "get", "\\u", "implicit", "\\u", "deps_", "(_", "target_", ",_", "source_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "varli", "st_", "(_", "self_", ",_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generate_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "1_", ",_", "executor_", ")_", "._", "get", "\\u", "varli", "st_", "(_", "target_", ",_", "source_", ",_", "env_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Generat", "or", "Action_", "(_", "Action", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "targets_", "(_", "self_", ",_", "env_", ",_", "executor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "generate_", "(_", "None_", ",_", "None_", ",_", "env_", ",_", "1_", ",_", "executor_", ")_", "._", "get", "\\u", "targets_", "(_", "env_", ",_", "executor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "La", "zy", "Action_", "(_", "Command", "Generat", "or", "Action_", ",_", "Command", "Action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Suspicious unused loop iteration variable
evennia/evennia/evennia/server/sessionhandler.py
[ { "content": " def portal_sessions_sync(self, portalsessionsdata):\n \"\"\"\n Syncing all session ids of the portal with the ones of the\n server. This is instantiated by the portal when reconnecting.\n\n Args:\n portalsessionsdata (dict): A dictionary\n `{sessid: {property:value},...}` defining each session and\n the properties in it which should be synced.\n\n \"\"\"\n delayed_import()\n global _ServerSession, _PlayerDB, _ServerConfig, _ScriptDB\n\n for sess in self.values():\n # we delete the old session to make sure to catch eventual\n # lingering references.\n del sess\n\n for sessid, sessdict in portalsessionsdata.items():\n sess = _ServerSession()\n sess.sessionhandler = self\n sess.load_sync_data(sessdict)\n if sess.uid:\n sess.player = _PlayerDB.objects.get_player_from_uid(sess.uid)\n self[sessid] = sess\n sess.at_sync()\n\n # after sync is complete we force-validate all scripts\n # (this also starts them)\n init_mode = _ServerConfig.objects.conf(\"server_restart_mode\", default=None)\n _ScriptDB.objects.validate(init_mode=init_mode)\n _ServerConfig.objects.conf(\"server_restart_mode\", delete=True)\n # announce the reconnection\n self.announce_all(_(\" ... Server restarted.\"))", "metadata": "root.ServerSessionHandler.portal_sessions_sync", "header": "['class', 'ServerSessionHandler', '(', 'SessionHandler', ')', ':', '___EOS___']", "index": 195 }, { "content": " def disconnect_all_sessions(self, reason=\"You have been disconnected.\"):\n \"\"\"\n Cleanly disconnect all of the connected sessions.\n\n Args:\n reason (str, optional): The reason for the disconnection.\n\n \"\"\"\n\n for session in self:\n del session\n # tell portal to disconnect all sessions\n self.server.amp_protocol.send_AdminServer2Portal(DUMMYSESSION,\n operation=SDISCONNALL,\n reason=reason)", "metadata": "root.ServerSessionHandler.disconnect_all_sessions", "header": "['class', 'ServerSessionHandler', '(', 'SessionHandler', ')', ':', '___EOS___']", "index": 356 } ]
[ { "span": "for sess in self.values():", "start_line": 209, "start_column": 8, "end_line": 209, "end_column": 34 }, { "span": "for session in self:", "start_line": 365, "start_column": 8, "end_line": 365, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Sus", "picio", "us_", "unused_", "loop_", "iteration_", "variable_", "[SEP]_", "class_", "Server", "Sess", "ion", "Handler_", "(_", "Sess", "ion", "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_", "def_", "portal", "\\u", "session", "s", "\\u", "sync_", "(_", "self_", ",_", "portal", "session", "sdata", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sync", "ing", " ", "all", " ", "session", " ", "ids", " ", "of", " ", "the", " ", "portal", " ", "with", " ", "the", " ", "ones", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "server", ".", " ", "Thi", "s", " ", "is", " ", "instantiate", "d", " ", "by", " ", "the", " ", "portal", " ", "whe", "n", " ", "reconnect", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "portal", "session", "sdata", " ", "(", "dict", "):", " ", "A", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "`", "{", "sess", "id", ":", " ", "{", "property", ":", "value", "},", "...", "}`", " ", "defini", "ng", " ", "each", " ", "session", " ", "and", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "the", " ", "proper", "ties", " ", "in", " ", "it", " ", "whi", "ch", " ", "shou", "ld", " ", "be", " ", "synced", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delayed", "\\u", "import_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "\\u", "Server", "Session_", ",_", "\\u", "Player", "DB_", ",_", "\\u", "Server", "Config_", ",_", "\\u", "Script", "DB_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "sess_", "in_", "self_", "._", "values_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "delete", " ", "the", " ", "old", " ", "session", " ", "to", " ", "make", " ", "sure", " ", "to", " ", "catch", " ", "eventual", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ling", "erin", "g", " ", "reference", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "sess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "sess", "id_", ",_", "sess", "dict_", "in_", "portal", "session", "sdata", "_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "=_", "\\u", "Server", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "session", "handler_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "load", "\\u", "sync", "\\u", "data_", "(_", "sess", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sess_", "._", "uid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sess_", "._", "player_", "=_", "\\u", "Player", "DB_", "._", "objects_", "._", "get", "\\u", "player", "\\u", "from", "\\u", "uid_", "(_", "sess_", "._", "uid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "[_", "sess", "id_", "]_", "=_", "sess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sess_", "._", "at", "\\u", "sync_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "after", " ", "sync", " ", "is", " ", "complete", " ", "we", " ", "force", "-", "validat", "e", " ", "all", " ", "scripts_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "this", " ", "als", "o", " ", "starts", " ", "them", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "init", "\\u", "mode_", "=_", "\\u", "Server", "Config_", "._", "objects_", "._", "conf_", "(_", "\"", "server", "\\u", "restart", "\\u", "mode", "\"_", ",_", "default_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Script", "DB_", "._", "objects_", "._", "validate_", "(_", "init", "\\u", "mode_", "=_", "init", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Server", "Config_", "._", "objects_", "._", "conf_", "(_", "\"", "server", "\\u", "restart", "\\u", "mode", "\"_", ",_", "delete_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "announce", " ", "the", " ", "reconnect", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "announce", "\\u", "all_", "(_", "\\u_", "(_", "\"", " ", "...", " ", "Server", " ", "restart", "ed", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Server", "Sess", "ion", "Handler_", "(_", "Sess", "ion", "Handler_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "discon", "nect", "\\u", "all", "\\u", "sessions_", "(_", "self_", ",_", "reason_", "=_", "\"", "You", " ", "have", " ", "bee", "n", " ", "disconnected", ".\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Clean", "ly", " ", "discon", "nect", " ", "all", " ", "of", " ", "the", " ", "connect", "ed", " ", "session", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "reason", " ", "(", "str", ",", " ", "option", "al", "):", " ", "The", " ", "reason", " ", "for", " ", "the", " ", "discon", "necti", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "session_", "in_", "self_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tell", " ", "portal", " ", "to", " ", "discon", "nect", " ", "all", " ", "sessions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "server_", "._", "amp", "\\u", "protocol_", "._", "send", "\\u", "Admi", "n", "Server", "2", "Porta", "l_", "(_", "DUMMY", "SESSION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "operation_", "=_", "SD", "ISC", "ON", "NA", "LL_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reason_", "=_", "reason_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Variable defined multiple times
fusionbox/django-widgy/tests/core_tests/tests/test_links.py
[ { "content": " def test_save_and_create(self):\n page = LinkableThing.objects.create()\n form = LinkForm()\n choice = get_composite_key(page)\n form = LinkForm({\n 'link': choice,\n })\n self.assertTrue(form.is_valid())\n instance = form.save(commit=False)\n self.assertEqual(instance.link, page)\n\n form2 = LinkForm({\n 'link': choice,\n })\n # save without validating.\n form2.save(commit=False)", "metadata": "root.TestLinkForm.test_save_and_create", "header": "['class', 'TestLinkForm', '(', 'TestCase', ')', ':', '___EOS___']", "index": 84 } ]
[ { "span": "form ", "start_line": 86, "start_column": 8, "end_line": 86, "end_column": 12 } ]
[ { "span": "form ", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 12 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Link", "Form_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "save", "\\u", "and", "\\u", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "page_", "=_", "Link", "able", "Thing_", "._", "objects_", "._", "create_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Link", "Form_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "choice_", "=_", "get", "\\u", "composi", "te", "\\u", "key_", "(_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "=_", "Link", "Form_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "choice_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "form_", "._", "is", "\\u", "valid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "=_", "form_", "._", "save_", "(_", "commit_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "instance_", "._", "link_", ",_", "page_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "form", "2_", "=_", "Link", "Form_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "'_", ":_", "choice_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "save", " ", "with", "out", " ", "validat", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "form", "2_", "._", "save_", "(_", "commit_", "=_", "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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
foundit/Piped/piped/processors/test/test_util_processors.py
[ { "content": " def test_doesnt_touch_the_baton(self):\n stopper = util_processors.Stopper(decider='baton: False')\n stopper.consumers = ['not empty']\n\n stopper.configure(processing.RuntimeEnvironment())\n\n baton = object()\n self.assertTrue(stopper.process(baton) is baton)", "metadata": "root.TestStopper.test_doesnt_touch_the_baton", "header": "['class', 'TestStopper', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 509 } ]
[ { "span": "self.assertTrue(stopper.process(baton) is baton)", "start_line": 516, "start_column": 8, "end_line": 516, "end_column": 56 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Stopp", "er_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "doesnt", "\\u", "touch", "\\u", "the", "\\u", "bat", "on_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stopp", "er_", "=_", "util", "\\u", "processors_", "._", "Stopp", "er_", "(_", "decide", "r_", "=_", "'", "bat", "on", ":", " ", "Fal", "se", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stopp", "er_", "._", "consumers", "_", "=_", "[_", "'", "not", " ", "empty", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stopp", "er_", "._", "configure_", "(_", "processing_", "._", "Run", "time", "Environment_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bat", "on_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "stopp", "er_", "._", "process_", "(_", "bat", "on_", ")_", "is_", "bat", "on_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Redundant assignment
dimagi/commcare-hq/custom/opm/tests/case_reports.py
[ { "content": "def make_case_row(form_props=None, vhnd_props=None, block='Atri', child_age=6):\n \"\"\"\n Accepts lists of properties available in form and at the vhnd\n and returns a corresponding case row\n \"\"\"\n report_year = 2014\n report_month = 6\n date_in_month = datetime(2014, 6, 10)\n child_age = child_age\n owner_id = 'mock_owner_id'\n\n forms = [XFormInstance(\n form={'child_1': {prop: '1' for prop in form_props or []}},\n received_on=date_in_month,\n xmlns=constants.CFU1_XMLNS,\n )]\n\n dod_year, dod_month = add_months(report_year, report_month, -child_age)\n case = OPMCase(\n forms=forms or [],\n dod=date(dod_year, dod_month, 10),\n owner_id=owner_id,\n )\n\n data_provider = MockDataProvider(explicit_map={\n owner_id: {\n prop: {date_in_month.date()}\n for prop in vhnd_props or []\n }\n })\n\n report = Report(\n month=report_month,\n year=report_year,\n block=block,\n )\n\n row = MockCaseRow(case, report, data_provider=data_provider)\n assert row.child_age == child_age\n return row", "metadata": "root.make_case_row", "header": "['module', '___EOS___']", "index": 152 } ]
[ { "span": "child_age = child_age", "start_line": 160, "start_column": 4, "end_line": 160, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "assignment_", "[SEP]_", "module_", "\\u\\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", "case", "\\u", "row_", "(_", "form", "\\u", "props_", "=_", "None_", ",_", "vh", "nd", "\\u", "props_", "=_", "None_", ",_", "block_", "=_", "'", "At", "ri", "'_", ",_", "child", "\\u", "age_", "=_", "6_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Accept", "s", " ", "lists", " ", "of", " ", "proper", "ties", " ", "avail", "able", " ", "in", " ", "form", " ", "and", " ", "at", " ", "the", " ", "vh", "nd", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "return", "s", " ", "a", " ", "correspond", "ing", " ", "case", " ", "row", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report", "\\u", "year_", "=_", "2014_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report", "\\u", "month_", "=_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "in", "\\u", "month_", "=_", "datetime_", "(_", "2014_", ",_", "6_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "age_", "=_", "child", "\\u", "age_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "owner", "\\u", "id_", "=_", "'", "mock", "\\u", "owner", "\\u", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "forms_", "=_", "[_", "XF", "orm", "Instance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "form_", "=_", "{_", "'", "child", "\\u", "1", "'_", ":_", "{_", "prop_", ":_", "'", "1", "'_", "for_", "prop_", "in_", "form", "\\u", "props_", "or_", "[_", "]_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "receive", "d\\u", "on_", "=_", "date", "\\u", "in", "\\u", "month_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xmlns_", "=_", "constants_", "._", "CF", "U1", "\\u", "XML", "NS_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dod", "\\u", "year_", ",_", "dod", "\\u", "month_", "=_", "add", "\\u", "months_", "(_", "report", "\\u", "year_", ",_", "report", "\\u", "month_", ",_", "-_", "child", "\\u", "age_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "case_", "=_", "OP", "MC", "ase_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "forms_", "=_", "forms_", "or_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dod", "_", "=_", "date_", "(_", "dod", "\\u", "year_", ",_", "dod", "\\u", "month_", ",_", "10_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "id_", "=_", "owner", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "provider_", "=_", "Moc", "k", "Data", "Provider_", "(_", "explicit", "\\u", "map_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "owner", "\\u", "id_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "prop_", ":_", "{_", "date", "\\u", "in", "\\u", "month_", "._", "date_", "(_", ")_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "prop_", "in_", "vh", "nd", "\\u", "props_", "or_", "[_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "report_", "=_", "Report_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "month_", "=_", "report", "\\u", "month_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "year_", "=_", "report", "\\u", "year_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "block_", "=_", "block_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "row_", "=_", "Moc", "k", "Case", "Row_", "(_", "case_", ",_", "report_", ",_", "data\\u", "provider_", "=_", "data\\u", "provider_", ")_", "\\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 ]
Except block handles 'BaseException'
tankywoo/simiki/simiki/log.py
[ { "content": " def format(self, record):\n try:\n msg = super(ANSIFormatter, self).format(record)\n except:\n # for python2.6\n # Formatter is old-style class in python2.6 and type is classobj\n # another trick: http://stackoverflow.com/a/18392639/1276501\n msg = Formatter.format(self, record)\n\n lvl2color = {\n \"DEBUG\": \"blue\",\n \"INFO\": \"green\",\n \"WARNING\": \"yellow\",\n \"ERROR\": \"red\",\n \"CRITICAL\": \"bgred\"\n }\n\n rln = record.levelname\n if rln in lvl2color:\n return \"[{0}]: {1}\".format(\n utils.color_msg(lvl2color[rln], rln),\n msg\n )\n else:\n return msg", "metadata": "root.ANSIFormatter.format", "header": "['class', 'ANSIFormatter', '(', 'Formatter', ')', ':', '___EOS___']", "index": 14 }, { "content": " def format(self, record):\n try:\n msg = super(NonANSIFormatter, self).format(record)\n except:\n # for python2.6\n # Formatter is old-style class in python2.6 and type is classobj\n # another trick: http://stackoverflow.com/a/18392639/1276501\n msg = Formatter.format(self, record)\n\n rln = record.levelname\n return \"[{0}]: {1}\".format(rln, msg)", "metadata": "root.NonANSIFormatter.format", "header": "['class', 'NonANSIFormatter', '(', 'Formatter', ')', ':', '___EOS___']", "index": 44 } ]
[ { "span": "except:", "start_line": 17, "start_column": 8, "end_line": 17, "end_column": 15 }, { "span": "except:", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "ANSI", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "format_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "super_", "(_", "ANSI", "Formatter_", ",_", "self_", ")_", "._", "format_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "python", "2.6", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Formatt", "er", " ", "is", " ", "old", "-", "style", " ", "class", " ", "in", " ", "python", "2.6", " ", "and", " ", "type", " ", "is", " ", "class", "obj_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "trick", ":", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "183", "926", "3", "9", "/", "127", "650", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lvl", "2co", "lor_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "DEBU", "G", "\"_", ":_", "\"", "blue", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "INFO", "\"_", ":_", "\"", "green", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "WARN", "ING", "\"_", ":_", "\"", "yell", "ow", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ERROR", "\"_", ":_", "\"", "red", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CRIT", "ICAL", "\"_", ":_", "\"", "bgr", "ed", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rl", "n_", "=_", "record_", "._", "level", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rl", "n_", "in_", "lvl", "2co", "lor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"[{", "0", "}]", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "utils_", "._", "color", "\\u", "msg_", "(_", "lvl", "2co", "lor_", "[_", "rl", "n_", "]_", ",_", "rl", "n_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "msg_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Non", "ANSI", "Formatter_", "(_", "Formatter_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "format_", "(_", "self_", ",_", "record_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "super_", "(_", "Non", "ANSI", "Formatter_", ",_", "self_", ")_", "._", "format_", "(_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "python", "2.6", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Formatt", "er", " ", "is", " ", "old", "-", "style", " ", "class", " ", "in", " ", "python", "2.6", " ", "and", " ", "type", " ", "is", " ", "class", "obj_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "trick", ":", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "183", "926", "3", "9", "/", "127", "650", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "Formatter_", "._", "format_", "(_", "self_", ",_", "record_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rl", "n_", "=_", "record_", "._", "level", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"[{", "0", "}]", ":", " ", "{", "1", "}\"_", "._", "format_", "(_", "rl", "n_", ",_", "msg_", ")_", "\\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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
pycassa/pycassa/pycassa/cassandra/constants.py
[ { "content": "#\n# Autogenerated by Thrift Compiler (0.9.0)\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\nVERSION = \"19.36.1\"\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.0", ")_", "\\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_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "VERSION_", "=_", "\"", "19.", "36.", "1", "\"_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
bloomberg/phabricator-tools/py/abd/abdt_git__t.py
[ { "content": " def test_B_RawDiffNewCommits(self):\n base, branch_name, branch = self._setup_for_tracked_branch()\n\n self.assertIs(branch.has_new_commits(), False)\n\n # push a new commit on branch as dev\n phlgit_checkout.branch(self.repo_dev, branch_name)\n filename = 'new_on_branch'\n self._create_new_file(self.repo_dev, filename)\n self.repo_dev('add', filename)\n phlgit_commit.index(self.repo_dev, message=filename)\n phlgit_push.branch(self.repo_dev, branch_name)\n\n branch = self._get_updated_branch(branch_name)\n\n # check for new stuff as arcyd\n self.assertIs(branch.has_new_commits(), True)\n branch.describe_new_commits() # just exercise\n self.assertIn(filename, branch.make_raw_diff().diff)\n branch.mark_ok_in_review()\n self.assertIs(branch.has_new_commits(), False)\n branch.describe_new_commits() # just exercise\n\n # exercise queries a bit\n self.assertIn(filename, branch.make_raw_diff().diff)\n self.assertIn(filename, branch.make_message_digest())\n self.assertEqual(\n branch.get_commit_message_from_tip().strip(),\n filename)\n self.assertTrue(len(branch.get_any_author_emails()) > 0)\n self.assertTrue(len(branch.get_author_names_emails()) > 0)\n\n # make a new commit on master as dev\n phlgit_checkout.branch(self.repo_dev, 'master')\n filename = 'new_on_master'\n self._create_new_file(self.repo_dev, filename)\n self.repo_dev('add', filename)\n phlgit_commit.index(self.repo_dev, message=filename)\n phlgit_push.branch(self.repo_dev, 'master')\n\n # refresh the branch\n branch = self._get_updated_branch(branch_name)\n self.assertIs(branch.has_new_commits(), False)\n\n # merge master into branch, check for new stuff as arcyd\n phlgit_checkout.branch(self.repo_dev, branch_name)\n phlgit_merge.no_ff(self.repo_dev, 'master')\n phlgit_push.branch(self.repo_dev, branch_name)\n\n # check for new stuff as arcyd\n self.assertIs(branch.has_new_commits(), False)\n branch = self._get_updated_branch(branch_name)\n self.assertNotIn(filename, branch.make_raw_diff().diff)\n branch.mark_ok_in_review()\n self.assertIs(branch.has_new_commits(), False)\n\n # rebase branch onto master\n phlgit_checkout.branch(self.repo_dev, branch_name)\n phlgit_rebase.onto_upstream(self.repo_dev, 'master')\n phlgit_push.force_branch(self.repo_dev, branch_name)\n\n # check for new stuff as arcyd\n self.assertIs(branch.has_new_commits(), False)\n branch = self._get_updated_branch(branch_name)\n self.assertIs(branch.has_new_commits(), True)\n branch.describe_new_commits() # just exercise\n branch.mark_ok_in_review()\n self.assertIs(branch.has_new_commits(), False)", "metadata": "root.Test.test_B_RawDiffNewCommits", "header": "['class', 'Test', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 108 } ]
[ { "span": "self.assertTrue(len(branch.get_any_author_emails()) > 0)", "start_line": 137, "start_column": 8, "end_line": 137, "end_column": 64 }, { "span": "self.assertTrue(len(branch.get_author_names_emails()) > 0)", "start_line": 138, "start_column": 8, "end_line": 138, "end_column": 66 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[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_", "test\\u", "B", "\\u", "Ra", "w", "Diff", "New", "Commi", "ts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", ",_", "branch", "\\u", "name_", ",_", "branch_", "=_", "self_", "._", "\\u", "setup", "\\u", "for", "\\u", "tracked", "\\u", "branch_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "push", " ", "a", " ", "new", " ", "commit", " ", "on", " ", "branch", " ", "as", " ", "dev_", "\\u\\u\\uNL\\u\\u\\u_", "ph", "lg", "it", "\\u", "checkout_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'", "new", "\\u", "on", "\\u", "branch", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "create", "\\u", "new", "\\u", "file_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo", "\\u", "dev_", "(_", "'", "add", "'_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "commit_", "._", "index_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "message_", "=_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "push_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "branch_", "=_", "self_", "._", "\\u", "get", "\\u", "update", "d\\u", "branch_", "(_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "new", " ", "stu", "ff", " ", "as", " ", "arc", "yd", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "descri", "be", "\\u", "new", "\\u", "commits_", "(_", ")_", "#", " ", "just", " ", "exercise", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "filename_", ",_", "branch_", "._", "make", "\\u", "raw", "\\u", "diff_", "(_", ")_", "._", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "mark", "\\u", "ok", "\\u", "in", "\\u", "review_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "descri", "be", "\\u", "new", "\\u", "commits_", "(_", ")_", "#", " ", "just", " ", "exercise", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exercise", " ", "querie", "s", " ", "a", " ", "bit_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "filename_", ",_", "branch_", "._", "make", "\\u", "raw", "\\u", "diff_", "(_", ")_", "._", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "filename_", ",_", "branch_", "._", "make", "\\u", "message", "\\u", "digest_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "branch_", "._", "get", "\\u", "commit", "\\u", "message", "\\u", "from", "\\u", "tip_", "(_", ")_", "._", "strip_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "branch_", "._", "get", "\\u", "any", "\\u", "author", "\\u", "emails_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "branch_", "._", "get", "\\u", "author", "\\u", "names", "\\u", "emails_", "(_", ")_", ")_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "a", " ", "new", " ", "commit", " ", "on", " ", "master", " ", "as", " ", "dev_", "\\u\\u\\uNL\\u\\u\\u_", "ph", "lg", "it", "\\u", "checkout_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "'", "master", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'", "new", "\\u", "on", "\\u", "master", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "create", "\\u", "new", "\\u", "file_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "repo", "\\u", "dev_", "(_", "'", "add", "'_", ",_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "commit_", "._", "index_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "message_", "=_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "push_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "'", "master", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "refre", "sh", " ", "the", " ", "branch_", "\\u\\u\\uNL\\u\\u\\u_", "branch_", "=_", "self_", "._", "\\u", "get", "\\u", "update", "d\\u", "branch_", "(_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "merge", " ", "master", " ", "int", "o", " ", "branch", ",", " ", "check", " ", "for", " ", "new", " ", "stu", "ff", " ", "as", " ", "arc", "yd", "_", "\\u\\u\\uNL\\u\\u\\u_", "ph", "lg", "it", "\\u", "checkout_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "merge_", "._", "no", "\\u", "ff_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "'", "master", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "push_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "new", " ", "stu", "ff", " ", "as", " ", "arc", "yd", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "=_", "self_", "._", "\\u", "get", "\\u", "update", "d\\u", "branch_", "(_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "In_", "(_", "filename_", ",_", "branch_", "._", "make", "\\u", "raw", "\\u", "diff_", "(_", ")_", "._", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "mark", "\\u", "ok", "\\u", "in", "\\u", "review_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rebase", " ", "branch", " ", "onto", " ", "master_", "\\u\\u\\uNL\\u\\u\\u_", "ph", "lg", "it", "\\u", "checkout_", "._", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "rebase", "_", "._", "onto", "\\u", "upstream_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "'", "master", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ph", "lg", "it", "\\u", "push_", "._", "force", "\\u", "branch_", "(_", "self_", "._", "repo", "\\u", "dev_", ",_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "for", " ", "new", " ", "stu", "ff", " ", "as", " ", "arc", "yd", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "=_", "self_", "._", "\\u", "get", "\\u", "update", "d\\u", "branch_", "(_", "branch", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "descri", "be", "\\u", "new", "\\u", "commits_", "(_", ")_", "#", " ", "just", " ", "exercise", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "branch_", "._", "mark", "\\u", "ok", "\\u", "in", "\\u", "review_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "branch_", "._", "has", "\\u", "new", "\\u", "commits_", "(_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
CollabQ/CollabQ/login/views.py
[ { "content": "import logging\n# Copyright 2009 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom django import http\nfrom django import template\nfrom django.conf import settings\nfrom django.template import loader\nfrom django.core.cache import cache\n\nfrom google.appengine.api import users\n\nfrom common import api\nfrom common import clean\nfrom common import decorator\nfrom common import exception\nfrom common import user\nfrom common import util\nfrom common.exception import logging\nfrom common import views as common_views\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@decorator.cache_never\ndef login_login(request):\n redirect_to = request.REQUEST.get('redirect_to', '/')\n redirect_to = clean.redirect_to(redirect_to)\n \n if request.POST:\n try:\n login = request.POST.get('log', None)\n password = request.POST.get('pwd', None)\n rememberme = request.POST.get('rememberme', None)\n\n # TODO validate\n\n current_user = user.lookup_user_by_login(login, password)\n if current_user:\n if redirect_to == '/':\n redirect_to = current_user.url('/overview')\n\n # Attempt to do some cleanup on the user if necessary\n api.user_cleanup(api.ROOT, current_user.nick)\n\n \n # if we aren't hosted or aren't ssl just set the cookie and go home\n if (not settings.HOSTED_DOMAIN_ENABLED \n or not settings.SSL_LOGIN_ENABLED):\n response = http.HttpResponseRedirect(redirect_to)\n response = user.set_user_cookie(response, current_user, rememberme)\n return response\n \n # otherwise, we're going to have to redirect to set the cookie on\n # the proper domain\n sso_token = util.generate_uuid()\n\n cache.set('sso/%s' % sso_token, (current_user.nick, rememberme), timeout=10)\n sso_url = 'http://%s/login/noreally' % (settings.DOMAIN)\n sso_url = util.qsa(\n sso_url, {'redirect_to': redirect_to, 'sso_token': sso_token})\n return http.HttpResponseRedirect(sso_url)\n else:\n raise exception.ValidationError(\"Invalid username or password\")\n except:\n exception.handle_exception(request)\n view =user.get_user_from_cookie_or_legacy_auth(request)\n area=\"login\"\n if view:\n if redirect_to == '/':\n redirect_to = request.user.url('/overview')\n return http.HttpResponseRedirect(redirect_to)\n \n c = template.RequestContext(request, locals()) \n t = loader.get_template('login/templates/login.html')\n return http.HttpResponse(t.render(c))", "metadata": "root.login_login", "header": "['module', '___EOS___']", "index": 32 }, { "content": "@decorator.cache_never\ndef login_noreally(request):\n if 'sso_token' in request.GET:\n sso_token = request.GET['sso_token']\n redirect_to = request.GET['redirect_to']\n redirect_to = clean.redirect_to(redirect_to)\n\n nick, rememberme = cache.get('sso/%s' % sso_token)\n cache.delete('sso/%s' % sso_token)\n actor_ref = api.actor_get(api.ROOT, nick)\n response = http.HttpResponseRedirect(redirect_to)\n response = user.set_user_cookie(response, actor_ref, rememberme)\n return response\n return http.HttpResponseRedirect('/login')", "metadata": "root.login_noreally", "header": "['module', '___EOS___']", "index": 85 }, { "content": "@decorator.cache_never\ndef login_logout(request):\n request.user = None\n redirect_to = '/'\n flash = \"You have signed out! You are no longer signed in to %s\" % util.get_metadata('SITE_NAME')\n c = template.RequestContext(request, locals())\n t = loader.get_template('login/templates/logout.html')\n\n #response = http.HttpResponseRedirect(redirect_to)\n response = util.RedirectFlash(redirect_to, flash)\n response = user.clear_user_cookie(response)\n return response", "metadata": "root.login_logout", "header": "['module', '___EOS___']", "index": 100 }, { "content": "def login_forgot(request):\n if request.user:\n # If the user is logged in, they don't get to the \"forgot password\" page.\n raise exception.AlreadyLoggedInException()\n\n handled = common_views.handle_view_action(\n request, {'login_forgot': request.path,})\n\n if handled:\n return handled\n\n c = template.RequestContext(request, locals())\n t = loader.get_template('login/templates/forgot.html')\n\n response = http.HttpResponse(t.render(c))\n return response", "metadata": "root.login_forgot", "header": "['module', '___EOS___']", "index": 113 }, { "content": "def login_reset(request):\n # TODO(termie): this is a weird return type for an api call\n new_password, nick = api.login_reset(\n None, request.GET.get('email'), request.GET.get('hash'))\n\n c = template.RequestContext(request, locals())\n t = loader.get_template('login/templates/recover.html')\n\n response = http.HttpResponse(t.render(c))\n return response", "metadata": "root.login_reset", "header": "['module', '___EOS___']", "index": 130 } ]
[ { "span": "import logging", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 14 }, { "span": "from google.appengine.api import users", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 38 }, { "span": "from common.exception import logging", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 36 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Copy", "right", " ", "200", "9", " ", "Goo", "gle", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "http_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "cache_", "import_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "google_", "._", "appengine_", "._", "api_", "import_", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "common_", "import_", "api_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "clean_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "._", "exception_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "common_", "import_", "views_", "as_", "common", "\\u", "views_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "@_", "decorator_", "._", "cache", "\\u", "neve", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "login", "\\u", "login_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirec", "t", "\\u", "to_", "=_", "request_", "._", "REQUEST_", "._", "get_", "(_", "'", "redirec", "t", "\\u", "to", "'_", ",_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "to_", "=_", "clean_", "._", "redirec", "t", "\\u", "to_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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 ", " _", "login_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "log", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "pwd", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remember", "me_", "=_", "request_", "._", "POST_", "._", "get_", "(_", "'", "remember", "me", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", " ", "validate_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "current", "\\u", "user_", "=_", "user_", "._", "look", "up", "\\u", "user", "\\u", "by", "\\u", "login_", "(_", "login_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "current", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "redirec", "t", "\\u", "to_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirec", "t", "\\u", "to_", "=_", "current", "\\u", "user_", "._", "url_", "(_", "'/", "over", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "do", " ", "some", " ", "clean", "up", " ", "on", " ", "the", " ", "user", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "api_", "._", "user", "\\u", "cleanup_", "(_", "api_", "._", "ROOT_", ",_", "current", "\\u", "user_", "._", "nick_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "are", "n", "'", "t", " ", "hoste", "d", " ", "or", " ", "are", "n", "'", "t", " ", "ssl", " ", "just", " ", "set", " ", "the", " ", "cookie", " ", "and", " ", "go", " ", "home_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "not_", "settings_", "._", "HOST", "ED", "\\u", "DOM", "AIN", "\\u", "ENABLED_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "not_", "settings_", "._", "SS", "L", "\\u", "LOGIN", "\\u", "ENABLED_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "user_", "._", "set\\u", "user", "\\u", "cookie_", "(_", "response_", ",_", "current", "\\u", "user_", ",_", "remember", "me_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "we", "'", "re", " ", "goi", "ng", " ", "to", " ", "have", " ", "to", " ", "redirec", "t", " ", "to", " ", "set", " ", "the", " ", "cookie", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "proper", " ", "domain_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sso", "\\u", "token_", "=_", "util_", "._", "generat", "e\\u", "uuid_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cache_", "._", "set_", "(_", "'", "sso", "/", "%", "s", "'_", "%_", "sso", "\\u", "token_", ",_", "(_", "current", "\\u", "user_", "._", "nick_", ",_", "remember", "me_", ")_", ",_", "timeout_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sso", "\\u", "url_", "=_", "'", "http", "://", "%", "s", "/", "login", "/", "nore", "ally", "'_", "%_", "(_", "settings_", "._", "DOMAIN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sso", "\\u", "url_", "=_", "util_", "._", "qs", "a_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sso", "\\u", "url_", ",_", "{_", "'", "redirec", "t", "\\u", "to", "'_", ":_", "redirec", "t", "\\u", "to_", ",_", "'", "sso", "\\u", "token", "'_", ":_", "sso", "\\u", "token_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "sso", "\\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 ", " _", "raise_", "exception_", "._", "Validat", "ion", "Error_", "(_", "\"", "Inva", "lid", " ", "user", "name", " ", "or", " ", "password", "\"_", ")_", "\\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 ", " _", "exception_", "._", "handle", "\\u", "exception_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "view_", "=_", "user_", "._", "get", "\\u", "user", "\\u", "from", "\\u", "cookie", "\\u", "or", "\\u", "lega", "cy", "\\u", "auth_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "area_", "=_", "\"", "login", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "view_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "redirec", "t", "\\u", "to_", "==_", "'/'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "redirec", "t", "\\u", "to_", "=_", "request_", "._", "user_", "._", "url_", "(_", "'/", "over", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\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_", "(_", "'", "login", "/", "template", "s", "/", "login", ".", "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_", "@_", "decorator_", "._", "cache", "\\u", "neve", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "login", "\\u", "nore", "ally", "_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "sso", "\\u", "token", "'_", "in_", "request_", "._", "GET_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sso", "\\u", "token_", "=_", "request_", "._", "GET_", "[_", "'", "sso", "\\u", "token", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "to_", "=_", "request_", "._", "GET_", "[_", "'", "redirec", "t", "\\u", "to", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "to_", "=_", "clean_", "._", "redirec", "t", "\\u", "to_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nick_", ",_", "remember", "me_", "=_", "cache_", "._", "get_", "(_", "'", "sso", "/", "%", "s", "'_", "%_", "sso", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "delete_", "(_", "'", "sso", "/", "%", "s", "'_", "%_", "sso", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "actor", "\\u", "ref_", "=_", "api_", "._", "actor", "\\u", "get_", "(_", "api_", "._", "ROOT_", ",_", "nick_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "redirec", "t", "\\u", "to_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "user_", "._", "set\\u", "user", "\\u", "cookie_", "(_", "response_", ",_", "actor", "\\u", "ref_", ",_", "remember", "me_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "http_", "._", "Http", "Respons", "e", "Redirect_", "(_", "'/", "login", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "decorator_", "._", "cache", "\\u", "neve", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "login", "\\u", "logout_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "request_", "._", "user_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "redirec", "t", "\\u", "to_", "=_", "'/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flash_", "=_", "\"", "You", " ", "have", " ", "sign", "ed", " ", "out", "!", " ", "You", " ", "are", " ", "no", " ", "long", "er", " ", "sign", "ed", " ", "in", " ", "to", " ", "%", "s", "\"_", "%_", "util_", "._", "get", "\\u", "metadata_", "(_", "'", "SITE", "\\u", "NAME", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "template_", "._", "Request", "Context_", "(_", "request_", ",_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "loader_", "._", "get", "\\u", "template_", "(_", "'", "login", "/", "template", "s", "/", "logo", "ut", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "response", " ", "=", " ", "http", ".", "Http", "Respons", "e", "Redirect", "(", "redirec", "t", "\\u", "to", ")_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "util_", "._", "Redirect", "Fla", "sh_", "(_", "redirec", "t", "\\u", "to_", ",_", "flash_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "user_", "._", "clear", "\\u", "user", "\\u", "cookie_", "(_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "login", "\\u", "forgo", "t_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "request_", "._", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "user", " ", "is", " ", "logged", " ", "in", ",", " ", "the", "y", " ", "don", "'", "t", " ", "get", " ", "to", " ", "the", " ", "\"", "forgo", "t", " ", "password", "\"", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Al", "read", "y", "Log", "ged", "In", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "handled_", "=_", "common", "\\u", "views_", "._", "handle", "\\u", "view", "\\u", "action_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "request_", ",_", "{_", "'", "login", "\\u", "forgo", "t", "'_", ":_", "request_", "._", "path_", ",_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "handled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "handled_", "\\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_", "(_", "'", "login", "/", "template", "s", "/", "forgo", "t", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "http_", "._", "Http", "Response_", "(_", "t_", "._", "render_", "(_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "login", "\\u", "reset_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", "(", "term", "ie", "):", " ", "this", " ", "is", " ", "a", " ", "weird", " ", "return", " ", "type", " ", "for", " ", "an", " ", "api", " ", "call_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "password_", ",_", "nick_", "=_", "api_", "._", "login", "\\u", "reset_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "request_", "._", "GET_", "._", "get_", "(_", "'", "email", "'_", ")_", ",_", "request_", "._", "GET_", "._", "get_", "(_", "'", "hash", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "template_", "._", "Request", "Context_", "(_", "request_", ",_", "locals_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "loader_", "._", "get", "\\u", "template_", "(_", "'", "login", "/", "template", "s", "/", "recover", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "http_", "._", "Http", "Response_", "(_", "t_", "._", "render_", "(_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Inconsistent equality and hashing
weblabdeusto/weblabdeusto/server/src/weblab/core/coordinator/resource.py
[ { "content": "class Resource(object):\n __metaclass__ = Representable\n\n\n\n", "metadata": "root.Resource", "header": "['module', '___EOS___']", "index": 18 }, { "content": " def __init__(self, resource_type, resource_instance):\n self.resource_type = resource_type\n self.resource_instance = resource_instance", "metadata": "root.Resource.__init__", "header": "['class', 'Resource', '(', 'object', ')', ':', '___EOS___']", "index": 21 }, { "content": " def to_weblab_str(self):\n return \"%s@%s\" % (self.resource_instance, self.resource_type)", "metadata": "root.Resource.to_weblab_str", "header": "['class', 'Resource', '(', 'object', ')', ':', '___EOS___']", "index": 25 }, { "content": " def __hash__(self):\n return hash(self.to_weblab_str())", "metadata": "root.Resource.__hash__", "header": "['class', 'Resource', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " @staticmethod\n def parse(weblab_str):\n pos = weblab_str.find(\"@\")\n resource_instance = weblab_str[:pos]\n resource_type = weblab_str[pos + 1 :]\n return Resource(resource_type, resource_instance)", "metadata": "root.Resource.parse", "header": "['class', 'Resource', '(', 'object', ')', ':', '___EOS___']", "index": 31 } ]
[ { "span": "def __hash__(self):", "start_line": 28, "start_column": 4, "end_line": 28, "end_column": 23 } ]
[ { "span": "class Resource(object):", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 23 } ]
1
false
[ "[CLS]_", "Inco", "nsis", "tent", "_", "equality", "_", "and_", "hashin", "g_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Resource_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "metaclass\\u\\u_", "=_", "Represent", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Resource_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "resource", "\\u", "type_", ",_", "resource", "\\u", "instance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "resource", "\\u", "type_", "=_", "resource", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "resource", "\\u", "instance_", "=_", "resource", "\\u", "instance_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resource_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "to", "\\u", "webla", "b", "\\u", "str_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "@", "%", "s", "\"_", "%_", "(_", "self_", "._", "resource", "\\u", "instance_", ",_", "self_", "._", "resource", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resource_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hash_", "(_", "self_", "._", "to", "\\u", "webla", "b", "\\u", "str_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Resource_", "(_", "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_", "parse_", "(_", "webla", "b", "\\u", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "webla", "b", "\\u", "str_", "._", "find_", "(_", "\"@\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "instance_", "=_", "webla", "b", "\\u", "str_", "[_", ":_", "pos_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resource", "\\u", "type_", "=_", "webla", "b", "\\u", "str_", "[_", "pos_", "+_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Resource_", "(_", "resource", "\\u", "type_", ",_", "resource", "\\u", "instance_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 3, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
ckcollab/polished/polished/backends/mixins/__init__.py
[ { "content": "from git import GitMixin\nfrom polisher import PolisherMixin\nfrom driver import DriverMixin\nfrom video import VideoMixin\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from git import GitMixin", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 24 }, { "span": "from polisher import PolisherMixin", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 34 }, { "span": "from driver import DriverMixin", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 30 }, { "span": "from video import VideoMixin", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "git_", "import_", "Git", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "polis", "her_", "import_", "Poli", "sher", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "driver_", "import_", "Drive", "r", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "video_", "import_", "Vid", "eo", "Mixin_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1 ]
Unused local variable
caffeinehit/django-oauth2-provider/provider/views.py
[ { "content": " def authorization_code(self, request, data, client):\n \"\"\"\n Handle ``grant_type=authorization_code`` requests as defined in\n :rfc:`4.1.3`.\n \"\"\"\n grant = self.get_authorization_code_grant(request, request.POST,\n client)\n if constants.SINGLE_ACCESS_TOKEN:\n at = self.get_access_token(request, grant.user, grant.scope, client)\n else:\n at = self.create_access_token(request, grant.user, grant.scope, client)\n rt = self.create_refresh_token(request, grant.user, grant.scope, at,\n client)\n\n self.invalidate_grant(grant)\n\n return self.access_token_response(at)", "metadata": "root.AccessToken.authorization_code", "header": "['class', 'AccessToken', '(', 'OAuthView', ',', 'Mixin', ')', ':', '___EOS___']", "index": 493 }, { "content": " def refresh_token(self, request, data, client):\n \"\"\"\n Handle ``grant_type=refresh_token`` requests as defined in :rfc:`6`.\n \"\"\"\n rt = self.get_refresh_token_grant(request, data, client)\n\n # this must be called first in case we need to purge expired tokens\n self.invalidate_refresh_token(rt)\n self.invalidate_access_token(rt.access_token)\n\n at = self.create_access_token(request, rt.user, rt.access_token.scope,\n client)\n rt = self.create_refresh_token(request, at.user, at.scope, at, client)\n\n return self.access_token_response(at)", "metadata": "root.AccessToken.refresh_token", "header": "['class', 'AccessToken', '(', 'OAuthView', ',', 'Mixin', ')', ':', '___EOS___']", "index": 511 }, { "content": " def password(self, request, data, client):\n \"\"\"\n Handle ``grant_type=password`` requests as defined in :rfc:`4.3`.\n \"\"\"\n\n data = self.get_password_grant(request, data, client)\n user = data.get('user')\n scope = data.get('scope')\n\n if constants.SINGLE_ACCESS_TOKEN:\n at = self.get_access_token(request, user, scope, client)\n else:\n at = self.create_access_token(request, user, scope, client)\n # Public clients don't get refresh tokens\n if client.client_type != 1:\n rt = self.create_refresh_token(request, user, scope, at, client)\n\n return self.access_token_response(at)", "metadata": "root.AccessToken.password", "header": "['class', 'AccessToken', '(', 'OAuthView', ',', 'Mixin', ')', ':', '___EOS___']", "index": 527 } ]
[ { "span": "rt ", "start_line": 504, "start_column": 12, "end_line": 504, "end_column": 14 }, { "span": "rt ", "start_line": 523, "start_column": 8, "end_line": 523, "end_column": 10 }, { "span": "rt ", "start_line": 542, "start_column": 16, "end_line": 542, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Access", "Token_", "(_", "OA", "uth", "View_", ",_", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authoriz", "ation", "\\u", "code_", "(_", "self_", ",_", "request_", ",_", "data_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "``", "grant", "\\u", "type", "=", "authoriz", "ation", "\\u", "code", "``", " ", "request", "s", " ", "as", " ", "defin", "ed", " ", "in", "\\", "10", ";", " ", " ", " ", " ", ":", "rfc", ":`", "4.1", ".3", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "grant_", "=_", "self_", "._", "get", "\\u", "authoriz", "ation", "\\u", "code", "\\u", "grant_", "(_", "request_", ",_", "request_", "._", "POST_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "constants_", "._", "SINGLE", "\\u", "ACCESS", "\\u", "TOKEN_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "at_", "=_", "self_", "._", "get", "\\u", "access", "\\u", "token_", "(_", "request_", ",_", "grant_", "._", "user_", ",_", "grant_", "._", "scope_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "at_", "=_", "self_", "._", "create", "\\u", "access", "\\u", "token_", "(_", "request_", ",_", "grant_", "._", "user_", ",_", "grant_", "._", "scope_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rt_", "=_", "self_", "._", "create", "\\u", "refre", "sh", "\\u", "token_", "(_", "request_", ",_", "grant_", "._", "user_", ",_", "grant_", "._", "scope_", ",_", "at_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "invalidate", "\\u", "grant_", "(_", "grant_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "access", "\\u", "token", "\\u", "response_", "(_", "at_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Access", "Token_", "(_", "OA", "uth", "View_", ",_", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "refre", "sh", "\\u", "token_", "(_", "self_", ",_", "request_", ",_", "data_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "``", "grant", "\\u", "type", "=", "refre", "sh", "\\u", "token", "``", " ", "request", "s", " ", "as", " ", "defin", "ed", " ", "in", " ", ":", "rfc", ":`", "6", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rt_", "=_", "self_", "._", "get", "\\u", "refre", "sh", "\\u", "token", "\\u", "grant_", "(_", "request_", ",_", "data_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "must", " ", "be", " ", "call", "ed", " ", "first", " ", "in", " ", "case", " ", "we", " ", "need", " ", "to", " ", "pur", "ge", " ", "expir", "ed", " ", "tokens_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "invalidate", "\\u", "refre", "sh", "\\u", "token_", "(_", "rt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "invalidate", "\\u", "access", "\\u", "token_", "(_", "rt_", "._", "access", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "at_", "=_", "self_", "._", "create", "\\u", "access", "\\u", "token_", "(_", "request_", ",_", "rt_", "._", "user_", ",_", "rt_", "._", "access", "\\u", "token_", "._", "scope_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rt_", "=_", "self_", "._", "create", "\\u", "refre", "sh", "\\u", "token_", "(_", "request_", ",_", "at_", "._", "user_", ",_", "at_", "._", "scope_", ",_", "at_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "access", "\\u", "token", "\\u", "response_", "(_", "at_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Access", "Token_", "(_", "OA", "uth", "View_", ",_", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "password_", "(_", "self_", ",_", "request_", ",_", "data_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Handle", " ", "``", "grant", "\\u", "type", "=", "password", "``", " ", "request", "s", " ", "as", " ", "defin", "ed", " ", "in", " ", ":", "rfc", ":`", "4.3", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "get", "\\u", "password", "\\u", "grant_", "(_", "request_", ",_", "data_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "data_", "._", "get_", "(_", "'", "user", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope_", "=_", "data_", "._", "get_", "(_", "'", "scope", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "constants_", "._", "SINGLE", "\\u", "ACCESS", "\\u", "TOKEN_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "at_", "=_", "self_", "._", "get", "\\u", "access", "\\u", "token_", "(_", "request_", ",_", "user_", ",_", "scope_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "at_", "=_", "self_", "._", "create", "\\u", "access", "\\u", "token_", "(_", "request_", ",_", "user_", ",_", "scope_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Public", " ", "clients", " ", "don", "'", "t", " ", "get", " ", "refre", "sh", " ", "tokens_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "client_", "._", "client", "\\u", "type_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rt_", "=_", "self_", "._", "create", "\\u", "refre", "sh", "\\u", "token_", "(_", "request_", ",_", "user_", ",_", "scope_", ",_", "at_", ",_", "client_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "access", "\\u", "token", "\\u", "response_", "(_", "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, 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, 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 ]
Unused import
lmorchard/badg.us/badgus/badger_api/tests/test_views.py
[ { "content": "import logging\nimport hashlib\nimport json\nfrom base64 import b64encode\n\nfrom django.conf import settings\n\nfrom django.http import HttpRequest\nfrom django.test.client import (Client, FakePayload, encode_multipart,\n BOUNDARY, CONTENT_TYPE_RE, MULTIPART_CONTENT)\n\nfrom django.contrib.auth.models import User\n\nfrom nose.tools import assert_equal, with_setup, assert_false, eq_, ok_\nfrom nose.plugins.attrib import attr\n\nfrom django.template.defaultfilters import slugify\n\ntry:\n from funfactory.urlresolvers import (get_url_prefix, Prefixer, reverse,\n set_url_prefix)\n from tower import activate\nexcept ImportError, e:\n from django.core.urlresolvers import reverse\n get_url_prefix = None\n\nfrom valet_keys.models import Key\n\nfrom badger.tests import BadgerTestCase\n\nfrom badger.models import (Badge, Award, Nomination, Progress, DeferredAward,\n NominationApproveNotAllowedException,\n NominationAcceptNotAllowedException,\n BadgeAwardNotAllowedException)\nfrom badger.utils import get_badge, award_badge\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BadgerApiViewsTests(BadgerTestCase):\n\n\n\n\n\n\n\n", "metadata": "root.BadgerApiViewsTests", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def setUp(self):\n self.client = Client()\n\n self.testuser = self._get_user()\n\n self.badge = Badge(creator=self.testuser, title=\"Test II\",\n description=\"Another test\", unique=True)\n self.badge.save()\n\n self.awards_url = reverse('badger.views.awards_list',\n args=(self.badge.slug,))\n \n key = Key()\n key.user = self.testuser\n self.password = key.generate_secret()\n self.username = key.key\n key.save()\n self.key = key\n\n auth_ct = '%s:%s' % (self.username, self.password)\n self.basic_auth = 'Basic %s' % b64encode(auth_ct)\n self.headers = {'HTTP_AUTHORIZATION': self.basic_auth}\n\n Award.objects.all().delete()", "metadata": "root.BadgerApiViewsTests.setUp", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 39 }, { "content": " def tearDown(self):\n self.key.delete()\n Award.objects.all().delete()\n Badge.objects.all().delete()", "metadata": "root.BadgerApiViewsTests.tearDown", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_forbidden_without_key(self):\n \"\"\"POST should require a valid key, or else yield a 403 response\"\"\"\n resp = self.client.get(self.awards_url)\n ok_(200, resp.status_code)\n\n resp = self.client.post(self.awards_url)\n ok_(403, resp.status_code)\n\n resp = self.client.post(self.awards_url, \n {'HTTP_AUTHORIZATION': 'Basic THISISINVALID'})\n ok_(403, resp.status_code)\n\n resp = self.client.post(self.awards_url, self.headers)\n ok_(200, resp.status_code)\n\n resp = self.client.get(self.awards_url, self.headers)\n ok_(200, resp.status_code)", "metadata": "root.BadgerApiViewsTests.test_forbidden_without_key", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 69 }, { "content": " def test_bad_data(self):\n \"\"\"Bad JSON request should result in a 400 response\"\"\"\n resp = self.client.post(self.awards_url, \"THISISBADDATA\",\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n ok_(400, resp.status_code)", "metadata": "root.BadgerApiViewsTests.test_bad_data", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 87 }, { "content": " def test_badge_award(self):\n \"\"\"Can award badges from API\"\"\"\n invite_email = '[email protected]'\n invalid_email = 'THISISINVALID'\n description = \"Is a hoopy frood.\"\n award_user = self._get_user(username=\"awardee1\",\n email=\"[email protected]\")\n\n # Construct the request data...\n data = dict(\n description = description,\n emails = [\n award_user.email,\n invite_email,\n invalid_email,\n ],\n )\n\n # POST to the awards URL\n resp = self.client.post(self.awards_url, json.dumps(data),\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n \n ok_(self.badge.is_awarded_to(award_user))\n award = Award.objects.get(user=award_user, badge=self.badge)\n eq_(description, award.description)\n\n eq_('application/json', resp['Content-Type'])\n data = json.loads(resp.content)\n\n ok_('successes' in data)\n ok_(award_user.email in data['successes'])\n eq_('AWARDED', data['successes'][award_user.email])\n ok_(invite_email in data['successes'])\n eq_('INVITED', data['successes'][invite_email])\n\n ok_('errors' in data)\n ok_(invalid_email in data['errors'])\n eq_('INVALID', data['errors'][invalid_email])", "metadata": "root.BadgerApiViewsTests.test_badge_award", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 94 }, { "content": " def test_no_description(self):\n \"\"\"Awards can be issued with no description\"\"\"\n award_user = self._get_user(username=\"awardee1\",\n email=\"[email protected]\")\n\n data = {\"emails\": [award_user.email]}\n\n resp = self.client.post(self.awards_url, json.dumps(data),\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n\n eq_('application/json', resp['Content-Type'])\n data = json.loads(resp.content)\n \n ok_(award_user.email in data['successes'])\n ok_(award_user.email not in data['errors'])\n ok_(self.badge.is_awarded_to(award_user))", "metadata": "root.BadgerApiViewsTests.test_no_description", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 134 }, { "content": " def test_already_awarded(self):\n \"\"\"Can award badges from API\"\"\"\n description = \"Is a hoopy frood.\"\n invite_email = '[email protected]'\n award_user = self._get_user(username=\"awardee1\",\n email=\"[email protected]\")\n\n award = self.badge.award_to(email=award_user.email)\n deferred_award = self.badge.award_to(email=invite_email)\n\n # Construct the request data...\n data = dict(\n description = description,\n emails = [\n invite_email,\n award_user.email,\n ],\n )\n\n # POST to the awards URL\n resp = self.client.post(self.awards_url, json.dumps(data),\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n \n eq_('application/json', resp['Content-Type'])\n data = json.loads(resp.content)\n\n print \"DATA %s\" % data\n\n ok_('errors' in data)\n ok_(award_user.email in data['errors'])\n eq_('ALREADYAWARDED', data['errors'][award_user.email])\n ok_(invite_email in data['errors'])\n eq_('ALREADYAWARDED', data['errors'][invite_email])", "metadata": "root.BadgerApiViewsTests.test_already_awarded", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": " def test_disallowed_badge_award(self):\n \"\"\"User should not be able to POST an award to a badge for which the\n user hasn't got permission to do so\"\"\"\n user = self._get_user(username=\"heyyou\",\n email=\"[email protected]\")\n badge = Badge(creator=user, title=\"Hey you badge\",\n description=\"Another test\", unique=True)\n badge.save()\n\n awards_url = reverse('badger.views.awards_list',\n args=(self.badge.slug,))\n\n data = dict(emails=['[email protected]',])\n\n resp = self.client.post(awards_url, json.dumps(data),\n content_type='application/json',\n HTTP_AUTHORIZATION=self.basic_auth)\n\n ok_(403, resp.status_code)", "metadata": "root.BadgerApiViewsTests.test_disallowed_badge_award", "header": "['class', 'BadgerApiViewsTests', '(', 'BadgerTestCase', ')', ':', '___EOS___']", "index": 187 } ]
[ { "span": "import logging", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 14 }, { "span": "import hashlib", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 14 }, { "span": "from django.conf import settings", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 32 }, { "span": "from django.http import HttpRequest", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 35 }, { "span": "from django.test.client import (Client, FakePayload, encode_multipart,\n BOUNDARY, CONTENT_TYPE_RE, MULTIPART_CONTENT)", "start_line": 8, "start_column": 0, "end_line": 9, "end_column": 77 }, { "span": "from django.contrib.auth.models import User", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 43 }, { "span": "from nose.tools import assert_equal, with_setup, assert_false, eq_, ok_", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 71 }, { "span": "from nose.plugins.attrib import attr", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 36 }, { "span": "from django.template.defaultfilters import slugify", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 50 }, { "span": "from funfactory.urlresolvers import (get_url_prefix, Prefixer, reverse,\n set_url_prefix)", "start_line": 19, "start_column": 4, "end_line": 20, "end_column": 56 }, { "span": "from tower import activate", "start_line": 21, "start_column": 4, "end_line": 21, "end_column": 30 }, { "span": "from badger.models import (Badge, Award, Nomination, Progress, DeferredAward,\n NominationApproveNotAllowedException,\n NominationAcceptNotAllowedException,\n BadgeAwardNotAllowedException)", "start_line": 30, "start_column": 0, "end_line": 33, "end_column": 38 }, { "span": "from badger.utils import get_badge, award_badge", "start_line": 34, "start_column": 0, "end_line": 34, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "base64_", "import_", "b64encode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "._", "client_", "import_", "(_", "Client_", ",_", "Fake", "Payload_", ",_", "encode", "\\u", "multipart_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "BOUND", "ARY", "_", ",_", "CONTE", "NT", "\\u", "TYPE", "\\u", "RE_", ",_", "MULTIP", "ART", "\\u", "CONTENT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "auth_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "assert", "\\u", "equal_", ",_", "with", "\\u", "setup_", ",_", "assert", "\\u", "false_", ",_", "eq\\u_", ",_", "ok\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "plugins_", "._", "attrib_", "import_", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "default", "filters_", "import_", "slugify_", "\\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_", "fun", "factory_", "._", "urlresolvers_", "import_", "(_", "get", "\\u", "url", "\\u", "prefix_", ",_", "Prefixe", "r_", ",_", "reverse_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "set\\u", "url", "\\u", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tower", "_", "import_", "activate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "core_", "._", "urlresolvers_", "import_", "reverse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "url", "\\u", "prefix_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "vale", "t", "\\u", "keys_", "._", "models_", "import_", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "badge", "r_", "._", "tests_", "import_", "Badge", "r", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "badge", "r_", "._", "models_", "import_", "(_", "Badge", "_", ",_", "Award", "_", ",_", "Nomi", "nation_", ",_", "Progress_", ",_", "Defe", "rre", "d", "Award", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Nomi", "nati", "on", "Appro", "ve", "Not", "All", "owe", "d", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Nomi", "nati", "on", "Accept", "Not", "All", "owe", "d", "Exception_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Badge", "Award", "Not", "All", "owe", "d", "Exception_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "badge", "r_", "._", "utils_", "import_", "get", "\\u", "badge", "_", ",_", "award", "\\u", "badge", "_", "\\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_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "client_", "=_", "Client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "testu", "ser_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "badge", "_", "=_", "Badge", "_", "(_", "creator_", "=_", "self_", "._", "testu", "ser_", ",_", "title_", "=_", "\"", "Test", " ", "II", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Ano", "ther", " ", "test", "\"_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "badge", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "awards", "\\u", "url_", "=_", "reverse_", "(_", "'", "badge", "r", ".", "views", ".", "awards", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "(_", "self_", "._", "badge", "_", "._", "slug_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "Key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "user_", "=_", "self_", "._", "testu", "ser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "password_", "=_", "key_", "._", "generat", "e\\u", "secret_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "username_", "=_", "key_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "key_", "=_", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "auth", "\\u", "ct_", "=_", "'%", "s", ":", "%", "s", "'_", "%_", "(_", "self_", "._", "username_", ",_", "self_", "._", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "basic", "\\u", "auth_", "=_", "'", "Basic", " ", "%", "s", "'_", "%_", "b64encode_", "(_", "auth", "\\u", "ct_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "headers_", "=_", "{_", "'", "HTTP", "\\u", "AUTHORIZATION", "'_", ":_", "self_", "._", "basic", "\\u", "auth_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Award", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "Down_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "key_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Award", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Badge", "_", "._", "objects_", "._", "all_", "(_", ")_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "forbidden", "\\u", "with", "out", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "POST", " ", "shou", "ld", " ", "require", " ", "a", " ", "valid", " ", "key", ",", " ", "or", " ", "else", " ", "yield", " ", "a", " ", "403", " ", "response", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "awards", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "403_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "HTTP", "\\u", "AUTHORIZATION", "'_", ":_", "'", "Basic", " ", "THIS", "ISI", "NV", "ALI", "D", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "403_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "self_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "get_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "self_", "._", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "200_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bad", "\\u", "data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ba", "d", " ", "JSO", "N", " ", "request", " ", "shou", "ld", " ", "result", " ", "in", " ", "a", " ", "400", " ", "response", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "\"", "THIS", "ISB", "ADD", "ATA", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "self_", "._", "basic", "\\u", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "400_", ",_", "resp_", "._", "status", "\\u", "code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "badge", "\\u", "award", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Can", " ", "award", " ", "badge", "s", " ", "from", " ", "API", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invite", "\\u", "email_", "=_", "'", "some", "guy", "@", "example", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invalid", "\\u", "email_", "=_", "'", "THIS", "ISI", "NV", "ALI", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\"", "Is", " ", "a", " ", "hoo", "py", " ", "fro", "od", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "award", "\\u", "user_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", "username_", "=_", "\"", "award", "ee", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "award", "ee", "1", "@", "example", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "the", " ", "request", " ", "data", "..._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "emails_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "award", "\\u", "user_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "invite", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "invalid", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POST", " ", "to", " ", "the", " ", "awards", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "json_", "._", "dumps_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "self_", "._", "basic", "\\u", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "self_", "._", "badge", "_", "._", "is", "\\u", "award", "ed", "\\u", "to_", "(_", "award", "\\u", "user_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "award", "_", "=_", "Award", "_", "._", "objects_", "._", "get_", "(_", "user_", "=_", "award", "\\u", "user_", ",_", "badge", "_", "=_", "self_", "._", "badge", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "description_", ",_", "award", "_", "._", "description_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "'", "applica", "tion", "/", "json", "'_", ",_", "resp_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "'", "successes", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "award", "\\u", "user_", "._", "email_", "in_", "data_", "[_", "'", "successes", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "AWA", "RD", "ED", "'_", ",_", "data_", "[_", "'", "successes", "'_", "]_", "[_", "award", "\\u", "user_", "._", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "invite", "\\u", "email_", "in_", "data_", "[_", "'", "successes", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "INVI", "TED", "'_", ",_", "data_", "[_", "'", "successes", "'_", "]_", "[_", "invite", "\\u", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "'", "error", "s", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "invalid", "\\u", "email_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "INVALID", "'_", ",_", "data_", "[_", "'", "error", "s", "'_", "]_", "[_", "invalid", "\\u", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "description_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Award", "s", " ", "can", " ", "be", " ", "issue", "d", " ", "with", " ", "no", " ", "description", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "award", "\\u", "user_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", "username_", "=_", "\"", "award", "ee", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "award", "ee", "1", "@", "example", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "\"", "email", "s", "\"_", ":_", "[_", "award", "\\u", "user_", "._", "email_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "json_", "._", "dumps_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "self_", "._", "basic", "\\u", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "'", "applica", "tion", "/", "json", "'_", ",_", "resp_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "award", "\\u", "user_", "._", "email_", "in_", "data_", "[_", "'", "successes", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "award", "\\u", "user_", "._", "email_", "not_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "self_", "._", "badge", "_", "._", "is", "\\u", "award", "ed", "\\u", "to_", "(_", "award", "\\u", "user_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "alr", "ead", "y", "\\u", "award", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Can", " ", "award", " ", "badge", "s", " ", "from", " ", "API", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "description_", "=_", "\"", "Is", " ", "a", " ", "hoo", "py", " ", "fro", "od", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "invite", "\\u", "email_", "=_", "'", "some", "guy", "@", "example", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "award", "\\u", "user_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", "username_", "=_", "\"", "award", "ee", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "award", "ee", "1", "@", "example", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "award", "_", "=_", "self_", "._", "badge", "_", "._", "award", "\\u", "to_", "(_", "email_", "=_", "award", "\\u", "user_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "red", "\\u", "award", "_", "=_", "self_", "._", "badge", "_", "._", "award", "\\u", "to_", "(_", "email_", "=_", "invite", "\\u", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "the", " ", "request", " ", "data", "..._", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "description_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "emails_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "invite", "\\u", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "award", "\\u", "user_", "._", "email_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POST", " ", "to", " ", "the", " ", "awards", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "self_", "._", "awards", "\\u", "url_", ",_", "json_", "._", "dumps_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=_", "'", "applica", "tion", "/", "json", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "HTTP", "\\u", "AUTHORIZATION", "_", "=_", "self_", "._", "basic", "\\u", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "'", "applica", "tion", "/", "json", "'_", ",_", "resp_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "json_", "._", "loads_", "(_", "resp_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "DATA", " ", "%", "s", "\"_", "%_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ok\\u_", "(_", "'", "error", "s", "'_", "in_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "award", "\\u", "user_", "._", "email_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "ALREADY", "AWA", "RD", "ED", "'_", ",_", "data_", "[_", "'", "error", "s", "'_", "]_", "[_", "award", "\\u", "user_", "._", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ok\\u_", "(_", "invite", "\\u", "email_", "in_", "data_", "[_", "'", "error", "s", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "'", "ALREADY", "AWA", "RD", "ED", "'_", ",_", "data_", "[_", "'", "error", "s", "'_", "]_", "[_", "invite", "\\u", "email_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Badge", "r", "Ap", "i", "View", "s", "Tests_", "(_", "Badge", "r", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "disallow", "ed", "\\u", "badge", "\\u", "award", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "User", " ", "shou", "ld", " ", "not", " ", "be", " ", "able", " ", "to", " ", "POST", " ", "an", " ", "award", " ", "to", " ", "a", " ", "badge", " ", "for", " ", "whi", "ch", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "user", " ", "hasn", "'", "t", " ", "got", " ", "permissi", "on", " ", "to", " ", "do", " ", "so", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "=_", "self_", "._", "\\u", "get", "\\u", "user_", "(_", "username_", "=_", "\"", "hey", "you", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "\"", "hey", "you", "@", "example", ".", "com", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "badge", "_", "=_", "Badge", "_", "(_", "creator_", "=_", "user_", ",_", "title_", "=_", "\"", "He", "y", " ", "you", " ", "badge", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "description_", "=_", "\"", "Ano", "ther", " ", "test", "\"_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "badge", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "awards", "\\u", "url_", "=_", "reverse_", "(_", "'", "badge", "r", ".", "views", ".", "awards", "\\u", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "(_", "self_", "._", "badge", "_", "._", "slug_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "dict_", "(_", "emails_", "=_", "[_", "'", "some", "guy", "@", "example", ".", "com", "'_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resp_", "=_", "self_", "._", "client_", "._", "post_", "(_", "awards", "\\u", "url_", ",_", "json_", "._", "dumps_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "content", "\\u", "type_", "=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networkx/networkx/algorithms/approximation/tests/test_kcomponents.py
[ { "content": " def test_degree(self):\n for G, A in self.GA:\n assert_equal(G.degree(), A.degree())", "metadata": "root.TestAntiGraph.test_degree", "header": "['class', 'TestAntiGraph', ':', '___EOS___']", "index": 211 }, { "content": " def test_degree(self):\n for G, A in self.GA:\n node = list(G.nodes())[0]\n nodes = list(G.nodes())[1:4]\n assert_equal(G.degree(node), A.degree(node))\n assert_equal(sum(d for n, d in G.degree()), sum(d for n, d in A.degree()))\n # AntiGraph is a ThinGraph, so all the weights are 1\n assert_equal(sum(d for n, d in A.degree()),\n sum(d for n, d in A.degree(weight='weight')))\n assert_equal(sum(d for n, d in G.degree(nodes)),\n sum(d for n, d in A.degree(nodes)))", "metadata": "root.TestAntiGraph.test_degree", "header": "['class', 'TestAntiGraph', ':', '___EOS___']", "index": 243 } ]
[ { "span": "test_degree(", "start_line": 211, "start_column": 8, "end_line": 211, "end_column": 19 } ]
[ { "span": "test_degree(", "start_line": 243, "start_column": 8, "end_line": 243, "end_column": 19 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Test", "Anti", "Graph_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "degree_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "G_", ",_", "A_", "in_", "self_", "._", "GA", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equal_", "(_", "G_", "._", "degree_", "(_", ")_", ",_", "A_", "._", "degree_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Anti", "Graph_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "degree_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "G_", ",_", "A_", "in_", "self_", "._", "GA", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "list_", "(_", "G_", "._", "nodes_", "(_", ")_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nodes_", "=_", "list_", "(_", "G_", "._", "nodes_", "(_", ")_", ")_", "[_", "1_", ":_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "G_", "._", "degree_", "(_", "node_", ")_", ",_", "A_", "._", "degree_", "(_", "node_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "G_", "._", "degree_", "(_", ")_", ")_", ",_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "A_", "._", "degree_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Anti", "Graph", " ", "is", " ", "a", " ", "Thin", "Graph", ",", " ", "so", " ", "all", " ", "the", " ", "weight", "s", " ", "are", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "A_", "._", "degree_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "A_", "._", "degree_", "(_", "weight_", "=_", "'", "weight", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "G_", "._", "degree_", "(_", "nodes_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sum_", "(_", "d_", "for_", "n_", ",_", "d_", "in_", "A_", "._", "degree_", "(_", "nodes_", ")_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
dask/dask/dask/diagnostics/tests/test_profiler.py
[ { "content": "def test_profiler_works_under_error():\n div = lambda x, y: x / y\n dsk = {'x': (div, 1, 1), 'y': (div, 'x', 2), 'z': (div, 'y', 0)}\n\n with ignoring(ZeroDivisionError):\n with prof:\n out = get(dsk, 'z')\n\n assert all(len(v) == 5 for v in prof.results)\n assert len(prof.results) == 2", "metadata": "root.test_profiler_works_under_error", "header": "['module', '___EOS___']", "index": 45 }, { "content": "@pytest.mark.skipif(\"not psutil\")\ndef test_resource_profiler():\n with ResourceProfiler(dt=0.01) as rprof:\n out = get(dsk2, 'c')\n results = rprof.results\n assert all(isinstance(i, tuple) and len(i) == 3 for i in results)\n\n rprof.clear()\n assert rprof.results == []\n\n rprof.close()\n assert not rprof._tracker.is_alive()\n\n with pytest.raises(AssertionError):\n with rprof:\n get(dsk, 'e')", "metadata": "root.test_resource_profiler", "header": "['module', '___EOS___']", "index": 76 }, { "content": "def test_cache_profiler():\n with CacheProfiler() as cprof:\n out = get(dsk2, 'c')\n results = cprof.results\n assert all(isinstance(i, tuple) and len(i) == 5 for i in results)\n\n cprof.clear()\n assert cprof.results == []\n\n tics = [0]\n def nbytes(res):\n tics[0] += 1\n return tics[0]\n\n with CacheProfiler(nbytes) as cprof:\n out = get(dsk2, 'c')\n results = cprof.results\n assert tics[-1] == len(results)\n assert tics[-1] == results[-1].metric\n assert cprof._metric_name == 'nbytes'\n assert CacheProfiler(metric=nbytes, metric_name='foo')._metric_name == 'foo'", "metadata": "root.test_cache_profiler", "header": "['module', '___EOS___']", "index": 94 } ]
[ { "span": "out ", "start_line": 51, "start_column": 12, "end_line": 51, "end_column": 15 }, { "span": "out ", "start_line": 79, "start_column": 8, "end_line": 79, "end_column": 11 }, { "span": "out ", "start_line": 109, "start_column": 8, "end_line": 109, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "profiler", "\\u", "works", "\\u", "under", "\\u", "error_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "div_", "=_", "lambda_", "x_", ",_", "y_", ":_", "x_", "/_", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ds", "k_", "=_", "{_", "'", "x", "'_", ":_", "(_", "div_", ",_", "1_", ",_", "1_", ")_", ",_", "'", "y", "'_", ":_", "(_", "div_", ",_", "'", "x", "'_", ",_", "2_", ")_", ",_", "'", "z", "'_", ":_", "(_", "div_", ",_", "'", "y", "'_", ",_", "0_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "ign", "orin", "g_", "(_", "Zero", "Divis", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "prof_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "get_", "(_", "ds", "k_", ",_", "'", "z", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "all_", "(_", "len_", "(_", "v_", ")_", "==_", "5_", "for_", "v_", "in_", "prof_", "._", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "prof_", "._", "results_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "pytest_", "._", "mark_", "._", "skipif_", "(_", "\"", "not", " ", "psu", "til", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "resource", "\\u", "profiler_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "Reso", "urc", "e", "Profiler", "_", "(_", "dt_", "=_", "0.01_", ")_", "as_", "rpr", "of_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "get_", "(_", "ds", "k2_", ",_", "'", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "rpr", "of_", "._", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "all_", "(_", "isinstance_", "(_", "i_", ",_", "tuple_", ")_", "and_", "len_", "(_", "i_", ")_", "==_", "3_", "for_", "i_", "in_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rpr", "of_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rpr", "of_", "._", "results_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rpr", "of_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "rpr", "of_", "._", "\\u", "tracker_", "._", "is", "\\u", "alive_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Assert", "ion", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "rpr", "of_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "get_", "(_", "ds", "k_", ",_", "'", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "\\u", "profiler_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "Cache", "Profiler", "_", "(_", ")_", "as_", "cpro", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "get_", "(_", "ds", "k2_", ",_", "'", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "cpro", "f_", "._", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "all_", "(_", "isinstance_", "(_", "i_", ",_", "tuple_", ")_", "and_", "len_", "(_", "i_", ")_", "==_", "5_", "for_", "i_", "in_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cpro", "f_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "cpro", "f_", "._", "results_", "==_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tic", "s_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "nbytes_", "(_", "res_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tic", "s_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tic", "s_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "Cache", "Profiler", "_", "(_", "nbytes_", ")_", "as_", "cpro", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "get_", "(_", "ds", "k2_", ",_", "'", "c", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "cpro", "f_", "._", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tic", "s_", "[_", "-_", "1_", "]_", "==_", "len_", "(_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tic", "s_", "[_", "-_", "1_", "]_", "==_", "results_", "[_", "-_", "1_", "]_", "._", "metric_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "cpro", "f_", "._", "\\u", "metric", "\\u", "name_", "==_", "'", "nb", "ytes", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "Cache", "Profiler", "_", "(_", "metric_", "=_", "nbytes_", ",_", "metric", "\\u", "name_", "=_", "'", "foo", "'_", ")_", "._", "\\u", "metric", "\\u", "name_", "==_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
neuropoly/spinalcordtoolbox/dev/spinal_level/sct_extract_spinal_levels.py
[ { "content": "#!/usr/bin/env python\n#########################################################################################\n# \n# Extract spinal levels\n#\n#\n# ---------------------------------------------------------------------------------------\n# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>\n# Author: Karun Raju, Julien Touati\n# Modified: 2014-06-02\n#\n# About the license: see the file LICENSE.TXT\n#########################################################################################\n\n\n# check if needed Python libraries are already installed or not\nimport os\nimport getopt\nimport commands\nimport sys\nimport matplotlib.pyplot as plt\ntry:\n import nibabel\nexcept ImportError:\n print '--- nibabel not installed! Exit program. ---'\n sys.exit(2)\ntry:\n import numpy as np\nexcept ImportError:\n print '--- numpy not installed! Exit program. ---'\n sys.exit(2)\n\n#=======================================================================================================================\n# main\n#=======================================================================================================================\n\n\n#==================================================================================\n\n#==================================================================================\n\n#=======================================================================================================================\n# Start program\n#=======================================================================================================================\nif __name__ == \"__main__\":\n # call main function\n main()", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main():\n\n # get path of the toolbox\n status, path_sct = commands.getstatusoutput('echo $SCT_DIR')\n \n #loading files \n fname_template_vertebral_level = path_sct+'/data/template/MNI-Poly-AMU_level.nii.gz'\n fname_template_vertebral_cord = path_sct+'/data/template/MNI-Poly-AMU_cord.nii.gz'\n \n vertebral_level_file = nibabel.load(fname_template_vertebral_level)\n vertebral_cord_file = nibabel.load(fname_template_vertebral_cord)\n \n vertebral_level_image = vertebral_level_file.get_data()\n vertebral_cord_image = vertebral_cord_file.get_data()\n \n hdr_vertebral_level=vertebral_level_file.get_header()\n hdr_vertebral_cord=vertebral_cord_file.get_header()\n \n z_size_vertebral_level=hdr_vertebral_level['pixdim'][3]\n z_size_vertebral_cord=hdr_vertebral_cord['pixdim'][3]\n \n #finding the centers of the vertebral levels\n vertebral_levels = find_mid_point_vertebral_level(vertebral_level_image) \n \n # Mean and Variance of Vertebral centers (Data from the graph)\n vertebral_Mu = np.zeros(len(vertebral_levels))\n vertebral_Sigma = np.zeros(len(vertebral_levels))\n\n vertebral_Mu[0], vertebral_Sigma[0] = 0, 0\n vertebral_Mu[1], vertebral_Sigma[1] = 0, 0\n vertebral_Mu[2], vertebral_Sigma[2] = 69.99, 4.58\n vertebral_Mu[3], vertebral_Sigma[3] = 86.11, 5.35\n vertebral_Mu[4], vertebral_Sigma[4] = 101.16, 6.33\n vertebral_Mu[5], vertebral_Sigma[5] = 115.54, 7.15\n vertebral_Mu[6], vertebral_Sigma[6] = 130.08, 8.25 \n vertebral_Mu[7], vertebral_Sigma[7] = 0, 0\n vertebral_Mu[8], vertebral_Sigma[8] = 0, 0\n vertebral_Mu[9], vertebral_Sigma[9] = 0, 0\n vertebral_Mu[10], vertebral_Sigma[10] = 0, 0\n vertebral_Mu[11], vertebral_Sigma[11] = 0, 0\n vertebral_Mu[12], vertebral_Sigma[12] = 0, 0\n\n # Mean and Variance of Spinal centers (Data from the graph)\n spinal_Mu = np.zeros(len(vertebral_levels))\n spinal_Sigma = np.zeros(len(vertebral_levels))\n \n spinal_Mu[0], spinal_Sigma[0] = 0, 0\n spinal_Mu[1], spinal_Sigma[1] = 0, 0\n spinal_Mu[2], spinal_Sigma[2] = 51.46, 3.15\n spinal_Mu[3], spinal_Sigma[3] = 65.68, 3.96\n spinal_Mu[4], spinal_Sigma[4] = 81.08, 5.15\n spinal_Mu[5], spinal_Sigma[5] = 95.39, 5.68\n spinal_Mu[6], spinal_Sigma[6] = 109.33, 6.05\n spinal_Mu[7], spinal_Sigma[7] = 122.77, 7.03\n spinal_Mu[8], spinal_Sigma[8] = 0, 0\n spinal_Mu[9], spinal_Sigma[9] = 0, 0\n spinal_Mu[10], spinal_Sigma[10] = 0, 0\n spinal_Mu[11], spinal_Sigma[11] = 0, 0\n spinal_Mu[12], spinal_Sigma[12] = 0, 0\n \n #==================================================================================\n #Extrapolating unknown Means and Variances from the given data\n \n #Finding the distance between the known Spinal centers and Vertebral centers from the given data\n spinal_vertebral_dist=np.zeros(5)\n for i in range(5):\n spinal_vertebral_dist[i]=(vertebral_Mu[i+2] - spinal_Mu[i+2])\n \n #Linear fit of the distances between Vertebral and Spinal centers\n popt_spinal_vertebral = np.polyfit(np.arange(3,8),spinal_vertebral_dist,1)\n P_fit_spinal_vertebral_dist = np.poly1d(popt_spinal_vertebral)\n \n plt.plot(np.arange(0,15),P_fit_spinal_vertebral_dist(np.arange(0,15)),marker='+')\n plt.plot(np.arange(3,8),spinal_vertebral_dist,marker='o',linestyle='None')\n plt.title('Spinal-Vertebral distances')\n plt.show()\n\n conversion_factor=np.zeros(4)\n for i in range(2,6,1):\n conversion_factor[i-2]=(vertebral_levels[i]-vertebral_levels[i+1])/(vertebral_Mu[i+1]-vertebral_Mu[i])\n average_conversion_factor=np.mean(conversion_factor)\n\n delta_vertebral_levels = np.zeros(len(vertebral_levels)-1)\n for i in range(len(vertebral_levels)-1):\n delta_vertebral_levels[i] = (vertebral_levels[i] - vertebral_levels[i+1])/average_conversion_factor\n\n vertebral_Mu[0] = vertebral_Mu[1] - delta_vertebral_levels[0]\n vertebral_Mu[1] = vertebral_Mu[2] - delta_vertebral_levels[1]\n vertebral_Mu[7] = vertebral_Mu[6] + delta_vertebral_levels[6]\n vertebral_Mu[8] = vertebral_Mu[7] + delta_vertebral_levels[7]\n vertebral_Mu[9] = vertebral_Mu[8] + delta_vertebral_levels[8]\n vertebral_Mu[10] = vertebral_Mu[9] + delta_vertebral_levels[9]\n vertebral_Mu[11] = vertebral_Mu[10] + delta_vertebral_levels[10]\n vertebral_Mu[12] = vertebral_Mu[11] + delta_vertebral_levels[11]\n\n spinal_Mu[0] = vertebral_Mu[0] - P_fit_spinal_vertebral_dist(1)\n spinal_Mu[1] = vertebral_Mu[1] - P_fit_spinal_vertebral_dist(2)\n spinal_Mu[8] = vertebral_Mu[8] - P_fit_spinal_vertebral_dist(9)\n spinal_Mu[9] = vertebral_Mu[9] - P_fit_spinal_vertebral_dist(10)\n spinal_Mu[10] = vertebral_Mu[10] - P_fit_spinal_vertebral_dist(11)\n spinal_Mu[11] = vertebral_Mu[11] - P_fit_spinal_vertebral_dist(12)\n spinal_Mu[12] = vertebral_Mu[12] - P_fit_spinal_vertebral_dist(13)\n\n #Linear Fit of the known Vertebral variances to find the unkown variances\n popt_vertebral_sigma = np.polyfit(np.arange(3,8),vertebral_Sigma[2:7],1)\n P_fit_vertebral_sigma = np.poly1d(popt_vertebral_sigma)\n plt.plot(np.arange(0,14),P_fit_vertebral_sigma(np.arange(0,14)),marker='+')\n plt.title('Vertebral_sigma')\n plt.plot(np.arange(3,8),vertebral_Sigma[2:7],marker='o',linestyle='None')\n plt.show()\n\n #Linear Fit of the known Spinal variances to find the unknown variances\n popt_spinal_sigma = np.polyfit(np.arange(3,9),spinal_Sigma[2:8],1)\n P_fit_spinal_sigma = np.poly1d(popt_spinal_sigma)\n plt.plot(np.arange(0,14),P_fit_spinal_sigma(np.arange(0,14)),marker='+')\n plt.title('Spinal_sigma')\n plt.plot(np.arange(3,9),spinal_Sigma[2:8],marker='o',linestyle='None')\n plt.show()\n\n vertebral_Sigma[1]=P_fit_vertebral_sigma(0)\n vertebral_Sigma[0]=P_fit_vertebral_sigma(1)\n vertebral_Sigma[7]=P_fit_vertebral_sigma(8)\n vertebral_Sigma[8]=P_fit_vertebral_sigma(9)\n vertebral_Sigma[9]=P_fit_vertebral_sigma(10)\n vertebral_Sigma[10]=P_fit_vertebral_sigma(11)\n vertebral_Sigma[11]=P_fit_vertebral_sigma(12)\n vertebral_Sigma[12]=P_fit_vertebral_sigma(13)\n\n spinal_Sigma[1]=P_fit_spinal_sigma(2)\n spinal_Sigma[0]=P_fit_spinal_sigma(1)\n spinal_Sigma[8]=P_fit_spinal_sigma(9)\n spinal_Sigma[9]=P_fit_spinal_sigma(10)\n spinal_Sigma[10]=P_fit_spinal_sigma(11)\n spinal_Sigma[11]=P_fit_spinal_sigma(12)\n spinal_Sigma[12]=P_fit_spinal_sigma(13)\n\n for i in range(len(vertebral_levels)):\n y = gaussian(np.arange(0,500,0.1),spinal_Mu[i],spinal_Sigma[i])\n plt.plot(np.arange(0,500,0.1),y)\n plt.title('Mean Distance from the PMJ to the centre of each Nerve Rootlet Segment')\n plt.show()\n\n #Finding the distance between the Spinal and Vertebral centers in the image\n spinal_vertebral_distances=np.zeros(len(vertebral_levels))\n for i in range(len(vertebral_levels)):\n spinal_vertebral_distances[i]=round((vertebral_Mu[i] - spinal_Mu[i])*average_conversion_factor)\n\n spinal_levels = np.zeros(len(vertebral_levels))\n for i in range(len(vertebral_levels)):\n spinal_levels[i] = int(vertebral_levels[i] + spinal_vertebral_distances[i])\n\n #Creating Templates for each Spinal level\n k = 0\n X,Y,Z = np.where(vertebral_cord_image>0)\n for i in spinal_levels[:]:\n template_spinal_image = vertebral_cord_image.copy()\n count = 0\n \n for j in range(np.amax(Z),np.amin(Z)-1,-1):\n x,y = np.where(vertebral_cord_image[:,:,j]>0)\n diff = (i - j)/average_conversion_factor\n value = gaussian((spinal_Mu[k]+diff),spinal_Mu[k],spinal_Sigma[k])\n template_spinal_image[x,y,j] = value\n k = k+1\n\n # Write NIFTI volumes\n hdr_vertebral_cord.set_data_dtype('uint8') # set imagetype to uint8\n print '\\nWrite NIFTI volumes...'\n img = nibabel.Nifti1Image(template_spinal_image, None, hdr_vertebral_cord)\n if k<=8:\n file_name = 'spinal_level_C'+str(k)+'.nii.gz'\n else:\n file_name = 'spinal_level_T'+str(k-8)+'.nii.gz'\n nibabel.save(img,file_name)\n print '.. File created:' + file_name ", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def find_mid_point_vertebral_level(data):\n\n vertebral_levels = np.zeros(int(np.amax(data)))\n for i in range((int(np.amin(data))+1),(int(np.amax(data))+1)):\n \n #finding the co-ordinates of voxels in each level \n x,y,z = np.where(data==i)\n z = np.sort(z)\n vertebral_levels[i-1] = np.amin(z) + round((np.amax(z)-np.amin(z))/2)\n return vertebral_levels", "metadata": "root.find_mid_point_vertebral_level", "header": "['module', '___EOS___']", "index": 213 }, { "content": "def gaussian(x, mu, sig):\n return (np.exp(-((x - mu)*(x - mu))/(2*sig*sig)))/(np.sqrt(2*(np.pi)*sig*sig))", "metadata": "root.gaussian", "header": "['module', '___EOS___']", "index": 225 } ]
[ { "span": "import os", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 9 }, { "span": "import getopt", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Extract", " ", "spin", "al", " ", "levels_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--------------", "--------------", "--------------", "--------------", "--------------", "--------------", "---", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2014", " ", "Poly", "technique", " ", "Mont", "real", " ", "<", "www", ".", "neuro", ".", "poly", "mt", "l", ".", "ca", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Kar", "un", " ", "Ra", "ju", ",", " ", "Juli", "en", " ", "Tou", "ati", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modifie", "d", ":", " ", "2014", "-0", "6", "-0", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Abo", "ut", " ", "the", " ", "license", ":", " ", "see", " ", "the", " ", "file", " ", "LICENSE", ".", "TXT", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "need", "ed", " ", "Pyth", "on", " ", "librar", "ies", " ", "are", " ", "alr", "ead", "y", " ", "install", "ed", " ", "or", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "commands_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "nib", "abel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'---", " ", "nib", "abel", " ", "not", " ", "install", "ed", "!", " ", "Exi", "t", " ", "program", ".", " ", "---", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "'---", " ", "nump", "y", " ", "not", " ", "install", "ed", "!", " ", "Exi", "t", " ", "program", ".", " ", "---", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "main_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "============", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "============", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Start", " ", "program_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "==============", "=======", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "call", " ", "main", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "path", " ", "of", " ", "the", " ", "toolbox_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", ",_", "path", "\\u", "sct", "_", "=_", "commands_", "._", "getstatus", "output_", "(_", "'", "echo", " ", "$", "SC", "T", "\\u", "DIR", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "load", "ing", " ", "files", " _", "\\u\\u\\uNL\\u\\u\\u_", "fname", "\\u", "template", "\\u", "vert", "ebra", "l\\u", "level_", "=_", "path", "\\u", "sct", "_", "+_", "'/", "data", "/", "template", "/", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "level", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fname", "\\u", "template", "\\u", "vert", "ebra", "l\\u", "cord", "_", "=_", "path", "\\u", "sct", "_", "+_", "'/", "data", "/", "template", "/", "MN", "I", "-", "Poly", "-", "AM", "U", "\\u", "cord", ".", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "level", "\\u", "file_", "=_", "nib", "abel_", "._", "load_", "(_", "fname", "\\u", "template", "\\u", "vert", "ebra", "l\\u", "level_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "cord", "\\u", "file_", "=_", "nib", "abel_", "._", "load_", "(_", "fname", "\\u", "template", "\\u", "vert", "ebra", "l\\u", "cord", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "level", "\\u", "image_", "=_", "vert", "ebra", "l\\u", "level", "\\u", "file_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "cord", "\\u", "image_", "=_", "vert", "ebra", "l\\u", "cord", "\\u", "file_", "._", "get", "\\u", "data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hdr", "\\u", "vert", "ebra", "l\\u", "level_", "=_", "vert", "ebra", "l\\u", "level", "\\u", "file_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hdr", "\\u", "vert", "ebra", "l\\u", "cord", "_", "=_", "vert", "ebra", "l\\u", "cord", "\\u", "file_", "._", "get", "\\u", "header_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z", "\\u", "size", "\\u", "vert", "ebra", "l\\u", "level_", "=_", "hdr", "\\u", "vert", "ebra", "l\\u", "level_", "[_", "'", "pix", "dim", "'_", "]_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z", "\\u", "size", "\\u", "vert", "ebra", "l\\u", "cord", "_", "=_", "hdr", "\\u", "vert", "ebra", "l\\u", "cord", "_", "[_", "'", "pix", "dim", "'_", "]_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "finding", " ", "the", " ", "center", "s", " ", "of", " ", "the", " ", "vert", "ebra", "l", " ", "levels_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "levels_", "=_", "find", "\\u", "mid", "\\u", "point", "\\u", "vert", "ebra", "l\\u", "level_", "(_", "vert", "ebra", "l\\u", "level", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mea", "n", " ", "and", " ", "Variance", " ", "of", " ", "Vert", "ebra", "l", " ", "center", "s", " ", "(", "Data", " ", "from", " ", "the", " ", "graph", ")_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "0_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "0_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "1_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "1_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "2_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "2_", "]_", "=_", "69.", "99_", ",_", "4.5", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "3_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "3_", "]_", "=_", "86", ".1", "1_", ",_", "5.3", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "4_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "4_", "]_", "=_", "101.", "16_", ",_", "6.3", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "5_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "5_", "]_", "=_", "115", ".5", "4_", ",_", "7.1", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "6_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "6_", "]_", "=_", "130", ".0", "8_", ",_", "8.2", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "7_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "7_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "8_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "8_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "9_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "9_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "10_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "10_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "11_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "11_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "12_", "]_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "12_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mea", "n", " ", "and", " ", "Variance", " ", "of", " ", "Spin", "al", " ", "center", "s", " ", "(", "Data", " ", "from", " ", "the", " ", "graph", ")_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "0_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "0_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "1_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "1_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "2_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "2_", "]_", "=_", "51.", "46_", ",_", "3.1", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "3_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "3_", "]_", "=_", "65.", "68_", ",_", "3.9", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "4_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "4_", "]_", "=_", "81.", "08_", ",_", "5.1", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "5_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "5_", "]_", "=_", "95.", "39_", ",_", "5.6", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "6_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "6_", "]_", "=_", "109", ".3", "3_", ",_", "6.0", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "7_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "7_", "]_", "=_", "122.", "77_", ",_", "7.0", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "8_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "8_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "9_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "9_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "10_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "10_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "11_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "11_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "12_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "12_", "]_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "============", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Extra", "pol", "ati", "ng", " ", "unknown", " ", "Means", " ", "and", " ", "Variance", "s", " ", "from", " ", "the", " ", "give", "n", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Finding", " ", "the", " ", "distance", " ", "bet", "ween", " ", "the", " ", "know", "n", " ", "Spin", "al", " ", "center", "s", " ", "and", " ", "Vert", "ebra", "l", " ", "center", "s", " ", "from", " ", "the", " ", "give", "n", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "=_", "np_", "._", "zeros_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "[_", "i_", "]_", "=_", "(_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "i_", "+_", "2_", "]_", "-_", "spin", "al", "\\u", "Mu", "_", "[_", "i_", "+_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Linea", "r", " ", "fit", " ", "of", " ", "the", " ", "distance", "s", " ", "bet", "ween", " ", "Vert", "ebra", "l", " ", "and", " ", "Spin", "al", " ", "centers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "popt", "\\u", "spin", "al", "\\u", "vert", "ebra", "l_", "=_", "np_", "._", "polyf", "it_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "8_", ")_", ",_", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "=_", "np_", "._", "poly", "1d_", "(_", "popt", "\\u", "spin", "al", "\\u", "vert", "ebra", "l_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "15_", ")_", ",_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "15_", ")_", ")_", ",_", "marker_", "=_", "'+'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "8_", ")_", ",_", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", ",_", "marker_", "=_", "'", "o", "'_", ",_", "linestyle_", "=_", "'", "Non", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Spin", "al", "-", "Vert", "ebra", "l", " ", "distance", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "conve", "rsi", "on", "\\u", "factor_", "=_", "np_", "._", "zeros_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "2_", ",_", "6_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conve", "rsi", "on", "\\u", "factor_", "[_", "i_", "-_", "2_", "]_", "=_", "(_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "]_", "-_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "+_", "1_", "]_", ")_", "/_", "(_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "i_", "+_", "1_", "]_", "-_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "averag", "e\\u", "conve", "rsi", "on", "\\u", "factor_", "=_", "np_", "._", "mean_", "(_", "conve", "rsi", "on", "\\u", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "]_", "=_", "(_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "]_", "-_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "+_", "1_", "]_", ")_", "/_", "averag", "e\\u", "conve", "rsi", "on", "\\u", "factor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "0_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "1_", "]_", "-_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "1_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "2_", "]_", "-_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "7_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "6_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "6_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "8_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "7_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "7_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "9_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "8_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "8_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "10_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "9_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "11_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "10_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "10_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "12_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "11_", "]_", "+_", "delta", "\\u", "vert", "ebra", "l\\u", "levels_", "[_", "11_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "0_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "0_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "1_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "1_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "8_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "8_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "9_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "9_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "10_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "10_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "11_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "11_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Mu", "_", "[_", "12_", "]_", "=_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "12_", "]_", "-_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "vert", "ebra", "l\\u", "dist_", "(_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Linea", "r", " ", "Fit", " ", "of", " ", "the", " ", "know", "n", " ", "Vert", "ebra", "l", " ", "varian", "ces", " ", "to", " ", "find", " ", "the", " ", "unk", "own", " ", "varian", "ces_", "\\u\\u\\uNL\\u\\u\\u_", "popt", "\\u", "vert", "ebra", "l\\u", "sigma_", "=_", "np_", "._", "polyf", "it_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "8_", ")_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "2_", ":_", "7_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "=_", "np_", "._", "poly", "1d_", "(_", "popt", "\\u", "vert", "ebra", "l\\u", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "14_", ")_", ",_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "14_", ")_", ")_", ",_", "marker_", "=_", "'+'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Vert", "ebra", "l\\u", "sigma", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "8_", ")_", ",_", "vert", "ebra", "l\\u", "Sigma_", "[_", "2_", ":_", "7_", "]_", ",_", "marker_", "=_", "'", "o", "'_", ",_", "linestyle_", "=_", "'", "Non", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Linea", "r", " ", "Fit", " ", "of", " ", "the", " ", "know", "n", " ", "Spin", "al", " ", "varian", "ces", " ", "to", " ", "find", " ", "the", " ", "unknown", " ", "varian", "ces_", "\\u\\u\\uNL\\u\\u\\u_", "popt", "\\u", "spin", "al", "\\u", "sigma_", "=_", "np_", "._", "polyf", "it_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "9_", ")_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "2_", ":_", "8_", "]_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "=_", "np_", "._", "poly", "1d_", "(_", "popt", "\\u", "spin", "al", "\\u", "sigma_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "14_", ")_", ",_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "14_", ")_", ")_", ",_", "marker_", "=_", "'+'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Spin", "al", "\\u", "sigma", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "3_", ",_", "9_", ")_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "2_", ":_", "8_", "]_", ",_", "marker_", "=_", "'", "o", "'_", ",_", "linestyle_", "=_", "'", "Non", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "1_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "0_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "7_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "8_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "9_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "10_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "11_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "Sigma_", "[_", "12_", "]_", "=_", "P", "\\u", "fit", "\\u", "vert", "ebra", "l\\u", "sigma_", "(_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "1_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "0_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "8_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "9_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "10_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "11_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "12_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spin", "al", "\\u", "Sigma_", "[_", "12_", "]_", "=_", "P", "\\u", "fit", "\\u", "spin", "al", "\\u", "sigma_", "(_", "13_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "=_", "gaussian_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "500_", ",_", "0.1_", ")_", ",_", "spin", "al", "\\u", "Mu", "_", "[_", "i_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "np_", "._", "arange_", "(_", "0_", ",_", "500_", ",_", "0.1_", ")_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "title_", "(_", "'", "Mea", "n", " ", "Distan", "ce", " ", "from", " ", "the", " ", "PM", "J", " ", "to", " ", "the", " ", "centre", " ", "of", " ", "each", " ", "Ne", "rve", " ", "Roo", "tle", "t", " ", "Segme", "nt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Finding", " ", "the", " ", "distance", " ", "bet", "ween", " ", "the", " ", "Spin", "al", " ", "and", " ", "Vert", "ebra", "l", " ", "center", "s", " ", "in", " ", "the", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "spin", "al", "\\u", "vert", "ebra", "l\\u", "distances_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spin", "al", "\\u", "vert", "ebra", "l\\u", "distances_", "[_", "i_", "]_", "=_", "round_", "(_", "(_", "vert", "ebra", "l\\u", "Mu", "_", "[_", "i_", "]_", "-_", "spin", "al", "\\u", "Mu", "_", "[_", "i_", "]_", ")_", "*_", "averag", "e\\u", "conve", "rsi", "on", "\\u", "factor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "spin", "al", "\\u", "levels_", "=_", "np_", "._", "zeros_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "vert", "ebra", "l\\u", "levels_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spin", "al", "\\u", "levels_", "[_", "i_", "]_", "=_", "int_", "(_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "]_", "+_", "spin", "al", "\\u", "vert", "ebra", "l\\u", "distances_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "ing", " ", "Templa", "tes", " ", "for", " ", "each", " ", "Spin", "al", " ", "level_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", ",_", "Y_", ",_", "Z_", "=_", "np_", "._", "where_", "(_", "vert", "ebra", "l\\u", "cord", "\\u", "image_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "spin", "al", "\\u", "levels_", "[_", ":_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "spin", "al", "\\u", "image_", "=_", "vert", "ebra", "l\\u", "cord", "\\u", "image_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "np_", "._", "amax_", "(_", "Z_", ")_", ",_", "np_", "._", "amin_", "(_", "Z_", ")_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", "=_", "np_", "._", "where_", "(_", "vert", "ebra", "l\\u", "cord", "\\u", "image_", "[_", ":_", ",_", ":_", ",_", "j_", "]_", ">_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff_", "=_", "(_", "i_", "-_", "j_", ")_", "/_", "averag", "e\\u", "conve", "rsi", "on", "\\u", "factor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "gaussian_", "(_", "(_", "spin", "al", "\\u", "Mu", "_", "[_", "k_", "]_", "+_", "diff_", ")_", ",_", "spin", "al", "\\u", "Mu", "_", "[_", "k_", "]_", ",_", "spin", "al", "\\u", "Sigma_", "[_", "k_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template", "\\u", "spin", "al", "\\u", "image_", "[_", "x_", ",_", "y_", ",_", "j_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "k_", "=_", "k_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "NI", "FT", "I", " ", "volumes_", "\\u\\u\\uNL\\u\\u\\u_", "hdr", "\\u", "vert", "ebra", "l\\u", "cord", "_", "._", "set\\u", "data\\u", "dtype_", "(_", "'", "uint", "8", "'_", ")_", "#", " ", "set", " ", "image", "type", " ", "to", " ", "uint8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'\\\\", "n", "Write", " ", "NI", "FT", "I", " ", "volume", "s", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "nib", "abel_", "._", "Ni", "fti", "1", "Image_", "(_", "template", "\\u", "spin", "al", "\\u", "image_", ",_", "None_", ",_", "hdr", "\\u", "vert", "ebra", "l\\u", "cord", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k_", "<=_", "8_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "name_", "=_", "'", "spin", "al", "\\u", "level", "\\u", "C", "'_", "+_", "str_", "(_", "k_", ")_", "+_", "'.", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "file", "\\u", "name_", "=_", "'", "spin", "al", "\\u", "level", "\\u", "T", "'_", "+_", "str_", "(_", "k_", "-_", "8_", ")_", "+_", "'.", "ni", "i", ".", "gz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nib", "abel_", "._", "save_", "(_", "img_", ",_", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'..", " ", "File", " ", "created", ":'_", "+_", "file", "\\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_", "find", "\\u", "mid", "\\u", "point", "\\u", "vert", "ebra", "l\\u", "level_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vert", "ebra", "l\\u", "levels_", "=_", "np_", "._", "zeros_", "(_", "int_", "(_", "np_", "._", "amax_", "(_", "data_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "(_", "int_", "(_", "np_", "._", "amin_", "(_", "data_", ")_", ")_", "+_", "1_", ")_", ",_", "(_", "int_", "(_", "np_", "._", "amax_", "(_", "data_", ")_", ")_", "+_", "1_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "finding", " ", "the", " ", "co", "-", "ordina", "tes", " ", "of", " ", "voxels", " ", "in", " ", "each", " ", "level", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", ",_", "y_", ",_", "z_", "=_", "np_", "._", "where_", "(_", "data_", "==_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "z_", "=_", "np_", "._", "sort_", "(_", "z_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vert", "ebra", "l\\u", "levels_", "[_", "i_", "-_", "1_", "]_", "=_", "np_", "._", "amin_", "(_", "z_", ")_", "+_", "round_", "(_", "(_", "np_", "._", "amax_", "(_", "z_", ")_", "-_", "np_", "._", "amin_", "(_", "z_", ")_", ")_", "/_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "vert", "ebra", "l\\u", "levels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gaussian_", "(_", "x_", ",_", "mu_", ",_", "sig_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "np_", "._", "exp_", "(_", "-_", "(_", "(_", "x_", "-_", "mu_", ")_", "*_", "(_", "x_", "-_", "mu_", ")_", ")_", "/_", "(_", "2_", "*_", "sig_", "*_", "sig_", ")_", ")_", ")_", "/_", "(_", "np_", "._", "sqrt_", "(_", "2_", "*_", "(_", "np_", "._", "pi_", ")_", "*_", "sig_", "*_", "sig_", ")_", ")_", "\\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,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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 ]
Unused import
ofri/Open-Knesset/mks/migrations/0016_bill_stats.py
[ { "content": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import DataMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(DataMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'committees.committee': {\n 'Meta': {'object_name': 'Committee'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'members': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'committees'\", 'symmetrical': 'False', 'to': \"orm['mks.Member']\"}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '256'})\n },\n 'committees.committeemeeting': {\n 'Meta': {'object_name': 'CommitteeMeeting'},\n 'committee': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'meetings'\", 'to': \"orm['committees.Committee']\"}),\n 'date': ('django.db.models.fields.DateField', [], {}),\n 'date_string': ('django.db.models.fields.CharField', [], {'max_length': '256'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'mks_attended': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'committee_meetings'\", 'symmetrical': 'False', 'to': \"orm['mks.Member']\"}),\n 'protocol_text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'topics': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'votes_mentioned': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"'committee_meetings'\", 'blank': 'True', 'to': \"orm['laws.Vote']\"})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'laws.bill': {\n 'Meta': {'object_name': 'Bill'},\n 'approval_vote': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': \"'bill_approved'\", 'unique': 'True', 'null': 'True', 'to': \"orm['laws.Vote']\"}),\n 'first_committee_meetings': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills_first'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['committees.CommitteeMeeting']\"}),\n 'first_vote': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'bills_first'\", 'null': 'True', 'to': \"orm['laws.Vote']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'law': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'bills'\", 'null': 'True', 'to': \"orm['laws.Law']\"}),\n 'pre_votes': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills_pre_votes'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['laws.Vote']\"}),\n 'proposers': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['mks.Member']\"}),\n 'second_committee_meetings': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills_second'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['committees.CommitteeMeeting']\"}),\n 'stage': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'stage_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})\n },\n 'laws.govlegislationcommitteedecision': {\n 'Meta': {'object_name': 'GovLegislationCommitteeDecision'},\n 'bill': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'gov_decisions'\", 'null': 'True', 'to': \"orm['laws.Bill']\"}),\n 'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'source_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'stand': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'subtitle': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})\n },\n 'laws.govproposal': {\n 'Meta': {'object_name': 'GovProposal'},\n 'bill': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': \"'gov_proposal'\", 'unique': 'True', 'null': 'True', 'to': \"orm['laws.Bill']\"}),\n 'booklet_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'committee_meetings': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_govproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['committees.CommitteeMeeting']\"}),\n 'content_html': ('django.db.models.fields.TextField', [], {'default': \"''\", 'blank': 'True'}),\n 'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'knesset_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'law': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'laws_govproposal_related'\", 'null': 'True', 'to': \"orm['laws.Law']\"}),\n 'source_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),\n 'votes': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_govproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['laws.Vote']\"})\n },\n 'laws.knessetproposal': {\n 'Meta': {'object_name': 'KnessetProposal'},\n 'bill': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': \"'knesset_proposal'\", 'unique': 'True', 'null': 'True', 'to': \"orm['laws.Bill']\"}),\n 'booklet_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'committee': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'bills'\", 'null': 'True', 'to': \"orm['committees.Committee']\"}),\n 'committee_meetings': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_knessetproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['committees.CommitteeMeeting']\"}),\n 'content_html': ('django.db.models.fields.TextField', [], {'default': \"''\", 'blank': 'True'}),\n 'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'knesset_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'law': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'laws_knessetproposal_related'\", 'null': 'True', 'to': \"orm['laws.Law']\"}),\n 'originals': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'knesset_proposals'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['laws.PrivateProposal']\"}),\n 'source_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),\n 'votes': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_knessetproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['laws.Vote']\"})\n },\n 'laws.law': {\n 'Meta': {'object_name': 'Law'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'merged_into': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'duplicates'\", 'null': 'True', 'to': \"orm['laws.Law']\"}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'})\n },\n 'laws.membervotingstatistics': {\n 'Meta': {'object_name': 'MemberVotingStatistics'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.OneToOneField', [], {'related_name': \"'voting_statistics'\", 'unique': 'True', 'to': \"orm['mks.Member']\"})\n },\n 'laws.partyvotingstatistics': {\n 'Meta': {'object_name': 'PartyVotingStatistics'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'party': ('django.db.models.fields.related.OneToOneField', [], {'related_name': \"'voting_statistics'\", 'unique': 'True', 'to': \"orm['mks.Party']\"})\n },\n 'laws.privateproposal': {\n 'Meta': {'object_name': 'PrivateProposal'},\n 'bill': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'proposals'\", 'null': 'True', 'to': \"orm['laws.Bill']\"}),\n 'committee_meetings': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_privateproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['committees.CommitteeMeeting']\"}),\n 'content_html': ('django.db.models.fields.TextField', [], {'default': \"''\", 'blank': 'True'}),\n 'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'joiners': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills_joined'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['mks.Member']\"}),\n 'knesset_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'law': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'laws_privateproposal_related'\", 'null': 'True', 'to': \"orm['laws.Law']\"}),\n 'proposal_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'proposers': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'bills_proposed'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['mks.Member']\"}),\n 'source_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),\n 'votes': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': \"'laws_privateproposal_related'\", 'null': 'True', 'symmetrical': 'False', 'to': \"orm['laws.Vote']\"})\n },\n 'laws.vote': {\n 'Meta': {'object_name': 'Vote'},\n 'against_party': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'controversy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'full_text': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'full_text_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'importance': ('django.db.models.fields.FloatField', [], {'default': '0.0'}),\n 'meeting_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'src_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'src_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'summary': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),\n 'time': ('django.db.models.fields.DateTimeField', [], {}),\n 'time_string': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'title': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),\n 'vote_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'votes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': \"'votes'\", 'blank': 'True', 'through': \"orm['laws.VoteAction']\", 'to': \"orm['mks.Member']\"}),\n 'votes_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n 'laws.voteaction': {\n 'Meta': {'object_name': 'VoteAction'},\n 'against_coalition': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'against_opposition': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'against_party': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Member']\"}),\n 'type': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'vote': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['laws.Vote']\"})\n },\n 'mks.correlation': {\n 'Meta': {'object_name': 'Correlation'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'm1': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'m1'\", 'to': \"orm['mks.Member']\"}),\n 'm2': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'m2'\", 'to': \"orm['mks.Member']\"}),\n 'normalized_score': ('django.db.models.fields.FloatField', [], {'null': 'True'}),\n 'not_same_party': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),\n 'score': ('django.db.models.fields.IntegerField', [], {'default': '0'})\n },\n 'mks.member': {\n 'Meta': {'object_name': 'Member'},\n 'area_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'bills_stats_approved': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_first': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_pre': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'bills_stats_proposed': ('django.db.models.fields.IntegerField', [], {'default': '0'}),\n 'blog': ('django.db.models.fields.related.OneToOneField', [], {'to': \"orm['planet.Blog']\", 'unique': 'True', 'null': 'True', 'blank': 'True'}),\n 'current_party': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'members'\", 'null': 'True', 'to': \"orm['mks.Party']\"}),\n 'current_role_descriptions': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}),\n 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'date_of_death': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'family_status': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'img_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),\n 'is_current': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_children': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'parties': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'all_members'\", 'symmetrical': 'False', 'through': \"orm['mks.Membership']\", 'to': \"orm['mks.Party']\"}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),\n 'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lat': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'place_of_residence_lon': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True', 'blank': 'True'}),\n 'residence_centrality': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'residence_economy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\", 'null': 'True', 'blank': 'True'}),\n 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'year_of_aliyah': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n 'mks.membership': {\n 'Meta': {'object_name': 'Membership'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Member']\"}),\n 'party': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Party']\"}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n 'mks.party': {\n 'Meta': {'object_name': 'Party'},\n 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_coalition': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),\n 'number_of_members': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'number_of_seats': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})\n },\n 'mks.weeklypresence': {\n 'Meta': {'object_name': 'WeeklyPresence'},\n 'date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'hours': ('django.db.models.fields.FloatField', [], {'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['mks.Member']\"})\n },\n 'planet.blog': {\n 'Meta': {'object_name': 'Blog'},\n 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'title': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),\n 'url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '1024', 'db_index': 'True'})\n },\n 'tagging.tag': {\n 'Meta': {'object_name': 'Tag'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})\n },\n 'tagging.taggeditem': {\n 'Meta': {'unique_together': \"(('tag', 'content_type', 'object_id'),)\", 'object_name': 'TaggedItem'},\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),\n 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'items'\", 'to': \"orm['tagging.Tag']\"})\n }\n }\n\n complete_apps = ['laws', 'mks']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def forwards(self, orm):\n for mk in orm.Member.objects.all():\n mk.bills_stats_proposed = mk.bills.count()\n mk.bills_stats_pre = mk.bills.filter(stage__in=['2','3','4','5','6']).count()\n mk.bills_stats_first = mk.bills.filter(stage__in=['4','5','6']).count()\n mk.bills_stats_approved = mk.bills.filter(stage='6').count()\n mk.save()", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'DataMigration', ')', ':', '___EOS___']", "index": 8 }, { "content": " def backwards(self, orm):\n \"Write your backwards methods here.\"", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'DataMigration', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from south.db import db", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 23 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Data", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Data", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "s", ".", "committee", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Committe", "e", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "committee", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "s", ".", "committee", "meeting", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Committe", "e", "Meet", "ing", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "meeting", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "string", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "256", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", "\\u", "attend", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "committee", "\\u", "meeting", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "protoc", "ol", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "topic", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "\\u", "mentioned", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "committee", "\\u", "meeting", "s", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "bill", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Bill", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "approval", "\\u", "vote", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "\\u", "approved", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "committee", "\\u", "meeting", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "first", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "Meet", "ing", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "vote", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "first", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Law", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pre", "\\u", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "pre", "\\u", "vote", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "propos", "ers", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "second", "\\u", "committee", "\\u", "meeting", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "second", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "Meet", "ing", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stage", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stage", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "gov", "legislat", "ion", "committee", "decision", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Gov", "Legi", "slat", "ion", "Committe", "e", "Deci", "sion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "gov", "\\u", "decision", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Bill", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "stand", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subtit", "le", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "gov", "propos", "al", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Gov", "Propos", "al", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "gov", "\\u", "propos", "al", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Bill", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "book", "let", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "\\u", "meeting", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "gov", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "Meet", "ing", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "html", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kne", "sset", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "gov", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Law", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "gov", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "kne", "sset", "propos", "al", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Kn", "esse", "t", "Propos", "al", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "kne", "sset", "\\u", "propos", "al", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Bill", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "book", "let", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "\\u", "meeting", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "kne", "sset", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "Meet", "ing", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "html", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kne", "sset", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "kne", "sset", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Law", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "original", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "kne", "sset", "\\u", "proposals", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Priva", "te", "Propos", "al", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "kne", "sset", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "law", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Law", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "merge", "d\\u", "int", "o", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "duplicat", "es", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Law", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "member", "voting", "statistic", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Mem", "ber", "Vo", "ting", "Statistic", "s", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "voting", "\\u", "statistic", "s", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "part", "yv", "oti", "ngs", "tati", "stic", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Part", "y", "Vo", "ting", "Statistic", "s", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "voting", "\\u", "statistic", "s", "'\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "private", "propos", "al", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Priva", "te", "Propos", "al", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "proposals", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Bill", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "committee", "\\u", "meeting", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "private", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "committee", "s", ".", "Committe", "e", "Meet", "ing", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "html", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "joine", "rs", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "joine", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kne", "sset", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "private", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Law", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "propos", "al", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "propos", "ers", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "bill", "s", "\\u", "proposed", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "law", "s", "\\u", "private", "propos", "al", "\\u", "relate", "d", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "vote", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Vote", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "against", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contr", "overs", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "full", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "full", "\\u", "text", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "importance", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0.", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "meeting", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "src", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "src", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "summar", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "\\u", "string", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "\\u", "number", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "vote", "s", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "through", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "Action", "']\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "s", "\\u", "count", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "law", "s", ".", "vote", "action", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Vote", "Action", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "against", "\\u", "coal", "ition", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "against", "\\u", "oppo", "sition", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "against", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "vote", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "law", "s", ".", "Vote", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "correlation", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Correla", "tion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "m1", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "m1", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "m2", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "m2", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "normali", "zed", "\\u", "score", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "not", "\\u", "same", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Null", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "member", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Mem", "ber", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "area", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "approved", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "first", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "pre", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bill", "s", "\\u", "stats", "\\u", "proposed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blog", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "One", "To", "One", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "planet", ".", "Blog", "']\"_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "member", "s", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "current", "\\u", "role", "\\u", "description", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "of", "\\u", "death", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "famil", "y", "\\u", "status", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "gender", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "img", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "current", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "child", "ren", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parties", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "all", "\\u", "member", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "through", "'_", ":_", "\"", "orm", "['", "mks", ".", "Membership", "']\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "birth", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lat", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "place", "\\u", "of", "\\u", "reside", "nce", "\\u", "lon", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "centrali", "ty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "reside", "nce", "\\u", "econom", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "webs", "ite", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "200", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "year", "\\u", "of", "\\u", "ali", "ya", "h", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "member", "ship", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Membership", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "part", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Part", "y", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "part", "y", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Part", "y", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "end", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "coal", "ition", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "64", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "member", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "number", "\\u", "of", "\\u", "seats", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "start", "\\u", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "mks", ".", "week", "ly", "presen", "ce", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Week", "ly", "Presence", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hour", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Float", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "member", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "mks", ".", "Mem", "ber", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "planet", ".", "blog", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Blog", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "created", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "\\u", "add", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "title", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "1024", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tagging", ".", "tag", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Ta", "g", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tagging", ".", "tagg", "edit", "em", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "tag", "',", " ", "'", "content", "\\u", "type", "',", " ", "'", "object\\u", "id", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Tagg", "ed", "Item", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tag", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "items", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "tagging", ".", "Ta", "g", "']\"_", "}_", ")_", "\\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_", "=_", "[_", "'", "law", "s", "'_", ",_", "'", "mks", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Data", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mk", "_", "in_", "orm_", "._", "Member_", "._", "objects_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mk", "_", "._", "bill", "s", "\\u", "stats", "\\u", "proposed", "_", "=_", "mk", "_", "._", "bill", "s_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mk", "_", "._", "bill", "s", "\\u", "stats", "\\u", "pre_", "=_", "mk", "_", "._", "bill", "s_", "._", "filter_", "(_", "stage", "\\u\\u", "in_", "=_", "[_", "'", "2", "'_", ",_", "'", "3", "'_", ",_", "'", "4", "'_", ",_", "'", "5", "'_", ",_", "'", "6", "'_", "]_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mk", "_", "._", "bill", "s", "\\u", "stats", "\\u", "first_", "=_", "mk", "_", "._", "bill", "s_", "._", "filter_", "(_", "stage", "\\u\\u", "in_", "=_", "[_", "'", "4", "'_", ",_", "'", "5", "'_", ",_", "'", "6", "'_", "]_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mk", "_", "._", "bill", "s", "\\u", "stats", "\\u", "approved", "_", "=_", "mk", "_", "._", "bill", "s_", "._", "filter_", "(_", "stage_", "=_", "'", "6", "'_", ")_", "._", "count_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mk", "_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Data", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Write", " ", "your", " ", "back", "ward", "s", " ", "method", "s", " ", "here", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
gmcquillan/django-brake/brake/backends/cachebe.py
[ { "content": "import hashlib\nimport time\n\nfrom django.core.cache import cache\nfrom django.core.cache.backends.base import BaseCache\n\nfrom brake.backends import BaseBackend\n\n\nCACHE_PREFIX = 'rl:'\nIP_PREFIX = 'ip:'\nKEY_TEMPLATE = 'func:%s:%s%s:%s%s'\nPERIOD_PREFIX = 'period:'\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CacheBackend(BaseBackend):\n\n\n\n", "metadata": "root.CacheBackend", "header": "['module', '___EOS___']", "index": 15 }, { "content": " def get_ip(self, request):\n \"\"\"This gets the IP we wish to use for ratelimiting.\n\n It defaults to 'REMOTE_ADDR'. It's recommended that you override\n this function if you're using loadbalancers or any kind of upstream\n proxy service to route requests to Django.\n \"\"\"\n return request.META['REMOTE_ADDR']", "metadata": "root.CacheBackend.get_ip", "header": "['class', 'CacheBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 17 }, { "content": " def _keys(self, func_name, request, ip=True, field=None, period=None):\n keys = []\n if ip:\n keys.append(KEY_TEMPLATE % (\n func_name, PERIOD_PREFIX, period,\n IP_PREFIX, self.get_ip(request)\n ))\n\n if field is not None:\n if not isinstance(field, (list, tuple)):\n field = [field]\n for f in field:\n val = getattr(request, request.method).get(f)\n # Convert value to hexdigest as cache backend doesn't allow\n # certain characters\n if val:\n val = hashlib.sha1(val.encode('utf-8')).hexdigest()\n keys.append('func:%s:%s%s:field:%s:%s' % (\n func_name, PERIOD_PREFIX, period, f, val\n ))\n\n return [\n CACHE_PREFIX + k for k in keys\n ]", "metadata": "root.CacheBackend._keys", "header": "['class', 'CacheBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 26 }, { "content": " def count(self, func_name, request, ip=True, field=None, period=60):\n \"\"\"Increment counters for all relevant cache_keys given a request.\"\"\"\n counters = dict((key, (1, time.time() + period)) for key in self._keys(\n func_name, request, ip, field, period))\n counters.update(cache.get_many(counters.keys()))\n for key, value in counters.items():\n # Handle old values.\n if isinstance(value, tuple):\n count, expiration = value\n else:\n count = value\n expiration = time.time() + period\n count += 1\n cache.set(key, (count, expiration), timeout=int(expiration - time.time()))", "metadata": "root.CacheBackend.count", "header": "['class', 'CacheBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 51 }, { "content": " def limit(self, func_name, request,\n ip=True, field=None, count=5, period=None):\n \"\"\"Return limit data about any keys relevant for requst.\"\"\"\n counters = cache.get_many(\n self._keys(func_name, request, ip, field, period)\n )\n\n limits = []\n for counter in counters:\n ratelimited_by = 'field'\n if ':ip:' in counter:\n ratelimited_by = 'ip'\n\n current_count = counters[counter]\n if isinstance(current_count, tuple):\n current_count = current_count[0]\n\n if current_count > count:\n limits.append({\n 'ratelimited_by': ratelimited_by,\n 'period': period,\n 'field': field,\n 'count': current_count,\n 'cache_key': counter,\n 'ip': self.get_ip(request)\n })\n\n return limits", "metadata": "root.CacheBackend.limit", "header": "['class', 'CacheBackend', '(', 'BaseBackend', ')', ':', '___EOS___']", "index": 66 } ]
[ { "span": "from django.core.cache.backends.base import BaseCache", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 53 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "cache_", "import_", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "core_", "._", "cache_", "._", "backends_", "._", "base_", "import_", "Base", "Cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "brak", "e_", "._", "backends_", "import_", "Base", "Backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "CACHE", "\\u", "PREFIX_", "=_", "'", "rl", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "IP", "\\u", "PREFIX_", "=_", "'", "ip", ":'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "KEY", "\\u", "TEMPLATE_", "=_", "'", "func", ":", "%", "s", ":", "%", "s", "%", "s", ":", "%", "s", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PERIOD", "\\u", "PREFIX_", "=_", "'", "period", ":'_", "\\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_", "Cache", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Cache", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "\\u", "ip_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "gets", " ", "the", " ", "IP", " ", "we", " ", "wish", " ", "to", " ", "use", " ", "for", " ", "ratel", "imit", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "default", "s", " ", "to", " ", "'", "REMO", "TE", "\\u", "ADDR", "'.", " ", "It", "'", "s", " ", "recommende", "d", " ", "tha", "t", " ", "you", " ", "override", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "function", " ", "if", " ", "you", "'", "re", " ", "usi", "ng", " ", "loadbalancer", "s", " ", "or", " ", "any", " ", "kind", " ", "of", " ", "ups", "tream", "\\", "10", ";", " ", " ", " ", " ", "proxy", " ", "service", " ", "to", " ", "route", " ", "request", "s", " ", "to", " ", "Dj", "ang", "o", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "request_", "._", "META_", "[_", "'", "REMO", "TE", "\\u", "ADDR", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "keys_", "(_", "self_", ",_", "func", "\\u", "name_", ",_", "request_", ",_", "ip_", "=_", "True_", ",_", "field_", "=_", "None_", ",_", "period_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ip_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "._", "append_", "(_", "KEY", "\\u", "TEMPLATE_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "func", "\\u", "name_", ",_", "PERIOD", "\\u", "PREFIX_", ",_", "period_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "IP", "\\u", "PREFIX_", ",_", "self_", "._", "get", "\\u", "ip_", "(_", "request_", ")_", "\\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_", "field_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "field_", ",_", "(_", "list_", ",_", "tuple_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "field_", "=_", "[_", "field_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "f_", "in_", "field_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "getattr_", "(_", "request_", ",_", "request_", "._", "method_", ")_", "._", "get_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Convert", " ", "value", " ", "to", " ", "hexd", "ige", "st", " ", "as", " ", "cache", " ", "back", "end", " ", "doe", "sn", "'", "t", " ", "allow_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cert", "ain", " ", "characters_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "val_", "=_", "hashlib_", "._", "sha1_", "(_", "val_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", ")_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keys_", "._", "append_", "(_", "'", "func", ":", "%", "s", ":", "%", "s", "%", "s", ":", "field", ":", "%", "s", ":", "%", "s", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "func", "\\u", "name_", ",_", "PERIOD", "\\u", "PREFIX_", ",_", "period_", ",_", "f_", ",_", "val_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "CACHE", "\\u", "PREFIX_", "+_", "k_", "for_", "k_", "in_", "keys_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "count_", "(_", "self_", ",_", "func", "\\u", "name_", ",_", "request_", ",_", "ip_", "=_", "True_", ",_", "field_", "=_", "None_", ",_", "period_", "=_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Increment", " ", "counter", "s", " ", "for", " ", "all", " ", "rele", "van", "t", " ", "cache", "\\u", "keys", " ", "give", "n", " ", "a", " ", "request", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counters_", "=_", "dict_", "(_", "(_", "key_", ",_", "(_", "1_", ",_", "time_", "._", "time_", "(_", ")_", "+_", "period_", ")_", ")_", "for_", "key_", "in_", "self_", "._", "\\u", "keys_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "func", "\\u", "name_", ",_", "request_", ",_", "ip_", ",_", "field_", ",_", "period_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counters_", "._", "update_", "(_", "cache_", "._", "get", "\\u", "many_", "(_", "counters_", "._", "keys_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "counters_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Handle", " ", "old", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", ",_", "expiration_", "=_", "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 ", " _", "count_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expiration_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "period_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache_", "._", "set_", "(_", "key_", ",_", "(_", "count_", ",_", "expiration_", ")_", ",_", "timeout_", "=_", "int_", "(_", "expiration_", "-_", "time_", "._", "time_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache", "Backend_", "(_", "Base", "Backend_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "limit_", "(_", "self_", ",_", "func", "\\u", "name_", ",_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ip_", "=_", "True_", ",_", "field_", "=_", "None_", ",_", "count_", "=_", "5_", ",_", "period_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", " ", "limit", " ", "data", " ", "abo", "ut", " ", "any", " ", "keys", " ", "rele", "van", "t", " ", "for", " ", "req", "ust", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counters_", "=_", "cache_", "._", "get", "\\u", "many_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "keys_", "(_", "func", "\\u", "name_", ",_", "request_", ",_", "ip_", ",_", "field_", ",_", "period_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "limits_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "counter_", "in_", "counters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ratel", "imit", "ed", "\\u", "by_", "=_", "'", "field", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "':", "ip", ":'_", "in_", "counter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ratel", "imit", "ed", "\\u", "by_", "=_", "'", "ip", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "current", "\\u", "count_", "=_", "counters_", "[_", "counter_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "current", "\\u", "count_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "current", "\\u", "count_", "=_", "current", "\\u", "count_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "current", "\\u", "count_", ">_", "count_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "limits_", "._", "append_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ratel", "imit", "ed", "\\u", "by", "'_", ":_", "ratel", "imit", "ed", "\\u", "by_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "'_", ":_", "period_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "field", "'_", ":_", "field_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "count", "'_", ":_", "current", "\\u", "count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cache", "\\u", "key", "'_", ":_", "counter_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ip", "'_", ":_", "self_", "._", "get", "\\u", "ip_", "(_", "request_", ")_", "\\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_", "return_", "limits_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 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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2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
letsencrypt/letsencrypt/acme/acme/client_test.py
[ { "content": " @mock.patch('acme.client.datetime')\n @mock.patch('acme.client.time')\n def test_poll_and_request_issuance(self, time_mock, dt_mock):\n # clock.dt | pylint: disable=no-member\n clock = mock.MagicMock(dt=datetime.datetime(2015, 3, 27))\n\n def sleep(seconds):\n \"\"\"increment clock\"\"\"\n clock.dt += datetime.timedelta(seconds=seconds)\n time_mock.sleep.side_effect = sleep\n\n def now():\n \"\"\"return current clock value\"\"\"\n return clock.dt\n dt_mock.datetime.now.side_effect = now\n dt_mock.timedelta = datetime.timedelta\n\n def poll(authzr): # pylint: disable=missing-docstring\n # record poll start time based on the current clock value\n authzr.times.append(clock.dt)\n\n # suppose it takes 2 seconds for server to produce the\n # result, increment clock\n clock.dt += datetime.timedelta(seconds=2)\n\n if len(authzr.retries) == 1: # no more retries\n done = mock.MagicMock(uri=authzr.uri, times=authzr.times)\n done.body.status = authzr.retries[0]\n return done, []\n\n # response (2nd result tuple element) is reduced to only\n # Retry-After header contents represented as integer\n # seconds; authzr.retries is a list of Retry-After\n # headers, head(retries) is peeled of as a current\n # Retry-After header, and tail(retries) is persisted for\n # later poll() calls\n return (mock.MagicMock(retries=authzr.retries[1:],\n uri=authzr.uri + '.', times=authzr.times),\n authzr.retries[0])\n self.client.poll = mock.MagicMock(side_effect=poll)\n\n mintime = 7\n\n def retry_after(response, default):\n # pylint: disable=missing-docstring\n # check that poll_and_request_issuance correctly passes mintime\n self.assertEqual(default, mintime)\n return clock.dt + datetime.timedelta(seconds=response)\n self.client.retry_after = mock.MagicMock(side_effect=retry_after)\n\n def request_issuance(csr, authzrs): # pylint: disable=missing-docstring\n return csr, authzrs\n self.client.request_issuance = mock.MagicMock(\n side_effect=request_issuance)\n\n csr = mock.MagicMock()\n authzrs = (\n mock.MagicMock(uri='a', times=[], retries=(\n 8, 20, 30, messages.STATUS_VALID)),\n mock.MagicMock(uri='b', times=[], retries=(\n 5, messages.STATUS_VALID)),\n )\n\n cert, updated_authzrs = self.client.poll_and_request_issuance(\n csr, authzrs, mintime=mintime,\n # make sure that max_attempts is per-authorization, rather\n # than global\n max_attempts=max(len(authzrs[0].retries), len(authzrs[1].retries)))\n self.assertTrue(cert[0] is csr)\n self.assertTrue(cert[1] is updated_authzrs)\n self.assertEqual(updated_authzrs[0].uri, 'a...')\n self.assertEqual(updated_authzrs[1].uri, 'b.')\n self.assertEqual(updated_authzrs[0].times, [\n datetime.datetime(2015, 3, 27),\n # a is scheduled for 10, but b is polling [9..11), so it\n # will be picked up as soon as b is finished, without\n # additional sleeping\n datetime.datetime(2015, 3, 27, 0, 0, 11),\n datetime.datetime(2015, 3, 27, 0, 0, 33),\n datetime.datetime(2015, 3, 27, 0, 1, 5),\n ])\n self.assertEqual(updated_authzrs[1].times, [\n datetime.datetime(2015, 3, 27, 0, 0, 2),\n datetime.datetime(2015, 3, 27, 0, 0, 9),\n ])\n self.assertEqual(clock.dt, datetime.datetime(2015, 3, 27, 0, 1, 7))\n\n # CA sets invalid | TODO: move to a separate test\n invalid_authzr = mock.MagicMock(\n times=[], retries=[messages.STATUS_INVALID])\n self.assertRaises(\n errors.PollError, self.client.poll_and_request_issuance,\n csr, authzrs=(invalid_authzr,), mintime=mintime)\n\n # exceeded max_attemps | TODO: move to a separate test\n self.assertRaises(\n errors.PollError, self.client.poll_and_request_issuance,\n csr, authzrs, mintime=mintime, max_attempts=2)", "metadata": "root.ClientTest.test_poll_and_request_issuance", "header": "['class', 'ClientTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 285 }, { "content": " def test_init(self):\n self.assertTrue(self.net.verify_ssl is self.verify_ssl)", "metadata": "root.ClientNetworkTest.test_init", "header": "['class', 'ClientNetworkTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 460 } ]
[ { "span": "self.assertTrue(cert[0] is csr)", "start_line": 353, "start_column": 8, "end_line": 353, "end_column": 39 }, { "span": "self.assertTrue(cert[1] is updated_authzrs)", "start_line": 354, "start_column": 8, "end_line": 354, "end_column": 51 }, { "span": "self.assertTrue(self.net.verify_ssl is self.verify_ssl)", "start_line": 461, "start_column": 8, "end_line": 461, "end_column": 63 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Client", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "acm", "e", ".", "client", ".", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "mock_", "._", "patch_", "(_", "'", "acm", "e", ".", "client", ".", "time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "poll", "\\u", "and", "\\u", "request", "\\u", "issu", "ance_", "(_", "self_", ",_", "time", "\\u", "mock_", ",_", "dt", "\\u", "mock_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "clock", ".", "dt", " ", "|", " ", "pylint", ":", " ", "disable", "=", "no", "-", "member_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "clock_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "dt_", "=_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sleep_", "(_", "seconds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "increment", " ", "clock", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clock_", "._", "dt_", "+=_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "seconds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "\\u", "mock_", "._", "sleep_", "._", "side", "\\u", "effect_", "=_", "sleep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "now_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "return", " ", "current", " ", "clock", " ", "value", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "clock_", "._", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dt", "\\u", "mock_", "._", "datetime_", "._", "now_", "._", "side", "\\u", "effect_", "=_", "now_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dt", "\\u", "mock_", "._", "timedelta_", "=_", "datetime_", "._", "timedelta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "poll_", "(_", "authz", "r_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "missi", "ng", "-", "docstring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "record", " ", "poll", " ", "start", " ", "time", " ", "based", " ", "on", " ", "the", " ", "current", " ", "clock", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "authz", "r_", "._", "times_", "._", "append_", "(_", "clock_", "._", "dt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "supp", "ose", " ", "it", " ", "take", "s", " ", "2", " ", "second", "s", " ", "for", " ", "server", " ", "to", " ", "produce", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", ",", " ", "increment", " ", "clock_", "\\u\\u\\uNL\\u\\u\\u_", "clock_", "._", "dt_", "+=_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "authz", "r_", "._", "retries_", ")_", "==_", "1_", ":_", "#", " ", "no", " ", "more", " ", "retries_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "done_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "uri_", "=_", "authz", "r_", "._", "uri_", ",_", "times_", "=_", "authz", "r_", "._", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "done_", "._", "body_", "._", "status_", "=_", "authz", "r_", "._", "retries_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "done_", ",_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "response", " ", "(", "2n", "d", " ", "result", " ", "tuple", " ", "element", ")", " ", "is", " ", "reduce", "d", " ", "to", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retr", "y", "-", "Af", "ter", " ", "header", " ", "content", "s", " ", "represent", "ed", " ", "as", " ", "integer_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "second", "s", ";", " ", "authz", "r", ".", "retrie", "s", " ", "is", " ", "a", " ", "list", " ", "of", " ", "Retr", "y", "-", "After_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "header", "s", ",", " ", "head", "(", "retrie", "s", ")", " ", "is", " ", "pee", "led", " ", "of", " ", "as", " ", "a", " ", "current_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retr", "y", "-", "Af", "ter", " ", "header", ",", " ", "and", " ", "tail", "(", "retrie", "s", ")", " ", "is", " ", "persiste", "d", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "late", "r", " ", "poll", "()", " ", "calls_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "retries_", "=_", "authz", "r_", "._", "retries_", "[_", "1_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "uri_", "=_", "authz", "r_", "._", "uri_", "+_", "'.'_", ",_", "times_", "=_", "authz", "r_", "._", "times_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "authz", "r_", "._", "retries_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "client_", "._", "poll_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "side", "\\u", "effect_", "=_", "poll_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mint", "ime_", "=_", "7_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "retr", "y", "\\u", "after_", "(_", "response_", ",_", "default_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "pylint", ":", " ", "disable", "=", "missi", "ng", "-", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "tha", "t", " ", "poll", "\\u", "and", "\\u", "request", "\\u", "issu", "anc", "e", " ", "correct", "ly", " ", "pass", "es", " ", "mint", "ime_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "default_", ",_", "mint", "ime_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "clock_", "._", "dt_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "client_", "._", "retr", "y", "\\u", "after_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "side", "\\u", "effect_", "=_", "retr", "y", "\\u", "after_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "request", "\\u", "issu", "ance_", "(_", "csr_", ",_", "authz", "rs_", ")_", ":_", "#", " ", "pylint", ":", " ", "disable", "=", "missi", "ng", "-", "docstring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "csr_", ",_", "authz", "rs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "client_", "._", "request", "\\u", "issu", "ance_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "side", "\\u", "effect_", "=_", "request", "\\u", "issu", "ance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "csr_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "authz", "rs_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "uri_", "=_", "'", "a", "'_", ",_", "times_", "=_", "[_", "]_", ",_", "retries_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "8_", ",_", "20_", ",_", "30_", ",_", "messages_", "._", "STATUS", "\\u", "VALID", "_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "uri_", "=_", "'", "b", "'_", ",_", "times_", "=_", "[_", "]_", ",_", "retries_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "5_", ",_", "messages_", "._", "STATUS", "\\u", "VALID", "_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cert_", ",_", "update", "d\\u", "authz", "rs_", "=_", "self_", "._", "client_", "._", "poll", "\\u", "and", "\\u", "request", "\\u", "issu", "ance_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "csr_", ",_", "authz", "rs_", ",_", "mint", "ime_", "=_", "mint", "ime_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "tha", "t", " ", "max", "\\u", "atte", "mpt", "s", " ", "is", " ", "per", "-", "authoriz", "ation", ",", " ", "rat", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "global_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "attempts_", "=_", "max_", "(_", "len_", "(_", "authz", "rs_", "[_", "0_", "]_", "._", "retries_", ")_", ",_", "len_", "(_", "authz", "rs_", "[_", "1_", "]_", "._", "retries_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cert_", "[_", "0_", "]_", "is_", "csr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "cert_", "[_", "1_", "]_", "is_", "update", "d\\u", "authz", "rs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "update", "d\\u", "authz", "rs_", "[_", "0_", "]_", "._", "uri_", ",_", "'", "a", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "update", "d\\u", "authz", "rs_", "[_", "1_", "]_", "._", "uri_", ",_", "'", "b", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "update", "d\\u", "authz", "rs_", "[_", "0_", "]_", "._", "times_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "is", " ", "schedule", "d", " ", "for", " ", "10", ",", " ", "but", " ", "b", " ", "is", " ", "polling", " ", "[", "9", "..", "11", "),", " ", "so", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "be", " ", "picked", " ", "up", " ", "as", " ", "soo", "n", " ", "as", " ", "b", " ", "is", " ", "finish", "ed", ",", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "addition", "al", " ", "sleep", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "0_", ",_", "11_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "0_", ",_", "33_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "1_", ",_", "5_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "update", "d\\u", "authz", "rs_", "[_", "1_", "]_", "._", "times_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "0_", ",_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "0_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "clock_", "._", "dt_", ",_", "datetime_", "._", "datetime_", "(_", "2015_", ",_", "3_", ",_", "27_", ",_", "0_", ",_", "1_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CA", " ", "sets", " ", "invalid", " ", "|", " ", "TOD", "O", ":", " ", "move", " ", "to", " ", "a", " ", "separate", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "invalid", "\\u", "authz", "r_", "=_", "mock_", "._", "Mag", "ic", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "times_", "=_", "[_", "]_", ",_", "retries_", "=_", "[_", "messages_", "._", "STATUS", "\\u", "INVALID", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "Poll", "Error_", ",_", "self_", "._", "client_", "._", "poll", "\\u", "and", "\\u", "request", "\\u", "issu", "ance_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "csr_", ",_", "authz", "rs_", "=_", "(_", "invalid", "\\u", "authz", "r_", ",_", ")_", ",_", "mint", "ime_", "=_", "mint", "ime_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exceed", "ed", " ", "max", "\\u", "atte", "mps", " ", "|", " ", "TOD", "O", ":", " ", "move", " ", "to", " ", "a", " ", "separate", " ", "test_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "errors_", "._", "Poll", "Error_", ",_", "self_", "._", "client_", "._", "poll", "\\u", "and", "\\u", "request", "\\u", "issu", "ance_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "csr_", ",_", "authz", "rs_", ",_", "mint", "ime_", "=_", "mint", "ime_", ",_", "max", "\\u", "attempts_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Client", "Network", "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", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "net_", "._", "verify", "\\u", "ssl_", "is_", "self_", "._", "verify", "\\u", "ssl_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
deanhiller/databus/webapp/play1.3.x/python/Lib/site-packages/win32/scripts/ControlService.py
[ { "content": "# ControlService.py\n#\n# A simple app which duplicates some of the functionality in the\n# Services applet of the control panel.\n#\n# Suggested enhancements (in no particular order):\n#\n# 1. When changing the service status, continue to query the status\n# of the service until the status change is complete. Use this\n# information to put up some kind of a progress dialog like the CP\n# applet does. Unlike the CP, allow canceling out in the event that\n# the status change hangs.\n# 2. When starting or stopping a service with dependencies, alert\n# the user about the dependent services, then start (or stop) all\n# dependent services as appropriate.\n# 3. Allow toggling between service view and device view\n# 4. Allow configuration of other service parameters such as startup\n# name and password.\n# 5. Allow connection to remote SCMs. This is just a matter of\n# reconnecting to the SCM on the remote machine; the rest of the\n# code should still work the same.\n# 6. Either implement the startup parameters or get rid of the editbox.\n# 7. Either implement or get rid of \"H/W Profiles\".\n# 8. Either implement or get rid of \"Help\".\n# 9. Improve error handling. Ideally, this would also include falling\n# back to lower levels of functionality for users with less rights.\n# Right now, we always try to get all the rights and fail when we can't\n\n\nfrom pywin.mfc import dialog\nimport win32ui\nimport win32con\nimport win32service\n\n\n\nif __name__=='__main__':\n\timport sys\n\tmachine = ''\n\tif len(sys.argv)>1:\n\t\tmachine = sys.argv[1]\n\tServiceDlg(machine).DoModal()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class StartupDlg(dialog.Dialog):\n\n\tIDC_LABEL = 127\n\tIDC_DEVICE = 128\n\tIDC_BOOT = 129\n\tIDC_SYSTEM = 130\n\tIDC_AUTOMATIC = 131\n\tIDC_MANUAL = 132\n\tIDC_DISABLED = 133\n\n\n\n\n", "metadata": "root.StartupDlg", "header": "['module', '___EOS___']", "index": 34 }, { "content": "\tdef __init__(self, displayname, service):\n\t\tdialog.Dialog.__init__(self, self.GetResource())\n\t\tself.name = displayname\n\t\tself.service = service", "metadata": "root.StartupDlg.__init__", "header": "['class', 'StartupDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 44 }, { "content": "\tdef __del__(self):\n\t\twin32service.CloseServiceHandle(self.service)", "metadata": "root.StartupDlg.__del__", "header": "['class', 'StartupDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 49 }, { "content": "\tdef OnInitDialog(self):\n\t\tcfg = win32service.QueryServiceConfig(self.service)\n\t\tself.GetDlgItem(self.IDC_BOOT + cfg[1]).SetCheck(1)\n\n\t\tstatus = win32service.QueryServiceStatus(self.service)\n\t\tif ((status[0] & win32service.SERVICE_KERNEL_DRIVER) or\n\t\t\t\t(status[0] & win32service.SERVICE_FILE_SYSTEM_DRIVER)):\n\t\t\t# driver\n\t\t\tself.GetDlgItem(self.IDC_LABEL).SetWindowText('Device:')\n\t\telse:\n\t\t\t# service\n\t\t\tself.GetDlgItem(self.IDC_LABEL).SetWindowText('Service:')\n\t\t\tself.GetDlgItem(self.IDC_BOOT).EnableWindow(0)\n\t\t\tself.GetDlgItem(self.IDC_SYSTEM).EnableWindow(0)\n\t\tself.GetDlgItem(self.IDC_DEVICE).SetWindowText(str(self.name))\n\n\t\treturn dialog.Dialog.OnInitDialog(self)", "metadata": "root.StartupDlg.OnInitDialog", "header": "['class', 'StartupDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 52 }, { "content": "\tdef OnOK(self):\n\t\tself.BeginWaitCursor()\n\t\tstarttype = self.GetCheckedRadioButton(self.IDC_BOOT, self.IDC_DISABLED) - self.IDC_BOOT\n\t\ttry:\n\t\t\twin32service.ChangeServiceConfig(self.service, win32service.SERVICE_NO_CHANGE, starttype,\n\t\t\t\twin32service.SERVICE_NO_CHANGE, None, None, 0, None, None, None, None)\n\t\texcept:\n\t\t\tself.MessageBox('Unable to change startup configuration', None,\n\t\t\t\twin32con.MB_ICONEXCLAMATION)\n\t\tself.EndWaitCursor()\n\t\treturn dialog.Dialog.OnOK(self)", "metadata": "root.StartupDlg.OnOK", "header": "['class', 'StartupDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 70 }, { "content": "\tdef GetResource(self):\n\t\tstyle = win32con.WS_POPUP | win32con.DS_SETFONT | win32con.WS_SYSMENU | win32con.WS_CAPTION | win32con.WS_VISIBLE | win32con.DS_MODALFRAME\n\t\texstyle = None\n\t\tt = [[\"Service Startup\", (6, 18, 188, 107), style, exstyle, (8, 'MS Shell Dlg')], ]\n\t\tt.append([130, \"Device:\", self.IDC_LABEL, (6, 7, 40, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([130, \"\", self.IDC_DEVICE, (48, 7, 134, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([128, \"Startup Type\", -1, (6, 21, 130, 80), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.BS_GROUPBOX])\n\t\tt.append([128, \"&Boot\", self.IDC_BOOT, (12, 33, 39, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])\n\t\tt.append([128, \"&System\", self.IDC_SYSTEM, (12, 46, 39, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])\n\t\tt.append([128, \"&Automatic\", self.IDC_AUTOMATIC, (12, 59, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])\n\t\tt.append([128, \"&Manual\", self.IDC_MANUAL, (12, 72, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])\n\t\tt.append([128, \"&Disabled\", self.IDC_DISABLED, (12, 85, 118, 10), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_AUTORADIOBUTTON])\n\t\tt.append([128, \"OK\", win32con.IDOK, (142, 25, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.WS_GROUP | win32con.BS_DEFPUSHBUTTON])\n\t\tt.append([128, \"Cancel\", win32con.IDCANCEL, (142, 43, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"&Help\", win32con.IDHELP, (142, 61, 40, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\treturn t", "metadata": "root.StartupDlg.GetResource", "header": "['class', 'StartupDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 82 }, { "content": "class ServiceDlg(dialog.Dialog):\n\n\tIDC_LIST = 128\n\tIDC_START = 129\n\tIDC_STOP = 130\n\tIDC_PAUSE = 131\n\tIDC_CONTINUE = 132\n\tIDC_STARTUP = 133\n\tIDC_PROFILES = 134\n\tIDC_PARAMS = 135\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ServiceDlg", "header": "['module', '___EOS___']", "index": 99 }, { "content": "\tdef __init__(self, machineName = ''):\n\t\tdialog.Dialog.__init__(self, self.GetResource())\n\t\tself.HookCommand(self.OnListEvent, self.IDC_LIST)\n\t\tself.HookCommand(self.OnStartCmd, self.IDC_START)\n\t\tself.HookCommand(self.OnStopCmd, self.IDC_STOP)\n\t\tself.HookCommand(self.OnPauseCmd, self.IDC_PAUSE)\n\t\tself.HookCommand(self.OnContinueCmd, self.IDC_CONTINUE)\n\t\tself.HookCommand(self.OnStartupCmd, self.IDC_STARTUP)\n\t\tself.machineName = machineName\n\t\tself.scm = win32service.OpenSCManager(self.machineName, None, win32service.SC_MANAGER_ALL_ACCESS)", "metadata": "root.ServiceDlg.__init__", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 110 }, { "content": "\tdef __del__(self):\n\t\twin32service.CloseServiceHandle(self.scm)", "metadata": "root.ServiceDlg.__del__", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 121 }, { "content": "\tdef OnInitDialog(self):\n\t\tself.listCtrl = self.GetDlgItem(self.IDC_LIST)\n\t\tself.listCtrl.SetTabStops([158, 200])\n\t\tif self.machineName:\n\t\t\tself.SetWindowText(\"Services on %s\" % self.machineName)\n\t\tself.ReloadData()\n\t\treturn dialog.Dialog.OnInitDialog(self)", "metadata": "root.ServiceDlg.OnInitDialog", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 124 }, { "content": "\tdef ReloadData(self):\n\t\tservice = self.GetSelService()\n\t\tself.listCtrl.SetRedraw(0)\n\t\tself.listCtrl.ResetContent()\n\t\tsvcs = win32service.EnumServicesStatus(self.scm)\n\t\ti = 0\n\t\tself.data = []\n\t\tfor svc in svcs:\n\t\t\ttry:\n\t\t\t\tstatus = ('Unknown', 'Stopped', 'Starting', 'Stopping', 'Running',\n\t\t\t\t\t'Continuing', 'Pausing', 'Paused')[svc[2][1]]\n\t\t\texcept:\n\t\t\t\tstatus = 'Unknown'\n\t\t\ts = win32service.OpenService(self.scm, svc[0], win32service.SERVICE_ALL_ACCESS)\n\t\t\tcfg = win32service.QueryServiceConfig(s)\n\t\t\ttry:\n\t\t\t\tstartup = ('Boot', 'System', 'Automatic', 'Manual', 'Disabled')[cfg[1]]\n\t\t\texcept:\n\t\t\t\tstartup = 'Unknown'\n\t\t\twin32service.CloseServiceHandle(s)\n\n\t\t\t# svc[2][2] control buttons\n\t\t\tpos = self.listCtrl.AddString(str(svc[1]) + '\\t' + status + '\\t' + startup)\n\t\t\tself.listCtrl.SetItemData(pos, i)\n\t\t\tself.data.append(tuple(svc[2]) + (svc[1], svc[0], ))\n\t\t\ti = i + 1\n\n\t\t\tif service and service[1] == svc[0]:\n\t\t\t\tself.listCtrl.SetCurSel(pos)\n\t\tself.OnListEvent(self.IDC_LIST, win32con.LBN_SELCHANGE)\n\t\tself.listCtrl.SetRedraw(1)", "metadata": "root.ServiceDlg.ReloadData", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 132 }, { "content": " \tdef OnListEvent(self, id, code):\n\t\tif code == win32con.LBN_SELCHANGE or code == win32con.LBN_SELCANCEL:\n\t\t\tpos = self.listCtrl.GetCurSel()\n\t\t\tif pos >= 0:\n\t\t\t\tdata = self.data[self.listCtrl.GetItemData(pos)][2]\n\t\t\t\tcanstart = (self.data[self.listCtrl.GetItemData(pos)][1] == win32service.SERVICE_STOPPED)\n\t\t\telse:\n\t\t\t\tdata = 0\n\t\t\t\tcanstart = 0\n\t\t\tself.GetDlgItem(self.IDC_START).EnableWindow(canstart)\n\t\t\tself.GetDlgItem(self.IDC_STOP).EnableWindow(data & win32service.SERVICE_ACCEPT_STOP)\n\t\t\tself.GetDlgItem(self.IDC_PAUSE).EnableWindow(data & win32service.SERVICE_ACCEPT_PAUSE_CONTINUE)\n\t\t\tself.GetDlgItem(self.IDC_CONTINUE).EnableWindow(data & win32service.SERVICE_ACCEPT_PAUSE_CONTINUE)", "metadata": "root.ServiceDlg.OnListEvent", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 164 }, { "content": "\tdef GetSelService(self):\n\t\tpos = self.listCtrl.GetCurSel()\n\t\tif pos < 0:\n\t\t\treturn None\n\t\tpos = self.listCtrl.GetItemData(pos)\n\t\treturn self.data[pos][-2:]", "metadata": "root.ServiceDlg.GetSelService", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 178 }, { "content": " \tdef OnStartCmd(self, id, code):\n\t\tservice = self.GetSelService()\n\t\tif not service:\n\t\t\treturn\n\t\ts = win32service.OpenService(self.scm, service[1], win32service.SERVICE_ALL_ACCESS)\n\t\twin32service.StartService(s, None)\n\t\twin32service.CloseServiceHandle(s)\n\t\tself.ReloadData()", "metadata": "root.ServiceDlg.OnStartCmd", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 185 }, { "content": " \tdef OnStopCmd(self, id, code):\n\t\tservice = self.GetSelService()\n\t\tif not service:\n\t\t\treturn\n\t\ts = win32service.OpenService(self.scm, service[1], win32service.SERVICE_ALL_ACCESS)\n\t\twin32service.ControlService(s, win32service.SERVICE_CONTROL_STOP)\n\t\twin32service.CloseServiceHandle(s)\n\t\tself.ReloadData()", "metadata": "root.ServiceDlg.OnStopCmd", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 194 }, { "content": " \tdef OnPauseCmd(self, id, code):\n\t\tservice = self.GetSelService()\n\t\tif not service:\n\t\t\treturn\n\t\ts = win32service.OpenService(self.scm, service[1], win32service.SERVICE_ALL_ACCESS)\n\t\twin32service.ControlService(s, win32service.SERVICE_CONTROL_PAUSE)\n\t\twin32service.CloseServiceHandle(s)\n\t\tself.ReloadData()", "metadata": "root.ServiceDlg.OnPauseCmd", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 203 }, { "content": " \tdef OnContinueCmd(self, id, code):\n\t\tservice = self.GetSelService()\n\t\tif not service:\n\t\t\treturn\n\t\ts = win32service.OpenService(self.scm, service[1], win32service.SERVICE_ALL_ACCESS)\n\t\twin32service.ControlService(s, win32service.SERVICE_CONTROL_CONTINUE)\n\t\twin32service.CloseServiceHandle(s)\n\t\tself.ReloadData()", "metadata": "root.ServiceDlg.OnContinueCmd", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 212 }, { "content": " \tdef OnStartupCmd(self, id, code):\n\t\tservice = self.GetSelService()\n\t\tif not service:\n\t\t\treturn\n\t\ts = win32service.OpenService(self.scm, service[1], win32service.SERVICE_ALL_ACCESS)\n\t\tif StartupDlg(service[0], s).DoModal() == win32con.IDOK:\n\t\t\tself.ReloadData()", "metadata": "root.ServiceDlg.OnStartupCmd", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 221 }, { "content": "\tdef GetResource(self):\n\t\tstyle = win32con.WS_POPUP | win32con.DS_SETFONT | win32con.WS_SYSMENU | win32con.WS_CAPTION | win32con.WS_VISIBLE | win32con.DS_MODALFRAME\n\t\texstyle = None\n\t\tt = [[\"Services\", (16, 16, 333, 157), style, exstyle, (8, 'MS Shell Dlg')], ]\n\t\tt.append([130, \"Ser&vice\", -1, (6, 6, 70, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([130, \"Status\", -1, (164, 6, 42, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([130, \"Startup\", -1, (206, 6, 50, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([131, \"\", self.IDC_LIST, (6, 16, 255, 106), win32con.LBS_USETABSTOPS | win32con.LBS_SORT | win32con.LBS_NOINTEGRALHEIGHT | win32con.WS_BORDER | win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_TABSTOP | win32con.LBS_NOTIFY | win32con.WS_VSCROLL])\n\t\tt.append([128, \"Close\", win32con.IDOK, (267, 6, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.WS_TABSTOP | win32con.BS_DEFPUSHBUTTON])\n\t\tt.append([128, \"&Start\", self.IDC_START, (267, 27, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"S&top\", self.IDC_STOP, (267, 44, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"&Pause\", self.IDC_PAUSE, (267, 61, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"&Continue\", self.IDC_CONTINUE, (267, 78, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"Sta&rtup...\", self.IDC_STARTUP, (267, 99, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"H&W Profiles...\", self.IDC_PROFILES, (267, 116, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([128, \"&Help\", win32con.IDHELP, (267, 137, 60, 14), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_TABSTOP | win32con.BS_PUSHBUTTON])\n\t\tt.append([130, \"St&artup Parameters:\", -1, (6, 128, 70, 8), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.SS_LEFT])\n\t\tt.append([129, \"\", self.IDC_PARAMS, (6, 139, 247, 12), win32con.WS_VISIBLE | win32con.WS_CHILD | win32con.WS_GROUP | win32con.WS_BORDER | win32con.ES_AUTOHSCROLL])\n\t\treturn t", "metadata": "root.ServiceDlg.GetResource", "header": "['class', 'ServiceDlg', '(', 'dialog', '.', 'Dialog', ')', ':', '___EOS___']", "index": 229 } ]
[ { "span": "import win32ui", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Control", "Service", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "simple", " ", "app", " ", "whi", "ch", " ", "duplicat", "es", " ", "some", " ", "of", " ", "the", " ", "functional", "it", "y", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Service", "s", " ", "applet", " ", "of", " ", "the", " ", "control", " ", "panel", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sug", "gest", "ed", " ", "enhance", "ment", "s", " ", "(", "in", " ", "no", " ", "partic", "ular", " ", "order", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Whe", "n", " ", "chang", "ing", " ", "the", " ", "service", " ", "status", ",", " ", "continue", " ", "to", " ", "query", " ", "the", " ", "status_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "service", " ", "unti", "l", " ", "the", " ", "status", " ", "change", " ", "is", " ", "complete", ".", " ", " ", "Us", "e", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "informati", "on", " ", "to", " ", "put", " ", "up", " ", "some", " ", "kind", " ", "of", " ", "a", " ", "progress", " ", "dialog", " ", "like", " ", "the", " ", "CP_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "applet", " ", "doe", "s", ".", " ", " ", "Unli", "ke", " ", "the", " ", "CP", ",", " ", "allow", " ", "cancel", "ing", " ", "out", " ", "in", " ", "the", " ", "event", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "status", " ", "change", " ", "hang", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Whe", "n", " ", "startin", "g", " ", "or", " ", "stopping", " ", "a", " ", "service", " ", "with", " ", "dependen", "cies", ",", " ", "alert_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "user", " ", "abo", "ut", " ", "the", " ", "dependent", " ", "service", "s", ",", " ", "then", " ", "start", " ", "(", "or", " ", "stop", ")", " ", "all_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dependent", " ", "service", "s", " ", "as", " ", "appropr", "iate", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", ".", " ", "All", "ow", " ", "tog", "glin", "g", " ", "bet", "ween", " ", "service", " ", "view", " ", "and", " ", "device", " ", "view_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "4", ".", " ", "All", "ow", " ", "configura", "tion", " ", "of", " ", "other", " ", "service", " ", "parameter", "s", " ", "suc", "h", " ", "as", " ", "startup_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "name", " ", "and", " ", "password", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "5", ".", " ", "All", "ow", " ", "connecti", "on", " ", "to", " ", "remote", " ", "SCM", "s", ".", " ", " ", "Thi", "s", " ", "is", " ", "just", " ", "a", " ", "matte", "r", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reconnect", "ing", " ", "to", " ", "the", " ", "SCM", " ", "on", " ", "the", " ", "remote", " ", "machine", ";", " ", "the", " ", "rest", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "code", " ", "shou", "ld", " ", "still", " ", "work", " ", "the", " ", "same", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "6", ".", " ", "Ei", "ther", " ", "implement", " ", "the", " ", "start", "up", " ", "parameter", "s", " ", "or", " ", "get", " ", "rid", " ", "of", " ", "the", " ", "edit", "box", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "7", ".", " ", "Ei", "ther", " ", "implement", " ", "or", " ", "get", " ", "rid", " ", "of", " ", "\"", "H", "/", "W", " ", "Profil", "es", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "8", ".", " ", "Ei", "ther", " ", "implement", " ", "or", " ", "get", " ", "rid", " ", "of", " ", "\"", "Help", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "9", ".", " ", "Impro", "ve", " ", "error", " ", "handling", ".", " ", " ", "Ideal", "ly", ",", " ", "this", " ", "wou", "ld", " ", "als", "o", " ", "include", " ", "falling", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", " ", "to", " ", "lower", " ", "level", "s", " ", "of", " ", "functional", "it", "y", " ", "for", " ", "users", " ", "with", " ", "less", " ", "rights", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rig", "ht", " ", "now", ",", " ", "we", " ", "alw", "ay", "s", " ", "try", " ", "to", " ", "get", " ", "all", " ", "the", " ", "rights", " ", "and", " ", "fail", " ", "whe", "n", " ", "we", " ", "can", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pywi", "n_", "._", "mfc", "_", "import_", "dialog_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "ui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32con_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "service_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "machine_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "machine_", "=_", "sys_", "._", "argv_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Service", "Dlg_", "(_", "machine_", ")_", "._", "Do", "Modal_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "ID", "C", "\\u", "LABEL_", "=_", "127_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "DEVICE_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "BOOT", "_", "=_", "129_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "SYSTEM", "_", "=_", "130_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "AUTOMATIC", "_", "=_", "131_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "MANU", "AL_", "=_", "132_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "DISABLED_", "=_", "133_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "displayname", "_", ",_", "service_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "dialog_", "._", "Dialog_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "self_", "._", "Get", "Resource_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "displayname", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "=_", "service_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\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\t", "\t_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "self_", "._", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Ini", "t", "Dialog_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "cfg_", "=_", "win32", "service_", "._", "Query", "Service", "Config_", "(_", "self_", "._", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "BOOT", "_", "+_", "cfg_", "[_", "1_", "]_", ")_", "._", "Set", "Check_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "status_", "=_", "win32", "service_", "._", "Query", "Service", "Status_", "(_", "self_", "._", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "status_", "[_", "0_", "]_", "&_", "win32", "service_", "._", "SERV", "ICE", "\\u", "KERN", "EL", "\\u", "DRIVER", "_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "status_", "[_", "0_", "]_", "&_", "win32", "service_", "._", "SERV", "ICE", "\\u", "FILE", "\\u", "SYSTEM", "\\u", "DRIVER", "_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "driver_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "LABEL_", ")_", "._", "Set", "Window", "Text_", "(_", "'", "Dev", "ice", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "service_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "LABEL_", ")_", "._", "Set", "Window", "Text_", "(_", "'", "Service", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "BOOT", "_", ")_", "._", "Enable", "Window_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "SYSTEM", "_", ")_", "._", "Enable", "Window_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "DEVICE_", ")_", "._", "Set", "Window", "Text_", "(_", "str_", "(_", "self_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dialog_", "._", "Dialog_", "._", "On", "Ini", "t", "Dialog_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "OK_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "Begin", "Wait", "Cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "startt", "ype_", "=_", "self_", "._", "Get", "Check", "ed", "Radio", "Button_", "(_", "self_", "._", "ID", "C", "\\u", "BOOT", "_", ",_", "self_", "._", "ID", "C", "\\u", "DISABLED_", ")_", "-_", "self_", "._", "ID", "C", "\\u", "BOOT", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "win32", "service_", "._", "Change", "Service", "Config_", "(_", "self_", "._", "service_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "NO", "\\u", "CHANGE", "_", ",_", "startt", "ype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "win32", "service_", "._", "SERV", "ICE", "\\u", "NO", "\\u", "CHANGE", "_", ",_", "None_", ",_", "None_", ",_", "0_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "Messag", "e", "Box_", "(_", "'", "Una", "ble", " ", "to", " ", "change", " ", "start", "up", " ", "configura", "tion", "'_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "win32con_", "._", "MB", "\\u", "ICON", "EXC", "LAM", "ATION_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "End", "Wait", "Cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dialog_", "._", "Dialog_", "._", "On", "OK_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Start", "up", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Get", "Resource_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "style_", "=_", "win32con_", "._", "WS", "\\u", "POP", "UP_", "|_", "win32con_", "._", "DS", "\\u", "SET", "FONT_", "|_", "win32con_", "._", "WS", "\\u", "SYS", "MENU_", "|_", "win32con_", "._", "WS", "\\u", "CAPT", "ION_", "|_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "DS", "\\u", "MOD", "AL", "FRAME", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "style_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "[_", "[_", "\"", "Service", " ", "Start", "up", "\"_", ",_", "(_", "6_", ",_", "18_", ",_", "188_", ",_", "107_", ")_", ",_", "style_", ",_", "ex", "style_", ",_", "(_", "8_", ",_", "'", "MS", " ", "Shel", "l", " ", "Dl", "g", "'_", ")_", "]_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"", "Dev", "ice", ":\"_", ",_", "self_", "._", "ID", "C", "\\u", "LABEL_", ",_", "(_", "6_", ",_", "7_", ",_", "40_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"\"_", ",_", "self_", "._", "ID", "C", "\\u", "DEVICE_", ",_", "(_", "48_", ",_", "7_", ",_", "134_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "Start", "up", " ", "Type", "\"_", ",_", "-_", "1_", ",_", "(_", "6_", ",_", "21_", ",_", "130_", ",_", "80_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "GROUP_", "|_", "win32con_", "._", "BS", "\\u", "GROU", "PB", "OX", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Boot", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "BOOT", "_", ",_", "(_", "12_", ",_", "33_", ",_", "39_", ",_", "10_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "AUTO", "RADI", "OB", "UT", "TON", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "System", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "SYSTEM", "_", ",_", "(_", "12_", ",_", "46_", ",_", "39_", ",_", "10_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "AUTO", "RADI", "OB", "UT", "TON", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Automat", "ic", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "AUTOMATIC", "_", ",_", "(_", "12_", ",_", "59_", ",_", "118_", ",_", "10_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "AUTO", "RADI", "OB", "UT", "TON", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Manu", "al", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "MANU", "AL_", ",_", "(_", "12_", ",_", "72_", ",_", "118_", ",_", "10_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "AUTO", "RADI", "OB", "UT", "TON", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Disa", "ble", "d", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "DISABLED_", ",_", "(_", "12_", ",_", "85_", ",_", "118_", ",_", "10_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "AUTO", "RADI", "OB", "UT", "TON", "_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "OK", "\"_", ",_", "win32con_", "._", "ID", "OK_", ",_", "(_", "142_", ",_", "25_", ",_", "40_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "WS", "\\u", "GROUP_", "|_", "win32con_", "._", "BS", "\\u", "DEF", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "Cancel", "\"_", ",_", "win32con_", "._", "ID", "CANCEL_", ",_", "(_", "142_", ",_", "43_", ",_", "40_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Help", "\"_", ",_", "win32con_", "._", "ID", "HELP_", ",_", "(_", "142_", ",_", "61_", ",_", "40_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "ID", "C", "\\u", "LIST_", "=_", "128_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "START_", "=_", "129_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "STOP_", "=_", "130_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "PAUSE", "_", "=_", "131_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "CONTINUE", "_", "=_", "132_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "START", "UP_", "=_", "133_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "PROFILE", "S_", "=_", "134_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ID", "C", "\\u", "PARAMS_", "=_", "135_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "machine", "Name_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "dialog_", "._", "Dialog_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "self_", "._", "Get", "Resource_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "List", "Event_", ",_", "self_", "._", "ID", "C", "\\u", "LIST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "Start", "Cmd_", ",_", "self_", "._", "ID", "C", "\\u", "START_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "Sto", "p", "Cmd_", ",_", "self_", "._", "ID", "C", "\\u", "STOP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "Pause", "Cmd_", ",_", "self_", "._", "ID", "C", "\\u", "PAUSE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "Continu", "e", "Cmd_", ",_", "self_", "._", "ID", "C", "\\u", "CONTINUE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Hook", "Command_", "(_", "self_", "._", "On", "Start", "up", "Cmd_", ",_", "self_", "._", "ID", "C", "\\u", "START", "UP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine", "Name_", "=_", "machine", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scm_", "=_", "win32", "service_", "._", "Open", "SCM", "anager", "_", "(_", "self_", "._", "machine", "Name_", ",_", "None_", ",_", "win32", "service_", "._", "SC", "\\u", "MANAGER", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\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\t", "\t_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "self_", "._", "scm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Ini", "t", "Dialog_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "self_", "._", "list", "Ctrl_", "=_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "LIST_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Ctrl_", "._", "Set", "Tab", "Stops", "_", "(_", "[_", "158_", ",_", "200_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "machine", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "Set", "Window", "Text_", "(_", "\"", "Service", "s", " ", "on", " ", "%", "s", "\"_", "%_", "self_", "._", "machine", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "dialog_", "._", "Dialog_", "._", "On", "Ini", "t", "Dialog_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Relo", "ad", "Data_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Ctrl_", "._", "Set", "Red", "raw_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Ctrl_", "._", "Reset", "Content_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "svc", "s_", "=_", "win32", "service_", "._", "Enum", "Service", "s", "Status_", "(_", "self_", "._", "scm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "svc_", "in_", "svc", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "status_", "=_", "(_", "'", "Un", "know", "n", "'_", ",_", "'", "Stopp", "ed", "'_", ",_", "'", "Start", "ing", "'_", ",_", "'", "Stopp", "ing", "'_", ",_", "'", "Run", "ning", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Continu", "ing", "'_", ",_", "'", "Pa", "usi", "ng", "'_", ",_", "'", "Pause", "d", "'_", ")_", "[_", "svc_", "[_", "2_", "]_", "[_", "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\t", "\t\t\t_", "status_", "=_", "'", "Un", "know", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "svc_", "[_", "0_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "=_", "win32", "service_", "._", "Query", "Service", "Config_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "startup_", "=_", "(_", "'", "Boot", "'_", ",_", "'", "System", "'_", ",_", "'", "Automat", "ic", "'_", ",_", "'", "Manu", "al", "'_", ",_", "'", "Disa", "ble", "d", "'_", ")_", "[_", "cfg_", "[_", "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\t", "\t\t\t_", "startup_", "=_", "'", "Un", "know", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "svc", "[", "2", "][", "2", "]", " ", "control", " ", "buttons_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "self_", "._", "list", "Ctrl_", "._", "Add", "String_", "(_", "str_", "(_", "svc_", "[_", "1_", "]_", ")_", "+_", "'\\\\", "t", "'_", "+_", "status_", "+_", "'\\\\", "t", "'_", "+_", "startup_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Ctrl_", "._", "Set", "Item", "Data_", "(_", "pos_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "data_", "._", "append_", "(_", "tuple_", "(_", "svc_", "[_", "2_", "]_", ")_", "+_", "(_", "svc_", "[_", "1_", "]_", ",_", "svc_", "[_", "0_", "]_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "i_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "service_", "and_", "service_", "[_", "1_", "]_", "==_", "svc_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "self_", "._", "list", "Ctrl_", "._", "Set", "Cur", "Sel", "_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "On", "List", "Event_", "(_", "self_", "._", "ID", "C", "\\u", "LIST_", ",_", "win32con_", "._", "LB", "N", "\\u", "SEL", "CHANGE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "Ctrl_", "._", "Set", "Red", "raw_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "List", "Event_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "code_", "==_", "win32con_", "._", "LB", "N", "\\u", "SEL", "CHANGE", "_", "or_", "code_", "==_", "win32con_", "._", "LB", "N", "\\u", "SEL", "CANCEL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "pos_", "=_", "self_", "._", "list", "Ctrl_", "._", "Get", "Cur", "Sel", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pos_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "data_", "=_", "self_", "._", "data_", "[_", "self_", "._", "list", "Ctrl_", "._", "Get", "Item", "Data_", "(_", "pos_", ")_", "]_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "start_", "=_", "(_", "self_", "._", "data_", "[_", "self_", "._", "list", "Ctrl_", "._", "Get", "Item", "Data_", "(_", "pos_", ")_", "]_", "[_", "1_", "]_", "==_", "win32", "service_", "._", "SERV", "ICE", "\\u", "STOPPED", "_", ")_", "\\u\\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_", "data_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "can", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "START_", ")_", "._", "Enable", "Window_", "(_", "can", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "STOP_", ")_", "._", "Enable", "Window_", "(_", "data_", "&_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ACCEPT", "\\u", "STOP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "PAUSE", "_", ")_", "._", "Enable", "Window_", "(_", "data_", "&_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ACCEPT", "\\u", "PAUSE", "\\u", "CONTINUE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Get", "Dl", "g", "Item_", "(_", "self_", "._", "ID", "C", "\\u", "CONTINUE", "_", ")_", "._", "Enable", "Window_", "(_", "data_", "&_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ACCEPT", "\\u", "PAUSE", "\\u", "CONTINUE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\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", "Sel", "Service_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "pos_", "=_", "self_", "._", "list", "Ctrl_", "._", "Get", "Cur", "Sel", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pos_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pos_", "=_", "self_", "._", "list", "Ctrl_", "._", "Get", "Item", "Data_", "(_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "data_", "[_", "pos_", "]_", "[_", "-_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Start", "Cmd_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "service_", "[_", "1_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Start", "Service_", "(_", "s_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Sto", "p", "Cmd_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "service_", "[_", "1_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Control", "Service_", "(_", "s_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "CONTR", "OL", "\\u", "STOP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Pause", "Cmd_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "service_", "[_", "1_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Control", "Service_", "(_", "s_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "CONTR", "OL", "\\u", "PAUSE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Continu", "e", "Cmd_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "service_", "[_", "1_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Control", "Service_", "(_", "s_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "CONTR", "OL", "\\u", "CONTINUE", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "service_", "._", "Clos", "e", "Service", "Handle_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "On", "Start", "up", "Cmd_", "(_", "self_", ",_", "id_", ",_", "code_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "service_", "=_", "self_", "._", "Get", "Sel", "Service_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "service_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "win32", "service_", "._", "Open", "Service_", "(_", "self_", "._", "scm_", ",_", "service_", "[_", "1_", "]_", ",_", "win32", "service_", "._", "SERV", "ICE", "\\u", "ALL", "\\u", "ACCESS", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Start", "up", "Dlg_", "(_", "service_", "[_", "0_", "]_", ",_", "s_", ")_", "._", "Do", "Modal_", "(_", ")_", "==_", "win32con_", "._", "ID", "OK_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "self_", "._", "Relo", "ad", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Service", "Dlg_", "(_", "dialog_", "._", "Dialog_", ")_", ":_", "\\u\\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", "Resource_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "style_", "=_", "win32con_", "._", "WS", "\\u", "POP", "UP_", "|_", "win32con_", "._", "DS", "\\u", "SET", "FONT_", "|_", "win32con_", "._", "WS", "\\u", "SYS", "MENU_", "|_", "win32con_", "._", "WS", "\\u", "CAPT", "ION_", "|_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "DS", "\\u", "MOD", "AL", "FRAME", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ex", "style_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "[_", "[_", "\"", "Service", "s", "\"_", ",_", "(_", "16_", ",_", "16_", ",_", "333_", ",_", "157_", ")_", ",_", "style_", ",_", "ex", "style_", ",_", "(_", "8_", ",_", "'", "MS", " ", "Shel", "l", " ", "Dl", "g", "'_", ")_", "]_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"", "Ser", "&", "vice", "\"_", ",_", "-_", "1_", ",_", "(_", "6_", ",_", "6_", ",_", "70_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"", "Status", "\"_", ",_", "-_", "1_", ",_", "(_", "164_", ",_", "6_", ",_", "42_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"", "Start", "up", "\"_", ",_", "-_", "1_", ",_", "(_", "206_", ",_", "6_", ",_", "50_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "131_", ",_", "\"\"_", ",_", "self_", "._", "ID", "C", "\\u", "LIST_", ",_", "(_", "6_", ",_", "16_", ",_", "255_", ",_", "106_", ")_", ",_", "win32con_", "._", "LB", "S", "\\u", "USE", "TAB", "STOP", "S_", "|_", "win32con_", "._", "LB", "S", "\\u", "SORT", "_", "|_", "win32con_", "._", "LB", "S", "\\u", "NO", "INTEG", "RAL", "HEIGHT_", "|_", "win32con_", "._", "WS", "\\u", "BORDER", "_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "LB", "S", "\\u", "NOTIF", "Y_", "|_", "win32con_", "._", "WS", "\\u", "VS", "CRO", "LL_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "Clos", "e", "\"_", ",_", "win32con_", "._", "ID", "OK_", ",_", "(_", "267", "_", ",_", "6_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "GROUP_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "DEF", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Start", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "START_", ",_", "(_", "267", "_", ",_", "27_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "S", "&", "top", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "STOP_", ",_", "(_", "267", "_", ",_", "44_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Pause", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "PAUSE", "_", ",_", "(_", "267", "_", ",_", "61_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Continu", "e", "\"_", ",_", "self_", "._", "ID", "C", "\\u", "CONTINUE", "_", ",_", "(_", "267", "_", ",_", "78_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "Sta", "&", "rtu", "p", "...\"_", ",_", "self_", "._", "ID", "C", "\\u", "START", "UP_", ",_", "(_", "267", "_", ",_", "99_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"", "H", "&", "W", " ", "Profil", "es", "...\"_", ",_", "self_", "._", "ID", "C", "\\u", "PROFILE", "S_", ",_", "(_", "267", "_", ",_", "116_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "128_", ",_", "\"&", "Help", "\"_", ",_", "win32con_", "._", "ID", "HELP_", ",_", "(_", "267", "_", ",_", "137_", ",_", "60_", ",_", "14_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "WS", "\\u", "TAB", "STOP_", "|_", "win32con_", "._", "BS", "\\u", "PUSH", "BUTTON_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "130_", ",_", "\"", "St", "&", "art", "up", " ", "Parameter", "s", ":\"_", ",_", "-_", "1_", ",_", "(_", "6_", ",_", "128_", ",_", "70_", ",_", "8_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "SS", "\\u", "LEFT_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "append_", "(_", "[_", "129_", ",_", "\"\"_", ",_", "self_", "._", "ID", "C", "\\u", "PARAMS_", ",_", "(_", "6_", ",_", "139_", ",_", "247_", ",_", "12_", ")_", ",_", "win32con_", "._", "WS", "\\u", "VISI", "BLE_", "|_", "win32con_", "._", "WS", "\\u", "CHILD", "_", "|_", "win32con_", "._", "W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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 ]
Unused import
Arelle/Arelle/arelle/CntlrCmdLine.py
[ { "content": "'''\nCreated on Oct 3, 2010\n\nThis module is Arelle's controller in command line non-interactive mode\n\n(This module can be a pattern for custom integration of Arelle into an application.)\n\n@author: Mark V Systems Limited\n(c) Copyright 2010 Mark V Systems Limited, All rights reserved.\n'''\nfrom arelle import PythonUtil # define 2.x or 3.x string types\nimport gettext, time, datetime, os, shlex, sys, traceback, fnmatch, threading, json, logging\nfrom optparse import OptionParser, SUPPRESS_HELP\nimport re\nfrom arelle import (Cntlr, FileSource, ModelDocument, XmlUtil, Version, \n ViewFileDTS, ViewFileFactList, ViewFileFactTable, ViewFileConcepts, \n ViewFileFormulae, ViewFileRelationshipSet, ViewFileTests, ViewFileRssFeed,\n ViewFileRoleTypes,\n ModelManager)\nfrom arelle.ModelValue import qname\nfrom arelle.Locale import format_string\nfrom arelle.ModelFormulaObject import FormulaOptions\nfrom arelle import PluginManager\nfrom arelle.PluginManager import pluginClassMethods\nfrom arelle.UrlUtil import isHttpUrl\nfrom arelle.WebCache import proxyTuple\nimport logging\nfrom lxml import etree\nwin32file = win32api = win32process = pywintypes = None\nSTILL_ACTIVE = 259 # MS Windows process status constants\nPROCESS_QUERY_INFORMATION = 0x400\n\n \n \n \n \n\nif __name__ == \"__main__\":\n '''\n if '--COMserver' in sys.argv:\n from arelle import CntlrComServer\n CntlrComServer.main()\n else:\n main()\n '''\n main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def main():\n \"\"\"Main program to initiate application from command line or as a separate process (e.g, java Runtime.getRuntime().exec). May perform\n a command line request, or initiate a web server on specified local port.\n \n :param argv: Command line arguments. (Currently supported arguments can be displayed by the parameter *--help*.)\n :type message: [str]\n \"\"\"\n envArgs = os.getenv(\"ARELLE_ARGS\")\n if envArgs:\n args = shlex.split(envArgs)\n else:\n args = sys.argv[1:]\n \n gettext.install(\"arelle\") # needed for options messages\n parseAndRun(args)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def wsgiApplication(extraArgs=[]): # for example call wsgiApplication([\"--plugins=EdgarRenderer\"])\n return parseAndRun( [\"--webserver=::wsgi\"] + extraArgs )", "metadata": "root.wsgiApplication", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def parseAndRun(args):\n \"\"\"interface used by Main program and py.test (arelle_test.py)\n \"\"\"\n try:\n from arelle import webserver\n hasWebServer = True\n except ImportError:\n hasWebServer = False\n cntlr = CntlrCmdLine() # need controller for plug ins to be loaded\n usage = \"usage: %prog [options]\"\n \n parser = OptionParser(usage, \n version=\"Arelle(r) {0}bit {1}\".format(cntlr.systemWordSize, Version.version),\n conflict_handler=\"resolve\") # allow reloading plug-in options without errors\n parser.add_option(\"-f\", \"--file\", dest=\"entrypointFile\",\n help=_(\"FILENAME is an entry point, which may be \"\n \"an XBRL instance, schema, linkbase file, \"\n \"inline XBRL instance, testcase file, \"\n \"testcase index file. FILENAME may be \"\n \"a local file or a URI to a web located file. \"\n \"For multiple instance filings may be | separated file names or JSON list \"\n \"of file/parameter dicts [{\\\"file\\\":\\\"filepath\\\"}, {\\\"file\\\":\\\"file2path\\\"} ...].\"))\n parser.add_option(\"--username\", dest=\"username\",\n help=_(\"user name if needed (with password) for web file retrieval\"))\n parser.add_option(\"--password\", dest=\"password\",\n help=_(\"password if needed (with user name) for web retrieval\"))\n # special option for web interfaces to suppress closing an opened modelXbrl\n parser.add_option(\"--keepOpen\", dest=\"keepOpen\", action=\"store_true\", help=SUPPRESS_HELP)\n parser.add_option(\"-i\", \"--import\", dest=\"importFiles\",\n help=_(\"FILENAME is a list of files to import to the DTS, such as \"\n \"additional formula or label linkbases. \"\n \"Multiple file names are separated by a '|' character. \"))\n parser.add_option(\"-d\", \"--diff\", dest=\"diffFile\",\n help=_(\"FILENAME is a second entry point when \"\n \"comparing (diffing) two DTSes producing a versioning report.\"))\n parser.add_option(\"-r\", \"--report\", dest=\"versReportFile\",\n help=_(\"FILENAME is the filename to save as the versioning report.\"))\n parser.add_option(\"-v\", \"--validate\",\n action=\"store_true\", dest=\"validate\",\n help=_(\"Validate the file according to the entry \"\n \"file type. If an XBRL file, it is validated \"\n \"according to XBRL validation 2.1, calculation linkbase validation \"\n \"if either --calcDecimals or --calcPrecision are specified, and \"\n \"SEC EDGAR Filing Manual (if --efm selected) or Global Filer Manual \"\n \"disclosure system validation (if --gfm=XXX selected). \"\n \"If a test suite or testcase, the test case variations \"\n \"are individually so validated. \"\n \"If formulae are present they will be validated and run unless --formula=none is specified. \"\n ))\n parser.add_option(\"--calcDecimals\", action=\"store_true\", dest=\"calcDecimals\",\n help=_(\"Specify calculation linkbase validation inferring decimals.\"))\n parser.add_option(\"--calcdecimals\", action=\"store_true\", dest=\"calcDecimals\", help=SUPPRESS_HELP)\n parser.add_option(\"--calcPrecision\", action=\"store_true\", dest=\"calcPrecision\",\n help=_(\"Specify calculation linkbase validation inferring precision.\"))\n parser.add_option(\"--calcprecision\", action=\"store_true\", dest=\"calcPrecision\", help=SUPPRESS_HELP)\n parser.add_option(\"--efm\", action=\"store_true\", dest=\"validateEFM\",\n help=_(\"Select Edgar Filer Manual (U.S. SEC) disclosure system validation (strict).\"))\n parser.add_option(\"--gfm\", action=\"store\", dest=\"disclosureSystemName\", help=SUPPRESS_HELP)\n parser.add_option(\"--disclosureSystem\", action=\"store\", dest=\"disclosureSystemName\",\n help=_(\"Specify a disclosure system name and\"\n \" select disclosure system validation. \"\n \"Enter --disclosureSystem=help for list of names or help-verbose for list of names and descriptions. \"))\n parser.add_option(\"--disclosuresystem\", action=\"store\", dest=\"disclosureSystemName\", help=SUPPRESS_HELP)\n parser.add_option(\"--hmrc\", action=\"store_true\", dest=\"validateHMRC\",\n help=_(\"Select U.K. HMRC disclosure system validation.\"))\n parser.add_option(\"--utr\", action=\"store_true\", dest=\"utrValidate\",\n help=_(\"Select validation with respect to Unit Type Registry.\"))\n parser.add_option(\"--utrUrl\", action=\"store\", dest=\"utrUrl\",\n help=_(\"Override disclosure systems Unit Type Registry location (URL or file path).\"))\n parser.add_option(\"--utrurl\", action=\"store\", dest=\"utrUrl\", help=SUPPRESS_HELP)\n parser.add_option(\"--infoset\", action=\"store_true\", dest=\"infosetValidate\",\n help=_(\"Select validation with respect testcase infosets.\"))\n parser.add_option(\"--labelLang\", action=\"store\", dest=\"labelLang\",\n help=_(\"Language for labels in following file options (override system settings)\"))\n parser.add_option(\"--labellang\", action=\"store\", dest=\"labelLang\", help=SUPPRESS_HELP)\n parser.add_option(\"--labelRole\", action=\"store\", dest=\"labelRole\",\n help=_(\"Label role for labels in following file options (instead of standard label)\"))\n parser.add_option(\"--labelrole\", action=\"store\", dest=\"labelRole\", help=SUPPRESS_HELP)\n parser.add_option(\"--DTS\", \"--csvDTS\", action=\"store\", dest=\"DTSFile\",\n help=_(\"Write DTS tree into FILE (may be .csv or .html)\"))\n parser.add_option(\"--facts\", \"--csvFacts\", action=\"store\", dest=\"factsFile\",\n help=_(\"Write fact list into FILE\"))\n parser.add_option(\"--factListCols\", action=\"store\", dest=\"factListCols\",\n help=_(\"Columns for fact list file\"))\n parser.add_option(\"--factTable\", \"--csvFactTable\", action=\"store\", dest=\"factTableFile\",\n help=_(\"Write fact table into FILE\"))\n parser.add_option(\"--concepts\", \"--csvConcepts\", action=\"store\", dest=\"conceptsFile\",\n help=_(\"Write concepts into FILE\"))\n parser.add_option(\"--pre\", \"--csvPre\", action=\"store\", dest=\"preFile\",\n help=_(\"Write presentation linkbase into FILE\"))\n parser.add_option(\"--cal\", \"--csvCal\", action=\"store\", dest=\"calFile\",\n help=_(\"Write calculation linkbase into FILE\"))\n parser.add_option(\"--dim\", \"--csvDim\", action=\"store\", dest=\"dimFile\",\n help=_(\"Write dimensions (of definition) linkbase into FILE\"))\n parser.add_option(\"--formulae\", \"--htmlFormulae\", action=\"store\", dest=\"formulaeFile\",\n help=_(\"Write formulae linkbase into FILE\"))\n parser.add_option(\"--viewArcrole\", action=\"store\", dest=\"viewArcrole\",\n help=_(\"Write linkbase relationships for viewArcrole into viewFile\"))\n parser.add_option(\"--viewarcrole\", action=\"store\", dest=\"viewArcrole\", help=SUPPRESS_HELP)\n parser.add_option(\"--viewFile\", action=\"store\", dest=\"viewFile\",\n help=_(\"Write linkbase relationships for viewArcrole into viewFile\"))\n parser.add_option(\"--viewfile\", action=\"store\", dest=\"viewFile\", help=SUPPRESS_HELP)\n parser.add_option(\"--roleTypes\", action=\"store\", dest=\"roleTypesFile\",\n help=_(\"Write defined role types into FILE\"))\n parser.add_option(\"--roletypes\", action=\"store\", dest=\"roleTypesFile\", help=SUPPRESS_HELP)\n parser.add_option(\"--arcroleTypes\", action=\"store\", dest=\"arcroleTypesFile\",\n help=_(\"Write defined arcrole types into FILE\"))\n parser.add_option(\"--arcroletypes\", action=\"store\", dest=\"arcroleTypesFile\", help=SUPPRESS_HELP)\n parser.add_option(\"--testReport\", \"--csvTestReport\", action=\"store\", dest=\"testReport\",\n help=_(\"Write test report of validation (of test cases) into FILE\"))\n parser.add_option(\"--testreport\", \"--csvtestreport\", action=\"store\", dest=\"testReport\", help=SUPPRESS_HELP)\n parser.add_option(\"--testReportCols\", action=\"store\", dest=\"testReportCols\",\n help=_(\"Columns for test report file\"))\n parser.add_option(\"--testreportcols\", action=\"store\", dest=\"testReportCols\", help=SUPPRESS_HELP)\n parser.add_option(\"--rssReport\", action=\"store\", dest=\"rssReport\",\n help=_(\"Write RSS report into FILE\"))\n parser.add_option(\"--rssreport\", action=\"store\", dest=\"rssReport\", help=SUPPRESS_HELP)\n parser.add_option(\"--rssReportCols\", action=\"store\", dest=\"rssReportCols\",\n help=_(\"Columns for RSS report file\"))\n parser.add_option(\"--rssreportcols\", action=\"store\", dest=\"rssReportCols\", help=SUPPRESS_HELP)\n parser.add_option(\"--skipDTS\", action=\"store_true\", dest=\"skipDTS\",\n help=_(\"Skip DTS activities (loading, discovery, validation), useful when an instance needs only to be parsed.\"))\n parser.add_option(\"--skipdts\", action=\"store_true\", dest=\"skipDTS\", help=SUPPRESS_HELP)\n parser.add_option(\"--skipLoading\", action=\"store\", dest=\"skipLoading\",\n help=_(\"Skip loading discovered or schemaLocated files matching pattern (unix-style file name patterns separated by '|'), useful when not all linkbases are needed.\"))\n parser.add_option(\"--skiploading\", action=\"store\", dest=\"skipLoading\", help=SUPPRESS_HELP)\n parser.add_option(\"--logFile\", action=\"store\", dest=\"logFile\",\n help=_(\"Write log messages into file, otherwise they go to standard output. \" \n \"If file ends in .xml it is xml-formatted, otherwise it is text. \"))\n parser.add_option(\"--logfile\", action=\"store\", dest=\"logFile\", help=SUPPRESS_HELP)\n parser.add_option(\"--logFormat\", action=\"store\", dest=\"logFormat\",\n help=_(\"Logging format for messages capture, otherwise default is \\\"[%(messageCode)s] %(message)s - %(file)s\\\".\"))\n parser.add_option(\"--logformat\", action=\"store\", dest=\"logFormat\", help=SUPPRESS_HELP)\n parser.add_option(\"--logLevel\", action=\"store\", dest=\"logLevel\",\n help=_(\"Minimum level for messages capture, otherwise the message is ignored. \" \n \"Current order of levels are debug, info, info-semantic, warning, warning-semantic, warning, assertion-satisfied, inconsistency, error-semantic, assertion-not-satisfied, and error. \"))\n parser.add_option(\"--loglevel\", action=\"store\", dest=\"logLevel\", help=SUPPRESS_HELP)\n parser.add_option(\"--logLevelFilter\", action=\"store\", dest=\"logLevelFilter\",\n help=_(\"Regular expression filter for logLevel. \" \n \"(E.g., to not match *-semantic levels, logLevelFilter=(?!^.*-semantic$)(.+). \"))\n parser.add_option(\"--loglevelfilter\", action=\"store\", dest=\"logLevelFilter\", help=SUPPRESS_HELP)\n parser.add_option(\"--logCodeFilter\", action=\"store\", dest=\"logCodeFilter\",\n help=_(\"Regular expression filter for log message code.\"))\n parser.add_option(\"--logcodefilter\", action=\"store\", dest=\"logCodeFilter\", help=SUPPRESS_HELP)\n parser.add_option(\"--statusPipe\", action=\"store\", dest=\"statusPipe\", help=SUPPRESS_HELP)\n parser.add_option(\"--monitorParentProcess\", action=\"store\", dest=\"monitorParentProcess\", help=SUPPRESS_HELP)\n parser.add_option(\"--outputAttribution\", action=\"store\", dest=\"outputAttribution\", help=SUPPRESS_HELP)\n parser.add_option(\"--outputattribution\", action=\"store\", dest=\"outputAttribution\", help=SUPPRESS_HELP)\n parser.add_option(\"--showOptions\", action=\"store_true\", dest=\"showOptions\", help=SUPPRESS_HELP)\n parser.add_option(\"--parameters\", action=\"store\", dest=\"parameters\", help=_(\"Specify parameters for formula and validation (name=value[,name=value]).\"))\n parser.add_option(\"--parameterSeparator\", action=\"store\", dest=\"parameterSeparator\", help=_(\"Specify parameters separator string (if other than comma).\"))\n parser.add_option(\"--parameterseparator\", action=\"store\", dest=\"parameterSeparator\", help=SUPPRESS_HELP)\n parser.add_option(\"--formula\", choices=(\"validate\", \"run\", \"none\"), dest=\"formulaAction\", \n help=_(\"Specify formula action: \"\n \"validate - validate only, without running, \"\n \"run - validate and run, or \"\n \"none - prevent formula validation or running when also specifying -v or --validate. \"\n \"if this option is not specified, -v or --validate will validate and run formulas if present\"))\n parser.add_option(\"--formulaParamExprResult\", action=\"store_true\", dest=\"formulaParamExprResult\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaparamexprresult\", action=\"store_true\", dest=\"formulaParamExprResult\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaParamInputValue\", action=\"store_true\", dest=\"formulaParamInputValue\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaparaminputvalue\", action=\"store_true\", dest=\"formulaParamInputValue\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaCallExprSource\", action=\"store_true\", dest=\"formulaCallExprSource\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulacallexprsource\", action=\"store_true\", dest=\"formulaCallExprSource\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaCallExprCode\", action=\"store_true\", dest=\"formulaCallExprCode\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulacallexprcode\", action=\"store_true\", dest=\"formulaCallExprCode\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaCallExprEval\", action=\"store_true\", dest=\"formulaCallExprEval\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulacallexpreval\", action=\"store_true\", dest=\"formulaCallExprEval\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaCallExprResult\", action=\"store_true\", dest=\"formulaCallExprResult\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulacallexprtesult\", action=\"store_true\", dest=\"formulaCallExprResult\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarSetExprEval\", action=\"store_true\", dest=\"formulaVarSetExprEval\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarsetexpreval\", action=\"store_true\", dest=\"formulaVarSetExprEval\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarSetExprResult\", action=\"store_true\", dest=\"formulaVarSetExprResult\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarsetexprresult\", action=\"store_true\", dest=\"formulaVarSetExprResult\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarSetTiming\", action=\"store_true\", dest=\"timeVariableSetEvaluation\", help=_(\"Specify showing times of variable set evaluation.\"))\n parser.add_option(\"--formulavarsettiming\", action=\"store_true\", dest=\"timeVariableSetEvaluation\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaAsserResultCounts\", action=\"store_true\", dest=\"formulaAsserResultCounts\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaasserresultcounts\", action=\"store_true\", dest=\"formulaAsserResultCounts\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaSatisfiedAsser\", action=\"store_true\", dest=\"formulaSatisfiedAsser\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulasatisfiedasser\", action=\"store_true\", dest=\"formulaSatisfiedAsser\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaUnsatisfiedAsser\", action=\"store_true\", dest=\"formulaUnsatisfiedAsser\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaunsatisfiedasser\", action=\"store_true\", dest=\"formulaUnsatisfiedAsser\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaUnsatisfiedAsserError\", action=\"store_true\", dest=\"formulaUnsatisfiedAsserError\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaunsatisfiedassererror\", action=\"store_true\", dest=\"formulaUnsatisfiedAsserError\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaFormulaRules\", action=\"store_true\", dest=\"formulaFormulaRules\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulaformularules\", action=\"store_true\", dest=\"formulaFormulaRules\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarsOrder\", action=\"store_true\", dest=\"formulaVarsOrder\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarsorder\", action=\"store_true\", dest=\"formulaVarsOrder\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarExpressionSource\", action=\"store_true\", dest=\"formulaVarExpressionSource\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarexpressionsource\", action=\"store_true\", dest=\"formulaVarExpressionSource\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarExpressionCode\", action=\"store_true\", dest=\"formulaVarExpressionCode\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarexpressioncode\", action=\"store_true\", dest=\"formulaVarExpressionCode\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarExpressionEvaluation\", action=\"store_true\", dest=\"formulaVarExpressionEvaluation\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarexpressionevaluation\", action=\"store_true\", dest=\"formulaVarExpressionEvaluation\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarExpressionResult\", action=\"store_true\", dest=\"formulaVarExpressionResult\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarexpressionresult\", action=\"store_true\", dest=\"formulaVarExpressionResult\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarFilterWinnowing\", action=\"store_true\", dest=\"formulaVarFilterWinnowing\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarfilterwinnowing\", action=\"store_true\", dest=\"formulaVarFilterWinnowing\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaVarFiltersResult\", action=\"store_true\", dest=\"formulaVarFiltersResult\", help=_(\"Specify formula tracing.\"))\n parser.add_option(\"--formulavarfiltersresult\", action=\"store_true\", dest=\"formulaVarFiltersResult\", help=SUPPRESS_HELP)\n parser.add_option(\"--formulaRunIDs\", action=\"store\", dest=\"formulaRunIDs\", help=_(\"Specify formula/assertion IDs to run, separated by a '|' character.\"))\n parser.add_option(\"--formularunids\", action=\"store\", dest=\"formulaRunIDs\", help=SUPPRESS_HELP)\n parser.add_option(\"--uiLang\", action=\"store\", dest=\"uiLang\",\n help=_(\"Language for user interface (override system settings, such as program messages). Does not save setting.\"))\n parser.add_option(\"--uilang\", action=\"store\", dest=\"uiLang\", help=SUPPRESS_HELP)\n parser.add_option(\"--proxy\", action=\"store\", dest=\"proxy\",\n help=_(\"Modify and re-save proxy settings configuration. \" \n \"Enter 'system' to use system proxy setting, 'none' to use no proxy, \"\n \"'http://[user[:password]@]host[:port]' \"\n \" (e.g., http://192.168.1.253, http://example.com:8080, http://joe:[email protected]:8080), \"\n \" or 'show' to show current setting, .\" ))\n parser.add_option(\"--internetConnectivity\", choices=(\"online\", \"offline\"), dest=\"internetConnectivity\", \n help=_(\"Specify internet connectivity: online or offline\"))\n parser.add_option(\"--internetconnectivity\", action=\"store\", dest=\"internetConnectivity\", help=SUPPRESS_HELP)\n parser.add_option(\"--internetTimeout\", type=\"int\", dest=\"internetTimeout\", \n help=_(\"Specify internet connection timeout in seconds (0 means unlimited).\"))\n parser.add_option(\"--internettimeout\", type=\"int\", action=\"store\", dest=\"internetTimeout\", help=SUPPRESS_HELP)\n parser.add_option(\"--internetRecheck\", choices=(\"weekly\", \"daily\", \"never\"), dest=\"internetRecheck\", \n help=_(\"Specify rechecking cache files (weekly is default)\"))\n parser.add_option(\"--internetrecheck\", choices=(\"weekly\", \"daily\", \"never\"), action=\"store\", dest=\"internetRecheck\", help=SUPPRESS_HELP)\n parser.add_option(\"--internetLogDownloads\", action=\"store_true\", dest=\"internetLogDownloads\", \n help=_(\"Log info message for downloads to web cache.\"))\n parser.add_option(\"--internetlogdownloads\", action=\"store_true\", dest=\"internetLogDownloads\", help=SUPPRESS_HELP)\n parser.add_option(\"--xdgConfigHome\", action=\"store\", dest=\"xdgConfigHome\", \n help=_(\"Specify non-standard location for configuration and cache files (overrides environment parameter XDG_CONFIG_HOME).\"))\n parser.add_option(\"--plugins\", action=\"store\", dest=\"plugins\",\n help=_(\"Modify plug-in configuration. \"\n \"Re-save unless 'temp' is in the module list. \" \n \"Enter 'show' to show current plug-in configuration. \"\n \"Commands show, and module urls are '|' separated: \"\n \"+url to add plug-in by its url or filename, ~name to reload a plug-in by its name, -name to remove a plug-in by its name, \"\n \"relative URLs are relative to installation plug-in directory, \"\n \" (e.g., '+http://arelle.org/files/hello_web.py', '+C:\\Program Files\\Arelle\\examples\\plugin\\hello_dolly.py' to load, \"\n \"or +../examples/plugin/hello_dolly.py for relative use of examples directory, \"\n \"~Hello Dolly to reload, -Hello Dolly to remove). \"\n \"If + is omitted from .py file nothing is saved (same as temp). \"\n \"Packaged plug-in urls are their directory's url. \" ))\n parser.add_option(\"--packages\", action=\"store\", dest=\"packages\",\n help=_(\"Modify taxonomy packages configuration. \"\n \"Re-save unless 'temp' is in the module list. \" \n \"Enter 'show' to show current packages configuration. \"\n \"Commands show, and module urls are '|' separated: \"\n \"+url to add package by its url or filename, ~name to reload package by its name, -name to remove a package by its name, \"\n \"URLs are full absolute paths. \"\n \"If + is omitted from package file nothing is saved (same as temp). \" ))\n parser.add_option(\"--packageManifestName\", action=\"store\", dest=\"packageManifestName\",\n help=_(\"Provide non-standard archive manifest file name pattern (e.g., *taxonomyPackage.xml). \"\n \"Uses unix file name pattern matching. \"\n \"Multiple manifest files are supported in archive (such as oasis catalogs). \"\n \"(Replaces search for either .taxonomyPackage.xml or catalog.xml). \" ))\n parser.add_option(\"--abortOnMajorError\", action=\"store_true\", dest=\"abortOnMajorError\", help=_(\"Abort process on major error, such as when load is unable to find an entry or discovered file.\"))\n parser.add_option(\"--showEnvironment\", action=\"store_true\", dest=\"showEnvironment\", help=_(\"Show Arelle's config and cache directory and host OS environment parameters.\"))\n parser.add_option(\"--showenvironment\", action=\"store_true\", dest=\"showEnvironment\", help=SUPPRESS_HELP)\n parser.add_option(\"--collectProfileStats\", action=\"store_true\", dest=\"collectProfileStats\", help=_(\"Collect profile statistics, such as timing of validation activities and formulae.\"))\n if hasWebServer:\n parser.add_option(\"--webserver\", action=\"store\", dest=\"webserver\",\n help=_(\"start web server on host:port[:server] for REST and web access, e.g., --webserver locahost:8080, \"\n \"or specify nondefault a server name, such as cherrypy, --webserver locahost:8080:cherrypy. \"\n \"(It is possible to specify options to be defaults for the web server, such as disclosureSystem and validations, but not including file names.) \"))\n pluginOptionsIndex = len(parser.option_list)\n\n # install any dynamic plugins so their command line options can be parsed if present\n for i, arg in enumerate(args):\n if arg.startswith('--plugins'):\n if len(arg) > 9 and arg[9] == '=':\n preloadPlugins = arg[10:]\n elif i < len(args) - 1:\n preloadPlugins = args[i+1]\n else:\n preloadPlugins = \"\"\n for pluginCmd in preloadPlugins.split('|'):\n cmd = pluginCmd.strip()\n if cmd not in (\"show\", \"temp\") and len(cmd) > 0 and cmd[0] not in ('-', '~', '+'):\n moduleInfo = PluginManager.addPluginModule(cmd)\n if moduleInfo:\n cntlr.preloadedPlugins[cmd] = moduleInfo\n PluginManager.reset()\n break\n # add plug-in options\n for optionsExtender in pluginClassMethods(\"CntlrCmdLine.Options\"):\n optionsExtender(parser)\n pluginLastOptionIndex = len(parser.option_list)\n parser.add_option(\"-a\", \"--about\",\n action=\"store_true\", dest=\"about\",\n help=_(\"Show product version, copyright, and license.\"))\n \n if not args and cntlr.isGAE:\n args = [\"--webserver=::gae\"]\n elif cntlr.isCGI:\n args = [\"--webserver=::cgi\"]\n elif cntlr.isMSW:\n # if called from java on Windows any empty-string arguments are lost, see:\n # http://bugs.java.com/view_bug.do?bug_id=6518827\n # insert needed arguments\n sourceArgs = args\n args = []\n namedOptions = set()\n optionsWithArg = set()\n for option in parser.option_list:\n names = str(option).split('/')\n namedOptions.update(names)\n if option.action == \"store\":\n optionsWithArg.update(names)\n priorArg = None\n for arg in sourceArgs:\n if priorArg in optionsWithArg and arg in namedOptions:\n # probable java/MSFT interface bug 6518827\n args.append('') # add empty string argument\n # remove quoting if arguments quoted according to http://bugs.java.com/view_bug.do?bug_id=6518827\n if r'\\\"' in arg: # e.g., [{\\\"foo\\\":\\\"bar\\\"}] -> [{\"foo\":\"bar\"}]\n arg = arg.replace(r'\\\"', '\"')\n args.append(arg)\n priorArg = arg\n \n (options, leftoverArgs) = parser.parse_args(args)\n if options.about:\n print(_(\"\\narelle(r) {0}bit {1}\\n\\n\"\n \"An open source XBRL platform\\n\"\n \"(c) 2010-2015 Mark V Systems Limited\\n\"\n \"All rights reserved\\nhttp://www.arelle.org\\[email protected]\\n\\n\"\n \"Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); \"\n \"you may not \\nuse this file except in compliance with the License. \"\n \"You may obtain a copy \\nof the License at \"\n \"'http://www.apache.org/licenses/LICENSE-2.0'\\n\\n\"\n \"Unless required by applicable law or agreed to in writing, software \\n\"\n \"distributed under the License is distributed on an \\\"AS IS\\\" BASIS, \\n\"\n \"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \\n\"\n \"See the License for the specific language governing permissions and \\n\"\n \"limitations under the License.\"\n \"\\n\\nIncludes:\"\n \"\\n Python(r) {3[0]}.{3[1]}.{3[2]} (c) 2001-2013 Python Software Foundation\"\n \"\\n PyParsing (c) 2003-2013 Paul T. McGuire\"\n \"\\n lxml {4[0]}.{4[1]}.{4[2]} (c) 2004 Infrae, ElementTree (c) 1999-2004 by Fredrik Lundh\"\n \"{2}\"\n \"\\n May include installable plug-in modules with author-specific license terms\"\n ).format(cntlr.systemWordSize, Version.version,\n _(\"\\n Bottle (c) 2011-2013 Marcel Hellkamp\") if hasWebServer else \"\",\n sys.version_info, etree.LXML_VERSION))\n elif options.disclosureSystemName in (\"help\", \"help-verbose\"):\n text = _(\"Disclosure system choices: \\n{0}\").format(' \\n'.join(cntlr.modelManager.disclosureSystem.dirlist(options.disclosureSystemName)))\n try:\n print(text)\n except UnicodeEncodeError:\n print(text.encode(\"ascii\", \"replace\").decode(\"ascii\"))\n elif len(leftoverArgs) != 0 and (not hasWebServer or options.webserver is None):\n parser.error(_(\"unrecognized arguments: {}\".format(', '.join(leftoverArgs))))\n elif (options.entrypointFile is None and \n ((not options.proxy) and (not options.plugins) and\n (not any(pluginOption for pluginOption in parser.option_list[pluginOptionsIndex:pluginLastOptionIndex])) and\n (not hasWebServer or options.webserver is None))):\n parser.error(_(\"incorrect arguments, please try\\n python CntlrCmdLine.py --help\"))\n elif hasWebServer and options.webserver:\n # webserver incompatible with file operations\n if any((options.entrypointFile, options.importFiles, options.diffFile, options.versReportFile,\n options.factsFile, options.factListCols, options.factTableFile,\n options.conceptsFile, options.preFile, options.calFile, options.dimFile, options.formulaeFile, options.viewArcrole, options.viewFile,\n options.roleTypesFile, options.arcroleTypesFile\n )):\n parser.error(_(\"incorrect arguments with --webserver, please try\\n python CntlrCmdLine.py --help\"))\n else:\n # note that web server logging does not strip time stamp, use logFormat if that is desired\n cntlr.startLogging(logFileName='logToBuffer')\n from arelle import CntlrWebMain\n app = CntlrWebMain.startWebserver(cntlr, options)\n if options.webserver == '::wsgi':\n return app\n else:\n # parse and run the FILENAME\n cntlr.startLogging(logFileName=(options.logFile or \"logToPrint\"),\n logFormat=(options.logFormat or \"[%(messageCode)s] %(message)s - %(file)s\"),\n logLevel=(options.logLevel or \"DEBUG\"),\n logToBuffer=getattr(options, \"logToBuffer\", False)) # e.g., used by EdgarRenderer to require buffered logging\n cntlr.run(options)\n \n return cntlr", "metadata": "root.parseAndRun", "header": "['module', '___EOS___']", "index": 51 }, { "content": "class ParserForDynamicPlugins:", "metadata": "root.ParserForDynamicPlugins", "header": "['module', '___EOS___']", "index": 427 }, { "content": " def __init__(self, options):\n self.options = options", "metadata": "root.ParserForDynamicPlugins.__init__", "header": "['class', 'ParserForDynamicPlugins', ':', '___EOS___']", "index": 428 }, { "content": " def add_option(self, *args, **kwargs):\n if 'dest' in kwargs:\n _dest = kwargs['dest']\n if not hasattr(self.options, _dest):\n setattr(self.options, _dest, kwargs.get('default',None))", "metadata": "root.ParserForDynamicPlugins.add_option", "header": "['class', 'ParserForDynamicPlugins', ':', '___EOS___']", "index": 430 }, { "content": "class CntlrCmdLine(Cntlr.Cntlr):\n \"\"\"\n .. class:: CntlrCmdLin()\n \n Initialization sets up for platform via Cntlr.Cntlr.\n \"\"\"\n\n \n\n # default web authentication password\n \n # special show status for named pipes", "metadata": "root.CntlrCmdLine", "header": "['module', '___EOS___']", "index": 436 }, { "content": " def __init__(self, logFileName=None):\n super(CntlrCmdLine, self).__init__(hasGui=False)\n self.preloadedPlugins = {}", "metadata": "root.CntlrCmdLine.__init__", "header": "['class', 'CntlrCmdLine', '(', 'Cntlr', '.', 'Cntlr', ')', ':', '___EOS___']", "index": 443 }, { "content": " def run(self, options, sourceZipStream=None, responseZipStream=None):\n \"\"\"Process command line arguments or web service request, such as to load and validate an XBRL document, or start web server.\n \n When a web server has been requested, this method may be called multiple times, once for each web service (REST) request that requires processing.\n Otherwise (when called for a command line request) this method is called only once for the command line arguments request.\n \n :param options: OptionParser options from parse_args of main argv arguments (when called from command line) or corresponding arguments from web service (REST) request.\n :type options: optparse.Values\n \"\"\"\n \n if options.statusPipe or options.monitorParentProcess:\n try:\n global win32file, win32api, win32process, pywintypes\n import win32file, win32api, win32process, pywintypes\n except ImportError: # win32 not installed\n self.addToLog(\"--statusPipe {} cannot be installed, packages for win32 missing\".format(options.statusPipe))\n options.statusPipe = options.monitorParentProcess = None\n if options.statusPipe:\n try:\n self.statusPipe = win32file.CreateFile(\"\\\\\\\\.\\\\pipe\\\\{}\".format(options.statusPipe), \n win32file.GENERIC_READ | win32file.GENERIC_WRITE, 0, None, win32file.OPEN_EXISTING, win32file.FILE_FLAG_NO_BUFFERING, None)\n self.showStatus = self.showStatusOnPipe\n self.lastStatusTime = 0.0\n self.parentProcessHandle = None\n except pywintypes.error: # named pipe doesn't exist\n self.addToLog(\"--statusPipe {} has not been created by calling program\".format(options.statusPipe))\n if options.monitorParentProcess:\n try:\n self.parentProcessHandle = win32api.OpenProcess(PROCESS_QUERY_INFORMATION, False, int(options.monitorParentProcess))\n def monitorParentProcess():\n if win32process.GetExitCodeProcess(self.parentProcessHandle) != STILL_ACTIVE:\n sys.exit()\n _t = threading.Timer(10.0, monitorParentProcess)\n _t.daemon = True\n _t.start()\n monitorParentProcess()\n except ImportError: # win32 not installed\n self.addToLog(\"--monitorParentProcess {} cannot be installed, packages for win32api and win32process missing\".format(options.monitorParentProcess))\n except (ValueError, pywintypes.error): # parent process doesn't exist\n self.addToLog(\"--monitorParentProcess Process {} Id is invalid\".format(options.monitorParentProcess))\n sys.exit()\n if options.showOptions: # debug options\n for optName, optValue in sorted(options.__dict__.items(), key=lambda optItem: optItem[0]):\n self.addToLog(\"Option {0}={1}\".format(optName, optValue), messageCode=\"info\")\n self.addToLog(\"sys.argv {0}\".format(sys.argv), messageCode=\"info\")\n if options.uiLang: # set current UI Lang (but not config setting)\n self.setUiLanguage(options.uiLang)\n if options.proxy:\n if options.proxy != \"show\":\n proxySettings = proxyTuple(options.proxy)\n self.webCache.resetProxies(proxySettings)\n self.config[\"proxySettings\"] = proxySettings\n self.saveConfig()\n self.addToLog(_(\"Proxy configuration has been set.\"), messageCode=\"info\")\n useOsProxy, urlAddr, urlPort, user, password = self.config.get(\"proxySettings\", proxyTuple(\"none\"))\n if useOsProxy:\n self.addToLog(_(\"Proxy configured to use {0}.\").format(\n _('Microsoft Windows Internet Settings') if sys.platform.startswith(\"win\")\n else (_('Mac OS X System Configuration') if sys.platform in (\"darwin\", \"macos\")\n else _('environment variables'))), messageCode=\"info\")\n elif urlAddr:\n self.addToLog(_(\"Proxy setting: http://{0}{1}{2}{3}{4}\").format(\n user if user else \"\",\n \":****\" if password else \"\",\n \"@\" if (user or password) else \"\",\n urlAddr,\n \":{0}\".format(urlPort) if urlPort else \"\"), messageCode=\"info\")\n else:\n self.addToLog(_(\"Proxy is disabled.\"), messageCode=\"info\")\n if options.plugins:\n resetPlugins = False\n savePluginChanges = True\n showPluginModules = False\n for pluginCmd in options.plugins.split('|'):\n cmd = pluginCmd.strip()\n if cmd == \"show\":\n showPluginModules = True\n elif cmd == \"temp\":\n savePluginChanges = False\n elif cmd.startswith(\"+\"):\n moduleInfo = PluginManager.addPluginModule(cmd[1:])\n if moduleInfo:\n self.addToLog(_(\"Addition of plug-in {0} successful.\").format(moduleInfo.get(\"name\")), \n messageCode=\"info\", file=moduleInfo.get(\"moduleURL\"))\n resetPlugins = True\n if \"CntlrCmdLine.Options\" in moduleInfo[\"classMethods\"]:\n addedPluginWithCntlrCmdLineOptions = True\n else:\n self.addToLog(_(\"Unable to load plug-in.\"), messageCode=\"info\", file=cmd[1:])\n elif cmd.startswith(\"~\"):\n if PluginManager.reloadPluginModule(cmd[1:]):\n self.addToLog(_(\"Reload of plug-in successful.\"), messageCode=\"info\", file=cmd[1:])\n resetPlugins = True\n else:\n self.addToLog(_(\"Unable to reload plug-in.\"), messageCode=\"info\", file=cmd[1:])\n elif cmd.startswith(\"-\"):\n if PluginManager.removePluginModule(cmd[1:]):\n self.addToLog(_(\"Deletion of plug-in successful.\"), messageCode=\"info\", file=cmd[1:])\n resetPlugins = True\n else:\n self.addToLog(_(\"Unable to delete plug-in.\"), messageCode=\"info\", file=cmd[1:])\n else: # assume it is a module or package (may also have been loaded before for option parsing)\n savePluginChanges = False\n if cmd in self.preloadedPlugins:\n moduleInfo = self.preloadedPlugins[cmd] # already loaded, add activation message to log below\n else:\n moduleInfo = PluginManager.addPluginModule(cmd)\n if moduleInfo:\n resetPlugins = True\n if moduleInfo: \n self.addToLog(_(\"Activation of plug-in {0} successful, version {1}.\").format(moduleInfo.get(\"name\"), moduleInfo.get(\"version\")), \n messageCode=\"info\", file=moduleInfo.get(\"moduleURL\"))\n else:\n self.addToLog(_(\"Unable to load \\\"%(name)s\\\" as a plug-in or \\\"%(name)s\\\" is not recognized as a plugin command. \"),\n messageCode=\"arelle:pluginParameterError\", \n messageArgs={\"name\": cmd, \"file\": cmd}, level=logging.ERROR)\n if resetPlugins:\n PluginManager.reset()\n if savePluginChanges:\n PluginManager.save(self)\n if options.webserver: # options may need reparsing dynamically\n _optionsParser = ParserForDynamicPlugins(options)\n # add plug-in options\n for optionsExtender in pluginClassMethods(\"CntlrCmdLine.Options\"):\n optionsExtender(_optionsParser)\n\n if showPluginModules:\n self.addToLog(_(\"Plug-in modules:\"), messageCode=\"info\")\n for i, moduleItem in enumerate(sorted(PluginManager.pluginConfig.get(\"modules\", {}).items())):\n moduleInfo = moduleItem[1]\n self.addToLog(_(\"Plug-in: {0}; author: {1}; version: {2}; status: {3}; date: {4}; description: {5}; license {6}.\").format(\n moduleItem[0], moduleInfo.get(\"author\"), moduleInfo.get(\"version\"), moduleInfo.get(\"status\"),\n moduleInfo.get(\"fileDate\"), moduleInfo.get(\"description\"), moduleInfo.get(\"license\")),\n messageCode=\"info\", file=moduleInfo.get(\"moduleURL\"))\n if options.packages:\n from arelle import PackageManager\n savePackagesChanges = True\n showPackages = False\n for packageCmd in options.packages.split('|'):\n cmd = packageCmd.strip()\n if cmd == \"show\":\n showPackages = True\n elif cmd == \"temp\":\n savePackagesChanges = False\n elif cmd.startswith(\"+\"):\n packageInfo = PackageManager.addPackage(self, cmd[1:], options.packageManifestName)\n if packageInfo:\n self.addToLog(_(\"Addition of package {0} successful.\").format(packageInfo.get(\"name\")), \n messageCode=\"info\", file=packageInfo.get(\"URL\"))\n else:\n self.addToLog(_(\"Unable to load package.\"), messageCode=\"info\", file=cmd[1:])\n elif cmd.startswith(\"~\"):\n if PackageManager.reloadPackageModule(self, cmd[1:]):\n self.addToLog(_(\"Reload of package successful.\"), messageCode=\"info\", file=cmd[1:])\n else:\n self.addToLog(_(\"Unable to reload package.\"), messageCode=\"info\", file=cmd[1:])\n elif cmd.startswith(\"-\"):\n if PackageManager.removePackageModule(self, cmd[1:]):\n self.addToLog(_(\"Deletion of package successful.\"), messageCode=\"info\", file=cmd[1:])\n else:\n self.addToLog(_(\"Unable to delete package.\"), messageCode=\"info\", file=cmd[1:])\n else: # assume it is a module or package\n savePackagesChanges = False\n packageInfo = PackageManager.addPackage(self, cmd, options.packageManifestName)\n if packageInfo:\n self.addToLog(_(\"Activation of package {0} successful.\").format(packageInfo.get(\"name\")), \n messageCode=\"info\", file=packageInfo.get(\"URL\"))\n resetPlugins = True\n else:\n self.addToLog(_(\"Unable to load package \\\"%(name)s\\\". \"),\n messageCode=\"arelle:packageLoadingError\", \n messageArgs={\"name\": cmd, \"file\": cmd}, level=logging.ERROR)\n if PackageManager.packagesConfigChanged:\n PackageManager.rebuildRemappings(self)\n if savePackagesChanges:\n PackageManager.save(self)\n else:\n PackageManager.packagesConfigChanged = False\n if showPackages:\n self.addToLog(_(\"Taxonomy packages:\"), messageCode=\"info\")\n for packageInfo in PackageManager.orderedPackagesConfig()[\"packages\"]:\n self.addToLog(_(\"Package: {0}; version: {1}; status: {2}; date: {3}; description: {4}.\").format(\n packageInfo.get(\"name\"), packageInfo.get(\"version\"), packageInfo.get(\"status\"),\n packageInfo.get(\"fileDate\"), packageInfo.get(\"description\")),\n messageCode=\"info\", file=packageInfo.get(\"URL\"))\n \n if options.showEnvironment:\n self.addToLog(_(\"Config directory: {0}\").format(self.configDir))\n self.addToLog(_(\"Cache directory: {0}\").format(self.userAppDir))\n for envVar in (\"XDG_CONFIG_HOME\",):\n if envVar in os.environ:\n self.addToLog(_(\"XDG_CONFIG_HOME={0}\").format(os.environ[envVar]))\n return True\n \n self.modelManager.customTransforms = None # clear out prior custom transforms\n self.modelManager.loadCustomTransforms()\n \n # run utility command line options that don't depend on entrypoint Files\n hasUtilityPlugin = False\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Utility.Run\"):\n hasUtilityPlugin = True\n try:\n pluginXbrlMethod(self, options, sourceZipStream=sourceZipStream, responseZipStream=responseZipStream)\n except SystemExit: # terminate operation, plug in has terminated all processing\n return True # success\n \n # if no entrypointFile is applicable, quit now\n if options.proxy or options.plugins or hasUtilityPlugin:\n if not (options.entrypointFile or sourceZipStream):\n return True # success\n self.username = options.username\n self.password = options.password\n if options.disclosureSystemName:\n self.modelManager.validateDisclosureSystem = True\n self.modelManager.disclosureSystem.select(options.disclosureSystemName)\n if options.validateEFM:\n self.addToLog(_(\"both --efm and --disclosureSystem validation are requested, ignoring --efm only\"),\n messageCode=\"info\", file=options.entrypointFile)\n elif options.validateEFM:\n self.modelManager.validateDisclosureSystem = True\n self.modelManager.disclosureSystem.select(\"efm\")\n elif options.validateHMRC:\n self.modelManager.validateDisclosureSystem = True\n self.modelManager.disclosureSystem.select(\"hmrc\")\n else:\n self.modelManager.disclosureSystem.select(None) # just load ordinary mappings\n self.modelManager.validateDisclosureSystem = False\n if options.utrUrl: # override disclosureSystem utrUrl\n self.modelManager.disclosureSystem.utrUrl = options.utrUrl\n # can be set now because the utr is first loaded at validation time \n if options.skipDTS: # skip DTS loading, discovery, etc\n self.modelManager.skipDTS = True\n if options.skipLoading: # skip loading matching files (list of unix patterns)\n self.modelManager.skipLoading = re.compile(\n '|'.join(fnmatch.translate(f) for f in options.skipLoading.split('|')))\n \n # disclosure system sets logging filters, override disclosure filters, if specified by command line\n if options.logLevelFilter:\n self.setLogLevelFilter(options.logLevelFilter)\n if options.logCodeFilter:\n self.setLogCodeFilter(options.logCodeFilter)\n if options.calcDecimals:\n if options.calcPrecision:\n self.addToLog(_(\"both --calcDecimals and --calcPrecision validation are requested, proceeding with --calcDecimals only\"),\n messageCode=\"info\", file=options.entrypointFile)\n self.modelManager.validateInferDecimals = True\n self.modelManager.validateCalcLB = True\n elif options.calcPrecision:\n self.modelManager.validateInferDecimals = False\n self.modelManager.validateCalcLB = True\n if options.utrValidate:\n self.modelManager.validateUtr = True\n if options.infosetValidate:\n self.modelManager.validateInfoset = True\n if options.abortOnMajorError:\n self.modelManager.abortOnMajorError = True\n if options.collectProfileStats:\n self.modelManager.collectProfileStats = True\n if options.outputAttribution:\n self.modelManager.outputAttribution = options.outputAttribution\n if options.internetConnectivity == \"offline\":\n self.webCache.workOffline = True\n elif options.internetConnectivity == \"online\":\n self.webCache.workOffline = False\n if options.internetTimeout is not None:\n self.webCache.timeout = (options.internetTimeout or None) # use None if zero specified to disable timeout\n if options.internetLogDownloads:\n self.webCache.logDownloads = True\n fo = FormulaOptions()\n if options.parameters:\n parameterSeparator = (options.parameterSeparator or ',')\n fo.parameterValues = dict(((qname(key, noPrefixIsNoNamespace=True),(None,value)) \n for param in options.parameters.split(parameterSeparator) \n for key,sep,value in (param.partition('='),) ) )\n if options.formulaParamExprResult:\n fo.traceParameterExpressionResult = True\n if options.formulaParamInputValue:\n fo.traceParameterInputValue = True\n if options.formulaCallExprSource:\n fo.traceCallExpressionSource = True\n if options.formulaCallExprCode:\n fo.traceCallExpressionCode = True\n if options.formulaCallExprEval:\n fo.traceCallExpressionEvaluation = True\n if options.formulaCallExprResult:\n fo.traceCallExpressionResult = True\n if options.formulaVarSetExprEval:\n fo.traceVariableSetExpressionEvaluation = True\n if options.formulaVarSetExprResult:\n fo.traceVariableSetExpressionResult = True\n if options.formulaAsserResultCounts:\n fo.traceAssertionResultCounts = True\n if options.formulaSatisfiedAsser:\n fo.traceSatisfiedAssertions = True\n if options.formulaUnsatisfiedAsser:\n fo.traceUnsatisfiedAssertions = True\n if options.formulaUnsatisfiedAsserError:\n fo.errorUnsatisfiedAssertions = True\n if options.formulaFormulaRules:\n fo.traceFormulaRules = True\n if options.formulaVarsOrder:\n fo.traceVariablesOrder = True\n if options.formulaVarExpressionSource:\n fo.traceVariableExpressionSource = True\n if options.formulaVarExpressionCode:\n fo.traceVariableExpressionCode = True\n if options.formulaVarExpressionEvaluation:\n fo.traceVariableExpressionEvaluation = True\n if options.formulaVarExpressionResult:\n fo.traceVariableExpressionResult = True\n if options.timeVariableSetEvaluation:\n fo.timeVariableSetEvaluation = True\n if options.formulaVarFilterWinnowing:\n fo.traceVariableFilterWinnowing = True\n if options.formulaVarFiltersResult:\n fo.traceVariableFiltersResult = True\n if options.formulaVarFiltersResult:\n fo.traceVariableFiltersResult = True\n if options.formulaRunIDs:\n fo.runIDs = options.formulaRunIDs \n self.modelManager.formulaOptions = fo\n\n success = True\n # entrypointFile may be absent (if input is a POSTED zip or file name ending in .zip)\n # or may be a | separated set of file names\n _entryPoints = []\n if options.entrypointFile:\n _f = options.entrypointFile\n try: # may be a json list\n _entryPoints = json.loads(_f)\n except ValueError:\n # is it malformed json?\n if _f.startswith(\"[{\") or _f.endswith(\"]}\") or '\"file:\"' in _f:\n self.addToLog(_(\"File name parameter appears to be malformed JSON: {0}\").format(_f),\n messageCode=\"FileNameFormatError\",\n level=logging.ERROR)\n success = False\n else: # try as file names separated by '|' \n for f in (_f or '').split('|'):\n if not sourceZipStream and not isHttpUrl(f) and not os.path.isabs(f):\n f = os.path.normpath(os.path.join(os.getcwd(), f)) # make absolute normed path\n _entryPoints.append({\"file\":f})\n filesource = None # file source for all instances if not None\n if sourceZipStream:\n filesource = FileSource.openFileSource(None, self, sourceZipStream)\n elif len(_entryPoints) == 1: # check if a zip and need to discover entry points\n filesource = FileSource.openFileSource(_entryPoints[0].get(\"file\",None), self)\n _entrypointFiles = _entryPoints\n if filesource and not filesource.selection:\n if filesource.isArchive:\n _entrypointFiles = []\n for _archiveFile in (filesource.dir or ()): # .dir might be none if IOerror\n filesource.select(_archiveFile)\n if ModelDocument.Type.identify(filesource, filesource.url) in (ModelDocument.Type.INSTANCE, ModelDocument.Type.INLINEXBRL):\n _entrypointFiles.append({\"file\":filesource.url})\n elif os.path.isdir(filesource.url):\n _entrypointFiles = []\n for _file in os.listdir(filesource.url):\n _path = os.path.join(filesource.url, _file)\n if os.path.isfile(_path) and ModelDocument.Type.identify(filesource, _path) in (ModelDocument.Type.INSTANCE, ModelDocument.Type.INLINEXBRL):\n _entrypointFiles.append({\"file\":_path})\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Filing.Start\"):\n pluginXbrlMethod(self, options, filesource, _entrypointFiles, sourceZipStream=sourceZipStream, responseZipStream=responseZipStream)\n for _entrypoint in _entrypointFiles:\n _entrypointFile = _entrypoint.get(\"file\", None) if isinstance(_entrypoint,dict) else _entrypoint\n if filesource and filesource.isArchive:\n filesource.select(_entrypointFile)\n else:\n filesource = FileSource.openFileSource(_entrypointFile, self, sourceZipStream) \n self.entrypointFile = _entrypointFile\n timeNow = XmlUtil.dateunionValue(datetime.datetime.now())\n firstStartedAt = startedAt = time.time()\n modelDiffReport = None\n modelXbrl = None\n try:\n if filesource:\n modelXbrl = self.modelManager.load(filesource, _(\"views loading\"))\n except ModelDocument.LoadingException:\n pass\n except Exception as err:\n self.addToLog(_(\"Entry point loading Failed to complete request: \\n{0} \\n{1}\").format(\n err,\n traceback.format_tb(sys.exc_info()[2])),\n messageCode=\"Exception\",\n level=logging.ERROR)\n success = False # loading errors, don't attempt to utilize loaded DTS\n if modelXbrl and modelXbrl.modelDocument:\n loadTime = time.time() - startedAt\n modelXbrl.profileStat(_(\"load\"), loadTime)\n self.addToLog(format_string(self.modelManager.locale, \n _(\"loaded in %.2f secs at %s\"), \n (loadTime, timeNow)), \n messageCode=\"info\", file=self.entrypointFile)\n if options.importFiles:\n for importFile in options.importFiles.split(\"|\"):\n fileName = importFile.strip()\n if sourceZipStream is not None and not (fileName.startswith('http://') or os.path.isabs(fileName)):\n fileName = os.path.dirname(modelXbrl.uri) + os.sep + fileName # make relative to sourceZipStream\n ModelDocument.load(modelXbrl, fileName, isSupplemental=True)\n loadTime = time.time() - startedAt\n self.addToLog(format_string(self.modelManager.locale, \n _(\"import in %.2f secs at %s\"), \n (loadTime, timeNow)), \n messageCode=\"info\", file=importFile)\n modelXbrl.profileStat(_(\"import\"), loadTime)\n if modelXbrl.errors:\n success = False # loading errors, don't attempt to utilize loaded DTS\n if modelXbrl.modelDocument.type in ModelDocument.Type.TESTCASETYPES:\n for pluginXbrlMethod in pluginClassMethods(\"Testcases.Start\"):\n pluginXbrlMethod(self, options, modelXbrl)\n else: # not a test case, probably instance or DTS\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Xbrl.Loaded\"):\n pluginXbrlMethod(self, options, modelXbrl, _entrypoint)\n else:\n success = False\n if success and options.diffFile and options.versReportFile:\n try:\n diffFilesource = FileSource.FileSource(options.diffFile,self)\n startedAt = time.time()\n modelXbrl2 = self.modelManager.load(diffFilesource, _(\"views loading\"))\n if modelXbrl2.errors:\n if not options.keepOpen:\n modelXbrl2.close()\n success = False\n else:\n loadTime = time.time() - startedAt\n modelXbrl.profileStat(_(\"load\"), loadTime)\n self.addToLog(format_string(self.modelManager.locale, \n _(\"diff comparison DTS loaded in %.2f secs\"), \n loadTime), \n messageCode=\"info\", file=self.entrypointFile)\n startedAt = time.time()\n modelDiffReport = self.modelManager.compareDTSes(options.versReportFile)\n diffTime = time.time() - startedAt\n modelXbrl.profileStat(_(\"diff\"), diffTime)\n self.addToLog(format_string(self.modelManager.locale, \n _(\"compared in %.2f secs\"), \n diffTime), \n messageCode=\"info\", file=self.entrypointFile)\n except ModelDocument.LoadingException:\n success = False\n except Exception as err:\n success = False\n self.addToLog(_(\"[Exception] Failed to doad diff file: \\n{0} \\n{1}\").format(\n err,\n traceback.format_tb(sys.exc_info()[2])))\n if success:\n try:\n modelXbrl = self.modelManager.modelXbrl\n hasFormulae = modelXbrl.hasFormulae\n isAlreadyValidated = False\n for pluginXbrlMethod in pluginClassMethods(\"ModelDocument.IsValidated\"):\n if pluginXbrlMethod(modelXbrl): # e.g., streaming extensions already has validated\n isAlreadyValidated = True\n if options.validate and not isAlreadyValidated:\n startedAt = time.time()\n if options.formulaAction: # don't automatically run formulas\n modelXbrl.hasFormulae = False\n self.modelManager.validate()\n if options.formulaAction: # restore setting\n modelXbrl.hasFormulae = hasFormulae\n self.addToLog(format_string(self.modelManager.locale, \n _(\"validated in %.2f secs\"), \n time.time() - startedAt),\n messageCode=\"info\", file=self.entrypointFile)\n if (options.formulaAction in (\"validate\", \"run\") and # do nothing here if \"none\"\n not isAlreadyValidated): # formulas can't run if streaming has validated the instance \n from arelle import ValidateXbrlDimensions, ValidateFormula\n startedAt = time.time()\n if not options.validate:\n ValidateXbrlDimensions.loadDimensionDefaults(modelXbrl)\n # setup fresh parameters from formula optoins\n modelXbrl.parameters = fo.typedParameters()\n ValidateFormula.validate(modelXbrl, compileOnly=(options.formulaAction != \"run\"))\n self.addToLog(format_string(self.modelManager.locale, \n _(\"formula validation and execution in %.2f secs\")\n if options.formulaAction == \"run\"\n else _(\"formula validation only in %.2f secs\"), \n time.time() - startedAt),\n messageCode=\"info\", file=self.entrypointFile)\n \n \n if options.testReport:\n ViewFileTests.viewTests(self.modelManager.modelXbrl, options.testReport, options.testReportCols)\n \n if options.rssReport:\n ViewFileRssFeed.viewRssFeed(self.modelManager.modelXbrl, options.rssReport, options.rssReportCols)\n \n if options.DTSFile:\n ViewFileDTS.viewDTS(modelXbrl, options.DTSFile)\n if options.factsFile:\n ViewFileFactList.viewFacts(modelXbrl, options.factsFile, labelrole=options.labelRole, lang=options.labelLang, cols=options.factListCols)\n if options.factTableFile:\n ViewFileFactTable.viewFacts(modelXbrl, options.factTableFile, labelrole=options.labelRole, lang=options.labelLang)\n if options.conceptsFile:\n ViewFileConcepts.viewConcepts(modelXbrl, options.conceptsFile, labelrole=options.labelRole, lang=options.labelLang)\n if options.preFile:\n ViewFileRelationshipSet.viewRelationshipSet(modelXbrl, options.preFile, \"Presentation Linkbase\", \"http://www.xbrl.org/2003/arcrole/parent-child\", labelrole=options.labelRole, lang=options.labelLang)\n if options.calFile:\n ViewFileRelationshipSet.viewRelationshipSet(modelXbrl, options.calFile, \"Calculation Linkbase\", \"http://www.xbrl.org/2003/arcrole/summation-item\", labelrole=options.labelRole, lang=options.labelLang)\n if options.dimFile:\n ViewFileRelationshipSet.viewRelationshipSet(modelXbrl, options.dimFile, \"Dimensions\", \"XBRL-dimensions\", labelrole=options.labelRole, lang=options.labelLang)\n if options.formulaeFile:\n ViewFileFormulae.viewFormulae(modelXbrl, options.formulaeFile, \"Formulae\", lang=options.labelLang)\n if options.viewArcrole and options.viewFile:\n ViewFileRelationshipSet.viewRelationshipSet(modelXbrl, options.viewFile, os.path.basename(options.viewArcrole), options.viewArcrole, labelrole=options.labelRole, lang=options.labelLang)\n if options.roleTypesFile:\n ViewFileRoleTypes.viewRoleTypes(modelXbrl, options.roleTypesFile, \"Role Types\", isArcrole=False, lang=options.labelLang)\n if options.arcroleTypesFile:\n ViewFileRoleTypes.viewRoleTypes(modelXbrl, options.arcroleTypesFile, \"Arcrole Types\", isArcrole=True, lang=options.labelLang)\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Xbrl.Run\"):\n pluginXbrlMethod(self, options, modelXbrl, _entrypoint)\n \n except (IOError, EnvironmentError) as err:\n self.addToLog(_(\"[IOError] Failed to save output:\\n {0}\").format(err),\n messageCode=\"IOError\", \n file=options.entrypointFile, \n level=logging.CRITICAL)\n success = False\n except Exception as err:\n self.addToLog(_(\"[Exception] Failed to complete request: \\n{0} \\n{1}\").format(\n err,\n traceback.format_tb(sys.exc_info()[2])),\n messageCode=err.__class__.__name__, \n file=options.entrypointFile, \n level=logging.CRITICAL)\n success = False\n if modelXbrl:\n modelXbrl.profileStat(_(\"total\"), time.time() - firstStartedAt)\n if options.collectProfileStats and modelXbrl:\n modelXbrl.logProfileStats()\n if not options.keepOpen:\n if modelDiffReport:\n self.modelManager.close(modelDiffReport)\n elif modelXbrl:\n self.modelManager.close(modelXbrl)\n if options.validate:\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Filing.Validate\"):\n pluginXbrlMethod(self, options, filesource, _entrypointFiles, sourceZipStream=sourceZipStream, responseZipStream=responseZipStream)\n for pluginXbrlMethod in pluginClassMethods(\"CntlrCmdLine.Filing.End\"):\n pluginXbrlMethod(self, options, filesource, _entrypointFiles, sourceZipStream=sourceZipStream, responseZipStream=responseZipStream)\n self.username = self.password = None #dereference password\n\n if options.statusPipe and getattr(self, \"statusPipe\", None) is not None:\n win32file.WriteFile(self.statusPipe, b\" \") # clear status\n win32file.FlushFileBuffers(self.statusPipe)\n win32file.SetFilePointer(self.statusPipe, 0, win32file.FILE_BEGIN) # hangs on close without this\n win32file.CloseHandle(self.statusPipe)\n self.statusPipe = None # dereference\n\n return success", "metadata": "root.CntlrCmdLine.run", "header": "['class', 'CntlrCmdLine', '(', 'Cntlr', '.', 'Cntlr', ')', ':', '___EOS___']", "index": 447 }, { "content": " def internet_user_password(self, host, realm):\n return (self.username, self.password)", "metadata": "root.CntlrCmdLine.internet_user_password", "header": "['class', 'CntlrCmdLine', '(', 'Cntlr', '.', 'Cntlr', ')', ':', '___EOS___']", "index": 1000 }, { "content": " def showStatusOnPipe(self, message, clearAfter=None):\n # now = time.time() # seems ok without time-limiting writes to the pipe\n if self.statusPipe is not None: # max status updates 3 per second now - 0.3 > self.lastStatusTime and \n # self.lastStatusTime = now\n try:\n if self.parentProcessHandle is not None:\n if win32process.GetExitCodeProcess(self.parentProcessHandle) != STILL_ACTIVE:\n sys.exit()\n win32file.WriteFile(self.statusPipe, (message or \"\").encode(\"utf8\"))\n win32file.FlushFileBuffers(self.statusPipe)\n win32file.SetFilePointer(self.statusPipe, 0, win32file.FILE_BEGIN) # hangs on close without this\n except Exception as ex:\n #with open(\"Z:\\\\temp\\\\trace.log\", \"at\", encoding=\"utf-8\") as fh:\n # fh.write(\"Status pipe exception {} {}\\n\".format(type(ex), ex))\n system.exit()", "metadata": "root.CntlrCmdLine.showStatusOnPipe", "header": "['class', 'CntlrCmdLine', '(', 'Cntlr', '.', 'Cntlr', ')', ':', '___EOS___']", "index": 1004 } ]
[ { "span": "from arelle import PythonUtil ", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 29 }, { "span": "from arelle import (Cntlr, FileSource, ModelDocument, XmlUtil, Version, \n ViewFileDTS, ViewFileFactList, ViewFileFactTable, ViewFileConcepts, \n ViewFileFormulae, ViewFileRelationshipSet, ViewFileTests, ViewFileRssFeed,\n ViewFileRoleTypes,\n ModelManager)", "start_line": 14, "start_column": 0, "end_line": 18, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", "\\", "10", ";", "Creat", "ed", " ", "on", " ", "Oct", " ", "3", ",", " ", "2010", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "module", " ", "is", " ", "Are", "lle", "'", "s", " ", "controlle", "r", " ", "in", " ", "command", " ", "line", " ", "non", "-", "interactive", " ", "mode", "\\", "10", ";", "\\", "10", ";", "(", "Thi", "s", " ", "module", " ", "can", " ", "be", " ", "a", " ", "pattern", " ", "for", " ", "custom", " ", "integrati", "on", " ", "of", " ", "Are", "lle", " ", "int", "o", " ", "an", " ", "applica", "tion", ".)", "\\", "10", ";", "\\", "10", ";", "@", "author", ":", " ", "Mark", " ", "V", " ", "System", "s", " ", "Limit", "ed", "\\", "10", ";", "(", "c", ")", " ", "Copy", "right", " ", "2010", " ", "Mark", " ", "V", " ", "System", "s", " ", "Limit", "ed", ",", " ", "All", " ", "rights", " ", "reserve", "d", ".", "\\", "10", ";'", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "import_", "Pyth", "on", "Util_", "#", " ", "defin", "e", " ", "2", ".", "x", " ", "or", " ", "3", ".", "x", " ", "string", " ", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gettext_", ",_", "time_", ",_", "datetime_", ",_", "os_", ",_", "shlex_", ",_", "sys_", ",_", "traceback_", ",_", "fnmatch_", ",_", "threading_", ",_", "json_", ",_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "optparse_", "import_", "Optio", "n", "Parser_", ",_", "SUPPRESS", "\\u", "HELP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "import_", "(_", "Cnt", "lr_", ",_", "File", "Source_", ",_", "Model", "Document_", ",_", "Xm", "l", "Util_", ",_", "Version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "View", "File", "DT", "S_", ",_", "View", "File", "Fact", "List_", ",_", "View", "File", "Fact", "Table_", ",_", "View", "File", "Concept", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "View", "File", "Form", "ula", "e_", ",_", "View", "File", "Relationship", "Set_", ",_", "View", "File", "Tests_", ",_", "View", "File", "Rs", "s", "Feed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "View", "File", "Ro", "le", "Types_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Model", "Manager_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Model", "Value_", "import_", "qname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Locale_", "import_", "format\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Model", "Form", "ula", "Object_", "import_", "Form", "ula", "Options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "import_", "Plug", "in", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Plug", "in", "Manager_", "import_", "plugin", "Class", "Methods_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Ur", "l", "Util_", "import_", "is", "Http", "Url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "._", "Web", "Cache_", "import_", "proxy", "Tuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lxml_", "import_", "etree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "=_", "win32", "api_", "=_", "win32", "process_", "=_", "pywi", "ntype", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "STI", "LL", "\\u", "ACTIVE_", "=_", "259_", "#", " ", "MS", " ", "Window", "s", " ", "process", " ", "status", " ", "constants_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PROCESS", "\\u", "QUE", "RY", "\\u", "INFORMATION", "_", "=_", "0x400", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "'--", "COM", "server", "'", " ", "in", " ", "sys", ".", "argv", ":", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "are", "lle", " ", "import", " ", "Cnt", "lr", "Com", "Server", "\\", "10", ";", " ", " ", " ", " ", "Cnt", "lr", "Com", "Server", ".", "main", "()", "\\", "10", ";", " ", " ", " ", " ", "else", ":", "\\", "10", ";", " ", " ", " ", " ", "main", "()", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Main", " ", "program", " ", "to", " ", "initiate", " ", "applica", "tion", " ", "from", " ", "command", " ", "line", " ", "or", " ", "as", " ", "a", " ", "separate", " ", "process", " ", "(", "e", ".", "g", ",", " ", "java", " ", "Run", "time", ".", "get", "Run", "time", "()", ".", "exec", ").", " ", " ", "Ma", "y", " ", "perform", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "command", " ", "line", " ", "request", ",", " ", "or", " ", "initiate", " ", "a", " ", "web", " ", "server", " ", "on", " ", "specified", " ", "local", " ", "port", ".", "\\", "10", ";", " ", " ", " ", "\\", "10", ";", " ", " ", " ", ":", "param", " ", "argv", ":", " ", "Command", " ", "line", " ", "argu", "ment", "s", ".", " ", " ", "(", "Curr", "ent", "ly", " ", "support", "ed", " ", "argu", "ment", "s", " ", "can", " ", "be", " ", "displaye", "d", " ", "by", " ", "the", " ", "parameter", " ", "*-", "-", "help", "*.", ")", "\\", "10", ";", " ", " ", " ", ":", "type", " ", "message", ":", " ", "[", "str", "]", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env", "Args_", "=_", "os_", "._", "getenv_", "(_", "\"", "ARE", "LLE", "\\u", "ARG", "S", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "env", "Args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "shlex_", "._", "split_", "(_", "env", "Args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gettext_", "._", "install_", "(_", "\"", "are", "lle", "\"_", ")_", "#", " ", "need", "ed", " ", "for", " ", "options", " ", "messages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parse", "And", "Run_", "(_", "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_", "wsgi", "Application_", "(_", "extra", "Args_", "=_", "[_", "]_", ")_", ":_", "#", " ", "for", " ", "example", " ", "call", " ", "wsgi", "Applica", "tion", "([", "\"--", "plugin", "s", "=", "Ed", "gar", "Render", "er", "\"]", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "parse", "And", "Run_", "(_", "[_", "\"--", "webse", "rver", "=", "::", "wsgi", "\"_", "]_", "+_", "extra", "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_", "parse", "And", "Run_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "interface", " ", "used", " ", "by", " ", "Main", " ", "program", " ", "and", " ", "py", ".", "test", " ", "(", "are", "lle", "\\u", "test", ".", "py", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "are", "lle", "_", "import_", "webse", "rver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "Web", "Server_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "Web", "Server_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cnt", "lr_", "=_", "Cnt", "lr", "Cmd", "Line_", "(_", ")_", "#", " ", "need", " ", "controlle", "r", " ", "for", " ", "plug", " ", "ins", " ", "to", " ", "be", " ", "loaded_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "usage_", "=_", "\"", "usage", ":", " ", "%", "prog", " ", "[", "options", "]\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "=_", "Optio", "n", "Parser_", "(_", "usage_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "\"", "Are", "lle", "(", "r", ")", " ", "{", "0", "}", "bit", " ", "{", "1", "}\"_", "._", "format_", "(_", "cnt", "lr_", "._", "system", "Word", "Size_", ",_", "Version_", "._", "version_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "confl", "ict", "\\u", "handler_", "=_", "\"", "resolve", "\"_", ")_", "#", " ", "allow", " ", "relo", "ading", " ", "plug", "-", "in", " ", "options", " ", "with", "out", " ", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "f", "\"_", ",_", "\"--", "file", "\"_", ",_", "dest_", "=_", "\"", "entrypoint", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "FILE", "NAME", " ", "is", " ", "an", " ", "entry", " ", "point", ",", " ", "whi", "ch", " ", "may", " ", "be", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "an", " ", "XB", "RL", " ", "instance", ",", " ", "schema", ",", " ", "link", "base", " ", "file", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "inline", " ", "XB", "RL", " ", "instance", ",", " ", "testc", "ase", " ", "file", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "testc", "ase", " ", "index", " ", "file", ".", " ", " ", "FILE", "NAME", " ", "may", " ", "be", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "a", " ", "local", " ", "file", " ", "or", " ", "a", " ", "URI", " ", "to", " ", "a", " ", "web", " ", "located", " ", "file", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "For", " ", "multiple", " ", "instance", " ", "filing", "s", " ", "may", " ", "be", " ", "|", " ", "separate", "d", " ", "file", " ", "names", " ", "or", " ", "JSO", "N", " ", "list", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "of", " ", "file", "/", "parameter", " ", "dict", "s", " ", "[{", "\\\\\"", "file", "\\\\\":", "\\\\\"", "filepath", "\\\\\"", "},", " ", "{\\\\", "\"", "file", "\\\\\":", "\\\\\"", "file", "2p", "ath", "\\\\\"", "}", " ", "...]", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "user", "name", "\"_", ",_", "dest_", "=_", "\"", "user", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "user", " ", "name", " ", "if", " ", "need", "ed", " ", "(", "with", " ", "password", ")", " ", "for", " ", "web", " ", "file", " ", "retrie", "val", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "password", "\"_", ",_", "dest_", "=_", "\"", "password", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "password", " ", "if", " ", "need", "ed", " ", "(", "with", " ", "user", " ", "name", ")", " ", "for", " ", "web", " ", "retrie", "val", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "special", " ", "option", " ", "for", " ", "web", " ", "interface", "s", " ", "to", " ", "suppress", " ", "clos", "ing", " ", "an", " ", "opene", "d", " ", "model", "Xbrl", "_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "keep", "Open", "\"_", ",_", "dest_", "=_", "\"", "keep", "Open", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "i", "\"_", ",_", "\"--", "import", "\"_", ",_", "dest_", "=_", "\"", "import", "Files", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "FILE", "NAME", " ", "is", " ", "a", " ", "list", " ", "of", " ", "files", " ", "to", " ", "import", " ", "to", " ", "the", " ", "DT", "S", ",", " ", "suc", "h", " ", "as", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "addition", "al", " ", "formula", " ", "or", " ", "label", " ", "link", "base", "s", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Multipl", "e", " ", "file", " ", "names", " ", "are", " ", "separate", "d", " ", "by", " ", "a", " ", "'|", "'", " ", "character", ".", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "d", "\"_", ",_", "\"--", "diff", "\"_", ",_", "dest_", "=_", "\"", "diff", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "FILE", "NAME", " ", "is", " ", "a", " ", "second", " ", "entry", " ", "point", " ", "whe", "n", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "compa", "ring", " ", "(", "diff", "ing", ")", " ", "two", " ", "DT", "Se", "s", " ", "produc", "ing", " ", "a", " ", "versioning", " ", "report", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "r", "\"_", ",_", "\"--", "report", "\"_", ",_", "dest_", "=_", "\"", "vers", "Report", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "FILE", "NAME", " ", "is", " ", "the", " ", "filename", " ", "to", " ", "save", " ", "as", " ", "the", " ", "versioning", " ", "report", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "v", "\"_", ",_", "\"--", "validat", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "validat", "e", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Validate", " ", "the", " ", "file", " ", "according", " ", "to", " ", "the", " ", "entry", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "file", " ", "type", ".", " ", " ", "If", " ", "an", " ", "XB", "RL", " ", "file", ",", " ", "it", " ", "is", " ", "validat", "ed", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "according", " ", "to", " ", "XB", "RL", " ", "validation", " ", "2.1", ",", " ", "calculati", "on", " ", "link", "base", " ", "validation", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "if", " ", "eit", "her", " ", "--", "calc", "Deci", "mal", "s", " ", "or", " ", "--", "calc", "Precis", "ion", " ", "are", " ", "specified", ",", " ", "and", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SEC", " ", "ED", "GAR", " ", "Fil", "ing", " ", "Manu", "al", " ", "(", "if", " ", "--", "ef", "m", " ", "selecte", "d", ")", " ", "or", " ", "Global", " ", "File", "r", " ", "Manu", "al", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "discl", "osu", "re", " ", "system", " ", "validation", " ", "(", "if", " ", "--", "gf", "m", "=", "XX", "X", " ", "selecte", "d", ").", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "If", " ", "a", " ", "test", " ", "suit", "e", " ", "or", " ", "testc", "ase", ",", " ", "the", " ", "test", " ", "case", " ", "variations", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "are", " ", "individual", "ly", " ", "so", " ", "validat", "ed", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "If", " ", "formula", "e", " ", "are", " ", "presen", "t", " ", "the", "y", " ", "will", " ", "be", " ", "validat", "ed", " ", "and", " ", "run", " ", "unl", "ess", " ", "--", "formula", "=", "none", " ", "is", " ", "specified", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "calc", "Deci", "mal", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "calc", "Deci", "mal", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "calculati", "on", " ", "link", "base", " ", "validation", " ", "infer", "ring", " ", "decima", "ls", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "calc", "decima", "ls", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "calc", "Deci", "mal", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "calc", "Precis", "ion", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "calc", "Precis", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "calculati", "on", " ", "link", "base", " ", "validation", " ", "infer", "ring", " ", "preci", "sion", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "calc", "preci", "sion", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "calc", "Precis", "ion", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "ef", "m", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "validat", "e", "EF", "M", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Select", " ", "Ed", "gar", " ", "File", "r", " ", "Manu", "al", " ", "(", "U", ".", "S", ".", " ", "SEC", ")", " ", "discl", "osu", "re", " ", "system", " ", "validation", " ", "(", "strict", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "gf", "m", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "discl", "osu", "re", "System", "Name", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "discl", "osu", "re", "System", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "discl", "osu", "re", "System", "Name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "a", " ", "discl", "osu", "re", " ", "system", " ", "name", " ", "and", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "select", " ", "discl", "osu", "re", " ", "system", " ", "validation", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Enter", " ", "--", "discl", "osu", "re", "System", "=", "help", " ", "for", " ", "list", " ", "of", " ", "names", " ", "or", " ", "help", "-", "verbo", "se", " ", "for", " ", "list", " ", "of", " ", "names", " ", "and", " ", "description", "s", ".", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "discl", "osu", "res", "yste", "m", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "discl", "osu", "re", "System", "Name", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "hm", "rc", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "validat", "e", "HM", "RC", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Select", " ", "U", ".", "K", ".", " ", "HM", "RC", " ", "discl", "osu", "re", " ", "system", " ", "validation", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "utr", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "utr", "Validate", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Select", " ", "validation", " ", "with", " ", "respec", "t", " ", "to", " ", "Unit", " ", "Type", " ", "Regi", "stry", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "utr", "Ur", "l", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "utr", "Ur", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Override", " ", "discl", "osu", "re", " ", "system", "s", " ", "Unit", " ", "Type", " ", "Regi", "stry", " ", "location", " ", "(", "URL", " ", "or", " ", "file", " ", "path", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "utr", "url", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "utr", "Ur", "l", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "infos", "et", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "infos", "et", "Validate", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Select", " ", "validation", " ", "with", " ", "respec", "t", " ", "testc", "ase", " ", "infos", "ets", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "label", "Lang", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "label", "Lang", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Lang", "ua", "ge", " ", "for", " ", "labels", " ", "in", " ", "follow", "ing", " ", "file", " ", "options", " ", "(", "override", " ", "system", " ", "settings", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "label", "lang", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "label", "Lang", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "label", "Ro", "le", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "label", "Ro", "le", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Label", " ", "role", " ", "for", " ", "labels", " ", "in", " ", "follow", "ing", " ", "file", " ", "options", " ", "(", "inst", "ead", " ", "of", " ", "standard", " ", "label", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "label", "role", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "label", "Ro", "le", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "DT", "S", "\"_", ",_", "\"--", "csv", "DT", "S", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "DT", "SF", "ile", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "DT", "S", " ", "tree", " ", "int", "o", " ", "FILE", " ", "(", "may", " ", "be", " ", ".", "csv", " ", "or", " ", ".", "html", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "fact", "s", "\"_", ",_", "\"--", "csv", "Fact", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "fact", "s", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "fact", " ", "list", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "fact", "List", "Col", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "fact", "List", "Col", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Colum", "ns", " ", "for", " ", "fact", " ", "list", " ", "file", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "fact", "Table", "\"_", ",_", "\"--", "csv", "Fact", "Table", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "fact", "Table", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "fact", " ", "table", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "concepts", "\"_", ",_", "\"--", "csv", "Concept", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "concepts", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "concepts", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "pre", "\"_", ",_", "\"--", "csv", "Pre", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "pre", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "presentation", " ", "link", "base", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "cal", "\"_", ",_", "\"--", "csv", "Cal", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "cal", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "calculati", "on", " ", "link", "base", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "dim", "\"_", ",_", "\"--", "csv", "Dim", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "dim", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "dimension", "s", " ", "(", "of", " ", "definit", "ion", ")", " ", "link", "base", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "e", "\"_", ",_", "\"--", "html", "Form", "ula", "e", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "formula", "e", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "formula", "e", " ", "link", "base", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "view", "Arc", "role", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "view", "Arc", "role", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "link", "base", " ", "relation", "ships", " ", "for", " ", "view", "Arc", "role", " ", "int", "o", " ", "view", "File", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "view", "arc", "role", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "view", "Arc", "role", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "view", "File", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "view", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "link", "base", " ", "relation", "ships", " ", "for", " ", "view", "Arc", "role", " ", "int", "o", " ", "view", "File", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "view", "file", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "view", "File", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "role", "Type", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "role", "Type", "s", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "defin", "ed", " ", "role", " ", "types", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "role", "types", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "role", "Type", "s", "File", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "arc", "role", "Type", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "arc", "role", "Type", "s", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "defin", "ed", " ", "arc", "role", " ", "types", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "arc", "role", "types", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "arc", "role", "Type", "s", "File", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "test", "Report", "\"_", ",_", "\"--", "csv", "Test", "Report", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "test", "Report", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "test", " ", "report", " ", "of", " ", "validation", " ", "(", "of", " ", "test", " ", "case", "s", ")", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "testre", "port", "\"_", ",_", "\"--", "csv", "testre", "port", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "test", "Report", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "test", "Report", "Col", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "test", "Report", "Col", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Colum", "ns", " ", "for", " ", "test", " ", "report", " ", "file", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "testre", "port", "cols", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "test", "Report", "Col", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "rs", "s", "Report", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "rs", "s", "Report", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "RSS", " ", "report", " ", "int", "o", " ", "FILE", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "rs", "sre", "port", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "rs", "s", "Report", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "rs", "s", "Report", "Col", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "rs", "s", "Report", "Col", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Colum", "ns", " ", "for", " ", "RSS", " ", "report", " ", "file", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "rs", "sre", "port", "cols", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "rs", "s", "Report", "Col", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "skip", "DT", "S", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "skip", "DT", "S", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Ski", "p", " ", "DT", "S", " ", "activit", "ies", " ", "(", "load", "ing", ",", " ", "discove", "ry", ",", " ", "validation", "),", " ", "usef", "ul", " ", "whe", "n", " ", "an", " ", "instance", " ", "need", "s", " ", "only", " ", "to", " ", "be", " ", "parsed", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "skip", "dt", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "skip", "DT", "S", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "skip", "Load", "ing", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "skip", "Load", "ing", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Ski", "p", " ", "load", "ing", " ", "discovere", "d", " ", "or", " ", "schema", "Locat", "ed", " ", "files", " ", "matchi", "ng", " ", "pattern", " ", "(", "unix", "-", "style", " ", "file", " ", "name", " ", "pattern", "s", " ", "separate", "d", " ", "by", " ", "'|", "')", ",", " ", "usef", "ul", " ", "whe", "n", " ", "not", " ", "all", " ", "link", "base", "s", " ", "are", " ", "need", "ed", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "skip", "load", "ing", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "skip", "Load", "ing", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "log", "File", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "File", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Write", " ", "log", " ", "message", "s", " ", "int", "o", " ", "file", ",", " ", "other", "wis", "e", " ", "the", "y", " ", "go", " ", "to", " ", "standard", " ", "output", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "If", " ", "file", " ", "ends", " ", "in", " ", ".", "xml", " ", "it", " ", "is", " ", "xml", "-", "format", "ted", ",", " ", "other", "wis", "e", " ", "it", " ", "is", " ", "text", ".", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "logfile", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "File", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "log", "Format", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Format", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Log", "ging", " ", "format", " ", "for", " ", "message", "s", " ", "captur", "e", ",", " ", "other", "wis", "e", " ", "default", " ", "is", " ", "\\\\\"", "[", "%", "(", "message", "Code", ")", "s", "]", " ", "%", "(", "message", ")", "s", " ", "-", " ", "%", "(", "file", ")", "s", "\\\\\".", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "logf", "ormat", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Format", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "log", "Leve", "l", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Leve", "l", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Mini", "mum", " ", "level", " ", "for", " ", "message", "s", " ", "captur", "e", ",", " ", "other", "wis", "e", " ", "the", " ", "message", " ", "is", " ", "ignore", "d", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Curr", "ent", " ", "order", " ", "of", " ", "level", "s", " ", "are", " ", "debug", ",", " ", "info", ",", " ", "info", "-", "sema", "ntic", ",", " ", "warn", "ing", ",", " ", "warn", "ing", "-", "sema", "ntic", ",", " ", "warn", "ing", ",", " ", "assertion", "-", "satisfied", ",", " ", "incon", "siste", "nc", "y", ",", " ", "error", "-", "sema", "ntic", ",", " ", "assertion", "-", "not", "-", "satisfied", ",", " ", "and", " ", "error", ".", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "logl", "evel", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Leve", "l", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "log", "Leve", "l", "Filter", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Leve", "l", "Filter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Regula", "r", " ", "express", "ion", " ", "filter", " ", "for", " ", "log", "Leve", "l", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "E", ".", "g", ".,", " ", "to", " ", "not", " ", "match", " ", "*-", "sema", "ntic", " ", "level", "s", ",", " ", "log", "Leve", "l", "Filter", "=(", "?!", "^", ".*", "-", "sema", "ntic", "$)", "(.+", ").", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "logl", "evel", "filter", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Leve", "l", "Filter", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "log", "Code", "Filter", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Code", "Filter", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Regula", "r", " ", "express", "ion", " ", "filter", " ", "for", " ", "log", " ", "message", " ", "code", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "logc", "ode", "filter", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "log", "Code", "Filter", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "status", "Pipe", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "status", "Pipe", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "monit", "or", "Parent", "Process", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "monit", "or", "Parent", "Process", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "output", "Attrib", "uti", "on", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "output", "Attrib", "uti", "on", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "output", "attribution", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "output", "Attrib", "uti", "on", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "show", "Optio", "ns", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "show", "Optio", "ns", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "parameter", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "parameter", "s", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "parameter", "s", " ", "for", " ", "formula", " ", "and", " ", "validation", " ", "(", "name", "=", "value", "[", ",", "name", "=", "value", "])", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "parameter", "Sepa", "rator", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "parameter", "Sepa", "rator", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "parameter", "s", " ", "separator", " ", "string", " ", "(", "if", " ", "other", " ", "than", " ", "comma", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "parameter", "separator", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "parameter", "Sepa", "rator", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "\"_", ",_", "choices_", "=_", "(_", "\"", "validat", "e", "\"_", ",_", "\"", "run", "\"_", ",_", "\"", "none", "\"_", ")_", ",_", "dest_", "=_", "\"", "formula", "Action", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "action", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "validat", "e", " ", "-", " ", "validat", "e", " ", "only", ",", " ", "with", "out", " ", "runn", "ing", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "run", " ", "-", " ", "validat", "e", " ", "and", " ", "run", ",", " ", "or", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "none", " ", "-", " ", "prevent", " ", "formula", " ", "validation", " ", "or", " ", "runn", "ing", " ", "whe", "n", " ", "als", "o", " ", "speci", "fy", "ing", " ", "-", "v", " ", "or", " ", "--", "validat", "e", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "if", " ", "this", " ", "option", " ", "is", " ", "not", " ", "specified", ",", " ", "-", "v", " ", "or", " ", "--", "validat", "e", " ", "will", " ", "validat", "e", " ", "and", " ", "run", " ", "formulas", " ", "if", " ", "presen", "t", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Param", "Exp", "r", "Result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Param", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "param", "expr", "result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Param", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Param", "Inp", "ut", "Value", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Param", "Inp", "ut", "Value", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "param", "input", "value", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Param", "Inp", "ut", "Value", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Call", "Exp", "r", "Sou", "rce", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Sou", "rce", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "call", "expr", "source", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Sou", "rce", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Call", "Exp", "r", "Code", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Code", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "call", "expr", "code", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Code", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Call", "Exp", "r", "Eval", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Eval", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "call", "expr", "eval", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Eval", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Call", "Exp", "r", "Result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "call", "expr", "tes", "ult", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Call", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Set", "Exp", "r", "Eval", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Set", "Exp", "r", "Eval", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "vars", "ete", "xpr", "eval", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Set", "Exp", "r", "Eval", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Set", "Exp", "r", "Result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Set", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "vars", "ete", "xpr", "result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Set", "Exp", "r", "Result", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Set", "Tim", "ing", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "time", "Varia", "ble", "Set", "Evaluati", "on", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "showin", "g", " ", "times", " ", "of", " ", "variab", "le", " ", "set", " ", "evaluat", "ion", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "vars", "etti", "ming", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "time", "Varia", "ble", "Set", "Evaluati", "on", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Asse", "r", "Result", "Count", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Asse", "r", "Result", "Count", "s", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "ass", "erre", "sult", "count", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Asse", "r", "Result", "Count", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Sat", "isfi", "ed", "Asse", "r", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Sat", "isfi", "ed", "Asse", "r", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formulas", "ati", "sfi", "eda", "sse", "r", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Sat", "isfi", "ed", "Asse", "r", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "unsa", "tis", "fied", "ass", "er", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "Error", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "Error", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "unsa", "tis", "fied", "ass", "ere", "rror", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "Error", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Form", "ula", "Rule", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Form", "ula", "Rule", "s", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "formula", "rule", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Form", "ula", "Rule", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "s", "Order", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "s", "Order", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "vars", "order", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "s", "Order", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Expression", "Sou", "rce", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Sou", "rce", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "express", "ion", "source", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Sou", "rce", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Expression", "Code", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Code", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "express", "ion", "code", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Code", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Expression", "Evaluati", "on", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Evaluati", "on", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "express", "ione", "valuation", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Evaluati", "on", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Expression", "Result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Result", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "express", "ion", "result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Expression", "Result", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Filter", "Win", "now", "ing", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Filter", "Win", "now", "ing", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "filterw", "inno", "wing", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Filter", "Win", "now", "ing", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Var", "Filter", "s", "Result", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Filter", "s", "Result", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", " ", "tracing", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "var", "filter", "sre", "sult", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "formula", "Var", "Filter", "s", "Result", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "Run", "ID", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "formula", "Run", "ID", "s", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "formula", "/", "assertion", " ", "ID", "s", " ", "to", " ", "run", ",", " ", "separate", "d", " ", "by", " ", "a", " ", "'|", "'", " ", "character", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "formula", "runi", "ds", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "formula", "Run", "ID", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "ui", "Lang", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "ui", "Lang", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Lang", "ua", "ge", " ", "for", " ", "user", " ", "interface", " ", "(", "override", " ", "system", " ", "settings", ",", " ", "suc", "h", " ", "as", " ", "program", " ", "message", "s", ").", " ", " ", "Do", "es", " ", "not", " ", "save", " ", "setti", "ng", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "uil", "ang", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "ui", "Lang", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "proxy", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "proxy", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Modif", "y", " ", "and", " ", "re", "-", "save", " ", "proxy", " ", "settings", " ", "configura", "tion", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Enter", " ", "'", "system", "'", " ", "to", " ", "use", " ", "system", " ", "proxy", " ", "setti", "ng", ",", " ", "'", "none", "'", " ", "to", " ", "use", " ", "no", " ", "proxy", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"'", "http", "://", "[", "user", "[:", "password", "]", "@]", "host", "[:", "port", "]'", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "(", "e", ".", "g", ".,", " ", "http", "://", "192", ".1", "68.", "1.2", "5", "3", ",", " ", "http", "://", "example", ".", "com", ":", "808", "0", ",", " ", "http", "://", "jo", "e", ":", "secret", "@", "example", ".", "com", ":", "808", "0", "),", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "or", " ", "'", "show", "'", " ", "to", " ", "show", " ", "current", " ", "setti", "ng", ",", " ", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "t", "Connectivity", "\"_", ",_", "choices_", "=_", "(_", "\"", "onli", "ne", "\"_", ",_", "\"", "offline", "\"_", ")_", ",_", "dest_", "=_", "\"", "interne", "t", "Connectivity", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "interne", "t", " ", "connecti", "vity", ":", " ", "onli", "ne", " ", "or", " ", "offline", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "tcon", "necti", "vity", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Connectivity", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "t", "Time", "out", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Time", "out", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "interne", "t", " ", "connecti", "on", " ", "timeo", "ut", " ", "in", " ", "second", "s", " ", "(", "0", " ", "means", " ", "unlimited", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "tti", "meo", "ut", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Time", "out", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "t", "Rec", "heck", "\"_", ",_", "choices_", "=_", "(_", "\"", "week", "ly", "\"_", ",_", "\"", "daily", "\"_", ",_", "\"", "neve", "r", "\"_", ")_", ",_", "dest_", "=_", "\"", "interne", "t", "Rec", "heck", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "rech", "eck", "ing", " ", "cache", " ", "files", " ", "(", "week", "ly", " ", "is", " ", "default", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "tre", "check", "\"_", ",_", "choices_", "=_", "(_", "\"", "week", "ly", "\"_", ",_", "\"", "daily", "\"_", ",_", "\"", "neve", "r", "\"_", ")_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Rec", "heck", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "t", "Log", "Down", "load", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Log", "Down", "load", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Log", " ", "info", " ", "message", " ", "for", " ", "download", "s", " ", "to", " ", "web", " ", "cache", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "interne", "tlo", "gd", "own", "load", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "interne", "t", "Log", "Down", "load", "s", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "xdg", "Config", "Home", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "xdg", "Config", "Home", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Speci", "fy", " ", "non", "-", "standard", " ", "location", " ", "for", " ", "configura", "tion", " ", "and", " ", "cache", " ", "files", " ", "(", "override", "s", " ", "environ", "ment", " ", "parameter", " ", "XD", "G", "\\u", "CONFIG", "\\u", "HOM", "E", ").\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "plugin", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "plugin", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Modif", "y", " ", "plug", "-", "in", " ", "configura", "tion", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Re", "-", "save", " ", "unl", "ess", " ", "'", "temp", "'", " ", "is", " ", "in", " ", "the", " ", "module", " ", "list", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Enter", " ", "'", "show", "'", " ", "to", " ", "show", " ", "current", " ", "plug", "-", "in", " ", "configura", "tion", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Command", "s", " ", "show", ",", " ", "and", " ", "module", " ", "urls", " ", "are", " ", "'|", "'", " ", "separate", "d", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"+", "url", " ", "to", " ", "add", " ", "plug", "-", "in", " ", "by", " ", "its", " ", "url", " ", "or", " ", "filename", ",", " ", "~", "name", " ", "to", " ", "relo", "ad", " ", "a", " ", "plug", "-", "in", " ", "by", " ", "its", " ", "name", ",", " ", "-", "name", " ", "to", " ", "remove", " ", "a", " ", "plug", "-", "in", " ", "by", " ", "its", " ", "name", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "relative", " ", "URL", "s", " ", "are", " ", "relative", " ", "to", " ", "installation", " ", "plug", "-", "in", " ", "director", "y", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "(", "e", ".", "g", ".,", " ", "'+", "http", "://", "are", "lle", ".", "org", "/", "files", "/", "hell", "o", "\\u", "web", ".", "py", "',", " ", "'+", "C", ":\\\\", "Program", " ", "Files", "\\\\", "Are", "lle", "\\\\", "example", "s", "\\\\", "plugin", "\\\\", "hell", "o", "\\u", "dol", "ly", ".", "py", "'", " ", "to", " ", "load", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "or", " ", "+.", "./", "example", "s", "/", "plugin", "/", "hell", "o", "\\u", "dol", "ly", ".", "py", " ", "for", " ", "relative", " ", "use", " ", "of", " ", "example", "s", " ", "director", "y", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "~", "Hell", "o", " ", "Dol", "ly", " ", "to", " ", "relo", "ad", ",", " ", "-", "Hell", "o", " ", "Dol", "ly", " ", "to", " ", "remove", ").", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "If", " ", "+", " ", "is", " ", "omit", "ted", " ", "from", " ", ".", "py", " ", "file", " ", "not", "hing", " ", "is", " ", "saved", " ", "(", "same", " ", "as", " ", "temp", ").", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Packa", "ged", " ", "plug", "-", "in", " ", "urls", " ", "are", " ", "thei", "r", " ", "director", "y", "'", "s", " ", "url", ".", " ", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "package", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "package", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Modif", "y", " ", "taxonom", "y", " ", "package", "s", " ", "configura", "tion", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Re", "-", "save", " ", "unl", "ess", " ", "'", "temp", "'", " ", "is", " ", "in", " ", "the", " ", "module", " ", "list", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Enter", " ", "'", "show", "'", " ", "to", " ", "show", " ", "current", " ", "package", "s", " ", "configura", "tion", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Command", "s", " ", "show", ",", " ", "and", " ", "module", " ", "urls", " ", "are", " ", "'|", "'", " ", "separate", "d", ":", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"+", "url", " ", "to", " ", "add", " ", "package", " ", "by", " ", "its", " ", "url", " ", "or", " ", "filename", ",", " ", "~", "name", " ", "to", " ", "relo", "ad", " ", "package", " ", "by", " ", "its", " ", "name", ",", " ", "-", "name", " ", "to", " ", "remove", " ", "a", " ", "package", " ", "by", " ", "its", " ", "name", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "URL", "s", " ", "are", " ", "full", " ", "abs", "olute", " ", "path", "s", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "If", " ", "+", " ", "is", " ", "omit", "ted", " ", "from", " ", "package", " ", "file", " ", "not", "hing", " ", "is", " ", "saved", " ", "(", "same", " ", "as", " ", "temp", ").", " ", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "package", "Manifest", "Name", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "package", "Manifest", "Name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Prov", "ide", " ", "non", "-", "standard", " ", "archive", " ", "manifest", " ", "file", " ", "name", " ", "pattern", " ", "(", "e", ".", "g", ".,", " ", "*", "taxonom", "y", "Packa", "ge", ".", "xml", ").", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Us", "es", " ", "unix", " ", "file", " ", "name", " ", "pattern", " ", "matchi", "ng", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Multipl", "e", " ", "manifest", " ", "files", " ", "are", " ", "support", "ed", " ", "in", " ", "archive", " ", "(", "suc", "h", " ", "as", " ", "oas", "is", " ", "catalogs", ").", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "Replace", "s", " ", "search", " ", "for", " ", "eit", "her", " ", ".", "taxonom", "y", "Packa", "ge", ".", "xml", " ", "or", " ", "catal", "og", ".", "xml", ").", " ", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "abort", "On", "Maj", "or", "Error", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "abort", "On", "Maj", "or", "Error", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Abo", "rt", " ", "process", " ", "on", " ", "major", " ", "error", ",", " ", "suc", "h", " ", "as", " ", "whe", "n", " ", "load", " ", "is", " ", "una", "ble", " ", "to", " ", "find", " ", "an", " ", "entry", " ", "or", " ", "discovere", "d", " ", "file", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "show", "Environ", "ment", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "show", "Environ", "ment", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Show", " ", "Are", "lle", "'", "s", " ", "config", " ", "and", " ", "cache", " ", "director", "y", " ", "and", " ", "host", " ", "OS", " ", "environ", "ment", " ", "parameter", "s", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "show", "environ", "ment", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "show", "Environ", "ment", "\"_", ",_", "help_", "=_", "SUPPRESS", "\\u", "HELP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "collect", "Profil", "e", "Stat", "s", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "collect", "Profil", "e", "Stat", "s", "\"_", ",_", "help_", "=_", "\\u_", "(_", "\"", "Collect", " ", "profile", " ", "statistic", "s", ",", " ", "suc", "h", " ", "as", " ", "tim", "ing", " ", "of", " ", "validation", " ", "activit", "ies", " ", "and", " ", "formula", "e", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "has", "Web", "Server_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "webse", "rver", "\"_", ",_", "action_", "=_", "\"", "store", "\"_", ",_", "dest_", "=_", "\"", "webse", "rver", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "start", " ", "web", " ", "server", " ", "on", " ", "host", ":", "port", "[:", "server", "]", " ", "for", " ", "REST", " ", "and", " ", "web", " ", "access", ",", " ", "e", ".", "g", ".,", " ", "--", "webse", "rver", " ", "loc", "ah", "ost", ":", "808", "0", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "or", " ", "speci", "fy", " ", "nond", "efa", "ult", " ", "a", " ", "server", " ", "name", ",", " ", "suc", "h", " ", "as", " ", "cherr", "yp", "y", ",", " ", "--", "webse", "rver", " ", "loc", "ah", "ost", ":", "808", "0", ":", "cherr", "yp", "y", ".", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "It", " ", "is", " ", "possib", "le", " ", "to", " ", "speci", "fy", " ", "options", " ", "to", " ", "be", " ", "default", "s", " ", "for", " ", "the", " ", "web", " ", "server", ",", " ", "suc", "h", " ", "as", " ", "discl", "osu", "re", "System", " ", "and", " ", "validation", "s", ",", " ", "but", " ", "not", " ", "inclu", "ding", " ", "file", " ", "names", ".)", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plugin", "Optio", "ns", "Index_", "=_", "len_", "(_", "parser_", "._", "option", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "install", " ", "any", " ", "dynami", "c", " ", "plugin", "s", " ", "so", " ", "thei", "r", " ", "command", " ", "line", " ", "options", " ", "can", " ", "be", " ", "parsed", " ", "if", " ", "present_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "arg_", "in_", "enumerate_", "(_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "arg_", "._", "startswith_", "(_", "'--", "plugin", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "arg_", ")_", ">_", "9_", "and_", "arg_", "[_", "9_", "]_", "==_", "'='_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prelo", "ad", "Plugins_", "=_", "arg_", "[_", "10_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "i_", "<_", "len_", "(_", "args_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prelo", "ad", "Plugins_", "=_", "args_", "[_", "i_", "+_", "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 ", " _", "prelo", "ad", "Plugins_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "plugin", "Cmd_", "in_", "prelo", "ad", "Plugins_", "._", "split_", "(_", "'|'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "plugin", "Cmd_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "not_", "in_", "(_", "\"", "show", "\"_", ",_", "\"", "temp", "\"_", ")_", "and_", "len_", "(_", "cmd_", ")_", ">_", "0_", "and_", "cmd_", "[_", "0_", "]_", "not_", "in_", "(_", "'-'_", ",_", "'~'_", ",_", "'+'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "module", "Info_", "=_", "Plug", "in", "Manager_", "._", "add", "Plug", "in", "Module_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cnt", "lr_", "._", "prelo", "aded", "Plugins_", "[_", "cmd_", "]_", "=_", "module", "Info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Plug", "in", "Manager_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "plug", "-", "in", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "options", "Extend", "er_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Optio", "ns", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options", "Extend", "er_", "(_", "parser_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plugin", "Las", "t", "Optio", "n", "Index_", "=_", "len_", "(_", "parser_", "._", "option", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "a", "\"_", ",_", "\"--", "abo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "dest_", "=_", "\"", "abo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\\u_", "(_", "\"", "Show", " ", "product", " ", "version", ",", " ", "copyr", "ight", ",", " ", "and", " ", "license", ".\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "args_", "and_", "cnt", "lr_", "._", "is", "GA", "E_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "\"--", "webse", "rver", "=", "::", "gae", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cnt", "lr_", "._", "is", "CGI", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "[_", "\"--", "webse", "rver", "=", "::", "cgi", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cnt", "lr_", "._", "is", "MS", "W_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "call", "ed", " ", "from", " ", "java", " ", "on", " ", "Window", "s", " ", "any", " ", "empty", "-", "string", " ", "argu", "ment", "s", " ", "are", " ", "lost", ",", " ", "see", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "bug", "s", ".", "java", ".", "com", "/", "view", "\\u", "bug", ".", "do", "?", "bug", "\\u", "id", "=", "651", "882", "7_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "insert", " ", "need", "ed", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "source", "Args_", "=_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "named", "Options_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options", "With", "Arg_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "option_", "in_", "parser_", "._", "option", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names_", "=_", "str_", "(_", "option_", ")_", "._", "split_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "named", "Options_", "._", "update_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "option_", "._", "action_", "==_", "\"", "store", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options", "With", "Arg_", "._", "update_", "(_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prior", "Arg_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "arg_", "in_", "source", "Args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "prior", "Arg_", "in_", "options", "With", "Arg_", "and_", "arg_", "in_", "named", "Options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "probab", "le", " ", "java", "/", "MS", "FT", " ", "interface", " ", "bug", " ", "651", "882", "7_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "append_", "(_", "''_", ")_", "#", " ", "add", " ", "empty", " ", "string", " ", "argument_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remove", " ", "quoting", " ", "if", " ", "argu", "ment", "s", " ", "quoted", " ", "according", " ", "to", " ", "http", "://", "bug", "s", ".", "java", ".", "com", "/", "view", "\\u", "bug", ".", "do", "?", "bug", "\\u", "id", "=", "651", "882", "7_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "r", "'\\\\\"", "'_", "in_", "arg_", ":_", "#", " ", "e", ".", "g", ".,", " ", "[{", "\\\\\"", "foo", "\\\\\":", "\\\\\"", "bar", "\\\\\"", "}]", " ", "->", " ", "[{", "\"", "foo", "\":\"", "bar", "\"}]", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg_", "=_", "arg_", "._", "replace_", "(_", "r", "'\\\\\"", "'_", ",_", "'\"'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "args_", "._", "append_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prior", "Arg_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "options_", ",_", "lefto", "ver", "Args_", ")_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "about_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\\u_", "(_", "\"\\\\", "nar", "elle", "(", "r", ")", " ", "{", "0", "}", "bit", " ", "{", "1", "}\\\\", "n", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "An", " ", "open", " ", "source", " ", "XB", "RL", " ", "platform", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"(", "c", ")", " ", "2010", "-", "201", "5", " ", "Mark", " ", "V", " ", "System", "s", " ", "Limit", "ed", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "All", " ", "rights", " ", "reserve", "d", "\\\\", "nh", "ttp", "://", "www", ".", "are", "lle", ".", "org", "\\\\", "nsu", "ppo", "rt", "@", "are", "lle", ".", "org", "\\\\", "n", "\\\\", "n", "\"_", "\\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", " ", "\\\\", "nus", "e", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "\\\\", "nof", " ", "the", " ", "License", " ", "at", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"'", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "'\\\\", "n", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", " ", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\\\\\"", "AS", " ", "IS", "\\\\\"", " ", "BAS", "IS", ",", " ", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", " ", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "\\\\", "n", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "n", "\\\\", "n", "Includes", ":\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "n", " ", " ", " ", "Pyth", "on", "(", "r", ")", " ", "{", "3", "[", "0", "]}", ".", "{", "3", "[", "1", "]}", ".", "{", "3", "[", "2", "]}", " ", "(", "c", ")", " ", "200", "1", "-", "2013", " ", "Pyth", "on", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "n", " ", " ", " ", "Py", "Pars", "ing", " ", "(", "c", ")", " ", "2003", "-", "2013", " ", "Paul", " ", "T", ".", " ", "Mc", "Gui", "re", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "n", " ", " ", " ", "lx", "ml", " ", "{", "4", "[", "0", "]}", ".", "{", "4", "[", "1", "]}", ".", "{", "4", "[", "2", "]}", " ", "(", "c", ")", " ", "2004", " ", "Infra", "e", ",", " ", "Element", "Tree", " ", "(", "c", ")", " ", "1999", "-", "2004", " ", "by", " ", "Fre", "dri", "k", " ", "Lun", "dh", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"{", "2", "}\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "n", " ", " ", " ", "Ma", "y", " ", "include", " ", "install", "able", " ", "plug", "-", "in", " ", "module", "s", " ", "with", " ", "author", "-", "specific", " ", "license", " ", "term", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "format_", "(_", "cnt", "lr_", "._", "system", "Word", "Size_", ",_", "Version_", "._", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"\\\\", "n", " ", " ", " ", "Bott", "le", " ", "(", "c", ")", " ", "2011", "-", "2013", " ", "Marc", "el", " ", "Hell", "kam", "p", "\"_", ")_", "if_", "has", "Web", "Server_", "else_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "version", "\\u", "info_", ",_", "etree_", "._", "LX", "ML", "\\u", "VERSION_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "discl", "osu", "re", "System", "Name_", "in_", "(_", "\"", "help", "\"_", ",_", "\"", "help", "-", "verbo", "se", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "\\u_", "(_", "\"", "Disc", "los", "ure", " ", "system", " ", "choice", "s", ":", " ", "\\\\", "n", "{", "0", "}\"_", ")_", "._", "format_", "(_", "'", " ", "\\\\", "n", "'_", "._", "join_", "(_", "cnt", "lr_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "dir", "list_", "(_", "options_", "._", "discl", "osu", "re", "System", "Name_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Unic", "ode", "Encode", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "text_", "._", "encode_", "(_", "\"", "ascii", "\"_", ",_", "\"", "replace", "\"_", ")_", "._", "decode_", "(_", "\"", "ascii", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "lefto", "ver", "Args_", ")_", "!=_", "0_", "and_", "(_", "not_", "has", "Web", "Server_", "or_", "options_", "._", "webse", "rver_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "\\u_", "(_", "\"", "unre", "cogni", "zed", " ", "argu", "ment", "s", ":", " ", "{}\"_", "._", "format_", "(_", "',", " ", "'_", "._", "join_", "(_", "lefto", "ver", "Args_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "options_", "._", "entrypoint", "File_", "is_", "None_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "not_", "options_", "._", "proxy_", ")_", "and_", "(_", "not_", "options_", "._", "plugins_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "any_", "(_", "plugin", "Option_", "for_", "plugin", "Option_", "in_", "parser_", "._", "option", "\\u", "list_", "[_", "plugin", "Optio", "ns", "Index_", ":_", "plugin", "Las", "t", "Optio", "n", "Index_", "]_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "not_", "has", "Web", "Server_", "or_", "options_", "._", "webse", "rver_", "is_", "None_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "\\u_", "(_", "\"", "incorrect", " ", "argu", "ment", "s", ",", " ", "plea", "se", " ", "try", "\\\\", "n", " ", " ", "python", " ", "Cnt", "lr", "Cmd", "Line", ".", "py", " ", "--", "help", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "has", "Web", "Server_", "and_", "options_", "._", "webse", "rver_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "webse", "rver", " ", "incomp", "atible", " ", "with", " ", "file", " ", "operations_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "any_", "(_", "(_", "options_", "._", "entrypoint", "File_", ",_", "options_", "._", "import", "Files_", ",_", "options_", "._", "diff", "File_", ",_", "options_", "._", "vers", "Report", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "fact", "s", "File_", ",_", "options_", "._", "fact", "List", "Cols_", ",_", "options_", "._", "fact", "Table", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "concepts", "File_", ",_", "options_", "._", "pre", "File_", ",_", "options_", "._", "cal", "File_", ",_", "options_", "._", "dim", "File_", ",_", "options_", "._", "formula", "e", "File_", ",_", "options_", "._", "view", "Arc", "role_", ",_", "options_", "._", "view", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "role", "Type", "s", "File_", ",_", "options_", "._", "arc", "role", "Type", "s", "File_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "._", "error_", "(_", "\\u_", "(_", "\"", "incorrect", " ", "argu", "ment", "s", " ", "with", " ", "--", "webse", "rver", ",", " ", "plea", "se", " ", "try", "\\\\", "n", " ", " ", "python", " ", "Cnt", "lr", "Cmd", "Line", ".", "py", " ", "--", "help", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "note", " ", "tha", "t", " ", "web", " ", "server", " ", "logg", "ing", " ", "doe", "s", " ", "not", " ", "strip", " ", "time", " ", "stamp", ",", " ", "use", " ", "log", "Format", " ", "if", " ", "tha", "t", " ", "is", " ", "desired_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cnt", "lr_", "._", "start", "Logging_", "(_", "log", "File", "Name_", "=_", "'", "log", "To", "Buffer", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "are", "lle", "_", "import_", "Cnt", "lr", "Web", "Main_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "Cnt", "lr", "Web", "Main_", "._", "start", "Webs", "erver_", "(_", "cnt", "lr_", ",_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "webse", "rver_", "==_", "':", ":", "wsgi", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "and", " ", "run", " ", "the", " ", "FILENAME_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cnt", "lr_", "._", "start", "Logging_", "(_", "log", "File", "Name_", "=_", "(_", "options_", "._", "log", "File_", "or_", "\"", "log", "To", "Print", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "Format_", "=_", "(_", "options_", "._", "log", "Format_", "or_", "\"[", "%", "(", "message", "Code", ")", "s", "]", " ", "%", "(", "message", ")", "s", " ", "-", " ", "%", "(", "file", ")", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "Level_", "=_", "(_", "options_", "._", "log", "Level_", "or_", "\"", "DEBU", "G", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "To", "Buffer_", "=_", "getattr_", "(_", "options_", ",_", "\"", "log", "To", "Buffer", "\"_", ",_", "False_", ")_", ")_", "#", " ", "e", ".", "g", ".,", " ", "used", " ", "by", " ", "Ed", "gar", "Render", "er", " ", "to", " ", "require", " ", "buffered", " ", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt", "lr_", "._", "run_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "cnt", "lr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "Parser", "For", "Dynamic", "Plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser", "For", "Dynamic", "Plugins_", ":_", "\\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_", ",_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "options_", "=_", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Parser", "For", "Dynamic", "Plugins_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "option_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "dest", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "dest_", "=_", "kwargs_", "[_", "'", "dest", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "self_", "._", "options_", ",_", "\\u", "dest_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "self_", "._", "options_", ",_", "\\u", "dest_", ",_", "kwargs_", "._", "get_", "(_", "'", "default", "'_", ",_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Cnt", "lr", "Cmd", "Line_", "(_", "Cnt", "lr_", "._", "Cnt", "lr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "..", " ", "class", "::", " ", "Cnt", "lr", "Cmd", "Lin", "()", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Initializ", "ation", " ", "sets", " ", "up", " ", "for", " ", "platform", " ", "via", " ", "Cnt", "lr", ".", "Cnt", "lr", ".", "\\", "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_", "#", " ", "default", " ", "web", " ", "authenticat", "ion", " ", "password_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "special", " ", "show", " ", "status", " ", "for", " ", "named", " ", "pipes_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Cnt", "lr", "Cmd", "Line_", "(_", "Cnt", "lr_", "._", "Cnt", "lr_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "log", "File", "Name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Cnt", "lr", "Cmd", "Line_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "has", "Gui_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "prelo", "aded", "Plugins_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cnt", "lr", "Cmd", "Line_", "(_", "Cnt", "lr_", "._", "Cnt", "lr_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "options_", ",_", "source", "Zip", "Stream_", "=_", "None_", ",_", "response", "Zip", "Stream_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Process", " ", "command", " ", "line", " ", "argu", "ment", "s", " ", "or", " ", "web", " ", "service", " ", "request", ",", " ", "suc", "h", " ", "as", " ", "to", " ", "load", " ", "and", " ", "validat", "e", " ", "an", " ", "XB", "RL", " ", "document", ",", " ", "or", " ", "start", " ", "web", " ", "server", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "a", " ", "web", " ", "server", " ", "has", " ", "bee", "n", " ", "request", "ed", ",", " ", "this", " ", "method", " ", "may", " ", "be", " ", "call", "ed", " ", "multiple", " ", "times", ",", " ", "onc", "e", " ", "for", " ", "each", " ", "web", " ", "service", " ", "(", "REST", ")", " ", "request", " ", "tha", "t", " ", "require", "s", " ", "process", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "Ot", "her", "wis", "e", " ", "(", "whe", "n", " ", "call", "ed", " ", "for", " ", "a", " ", "command", " ", "line", " ", "request", ")", " ", "this", " ", "method", " ", "is", " ", "call", "ed", " ", "only", " ", "onc", "e", " ", "for", " ", "the", " ", "command", " ", "line", " ", "argu", "ment", "s", " ", "request", ".", "\\", "10", ";", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "options", ":", " ", "Optio", "n", "Parser", " ", "options", " ", "from", " ", "parse", "\\u", "args", " ", "of", " ", "main", " ", "argv", " ", "argu", "ment", "s", " ", "(", "whe", "n", " ", "call", "ed", " ", "from", " ", "command", " ", "line", ")", " ", "or", " ", "correspond", "ing", " ", "argu", "ment", "s", " ", "from", " ", "web", " ", "service", " ", "(", "REST", ")", " ", "request", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "options", ":", " ", "optparse", ".", "Value", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "status", "Pipe_", "or_", "options_", "._", "monit", "or", "Parent", "Process_", ":_", "\\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 ", " _", "global_", "win32", "file_", ",_", "win32", "api_", ",_", "win32", "process_", ",_", "pywi", "ntype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "win32", "file_", ",_", "win32", "api_", ",_", "win32", "process_", ",_", "pywi", "ntype", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "#", " ", "win32", " ", "not", " ", "installed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\"--", "status", "Pipe", " ", "{}", " ", "cann", "ot", " ", "be", " ", "install", "ed", ",", " ", "package", "s", " ", "for", " ", "win32", " ", "missi", "ng", "\"_", "._", "format_", "(_", "options_", "._", "status", "Pipe_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "options_", "._", "status", "Pipe_", "=_", "options_", "._", "monit", "or", "Parent", "Process_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "status", "Pipe_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "status", "Pipe_", "=_", "win32", "file_", "._", "Creat", "e", "File_", "(_", "\"\\\\\\\\\\\\", "\\\\.\\\\", "\\\\", "pipe", "\\\\\\\\", "{}\"_", "._", "format_", "(_", "options_", "._", "status", "Pipe_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "win32", "file_", "._", "GENERIC", "\\u", "READ_", "|_", "win32", "file_", "._", "GENERIC", "\\u", "WRITE_", ",_", "0_", ",_", "None_", ",_", "win32", "file_", "._", "OPEN", "\\u", "EXIST", "ING_", ",_", "win32", "file_", "._", "FILE", "\\u", "FLAG", "\\u", "NO", "\\u", "BUFF", "ERI", "NG_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "show", "Status_", "=_", "self_", "._", "show", "Status", "On", "Pipe_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "last", "Status", "Time_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parent", "Process", "Handle_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "pywi", "ntype", "s_", "._", "error_", ":_", "#", " ", "named", " ", "pipe", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\"--", "status", "Pipe", " ", "{}", " ", "has", " ", "not", " ", "bee", "n", " ", "created", " ", "by", " ", "calling", " ", "program", "\"_", "._", "format_", "(_", "options_", "._", "status", "Pipe_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "monit", "or", "Parent", "Process_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parent", "Process", "Handle_", "=_", "win32", "api_", "._", "Open", "Process_", "(_", "PROCESS", "\\u", "QUE", "RY", "\\u", "INFORMATION", "_", ",_", "False_", ",_", "int_", "(_", "options_", "._", "monit", "or", "Parent", "Process_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "monit", "or", "Parent", "Process_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "win32", "process_", "._", "Get", "Exi", "t", "Code", "Process_", "(_", "self_", "._", "parent", "Process", "Handle_", ")_", "!=_", "STI", "LL", "\\u", "ACTIVE_", ":_", "\\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_", "\\u", "t_", "=_", "threading_", "._", "Timer_", "(_", "10.0_", ",_", "monit", "or", "Parent", "Process_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "t_", "._", "daemon_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "t_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "monit", "or", "Parent", "Process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "#", " ", "win32", " ", "not", " ", "installed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\"--", "monit", "or", "Parent", "Process", " ", "{}", " ", "cann", "ot", " ", "be", " ", "install", "ed", ",", " ", "package", "s", " ", "for", " ", "win32", "api", " ", "and", " ", "win32", "process", " ", "missi", "ng", "\"_", "._", "format_", "(_", "options_", "._", "monit", "or", "Parent", "Process_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Value", "Error_", ",_", "pywi", "ntype", "s_", "._", "error_", ")_", ":_", "#", " ", "parent", " ", "process", " ", "doe", "sn", "'", "t", " ", "exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\"--", "monit", "or", "Parent", "Process", " ", "Process", " ", "{}", " ", "Id", " ", "is", " ", "invalid", "\"_", "._", "format_", "(_", "options_", "._", "monit", "or", "Parent", "Process_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "show", "Options_", ":_", "#", " ", "debug", " ", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "opt", "Name_", ",_", "opt", "Value_", "in_", "sorted_", "(_", "options_", "._", "\\u\\u", "dict\\u\\u_", "._", "items_", "(_", ")_", ",_", "key_", "=_", "lambda_", "opt", "Item_", ":_", "opt", "Item_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\"", "Optio", "n", " ", "{", "0", "}=", "{", "1", "}\"_", "._", "format_", "(_", "opt", "Name_", ",_", "opt", "Value_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "\"", "sys", ".", "argv", " ", "{", "0", "}\"_", "._", "format_", "(_", "sys_", "._", "argv_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "ui", "Lang_", ":_", "#", " ", "set", " ", "current", " ", "UI", " ", "Lang", " ", "(", "but", " ", "not", " ", "config", " ", "setti", "ng", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Ui", "Language_", "(_", "options_", "._", "ui", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "proxy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "proxy_", "!=_", "\"", "show", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy", "Settings_", "=_", "proxy", "Tuple_", "(_", "options_", "._", "proxy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "web", "Cache_", "._", "reset", "Proxi", "es_", "(_", "proxy", "Settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "[_", "\"", "proxy", "Sett", "ings", "\"_", "]_", "=_", "proxy", "Settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "save", "Config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Pro", "xy", " ", "configura", "tion", " ", "has", " ", "bee", "n", " ", "set", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "use", "Os", "Proxy_", ",_", "url", "Addr_", ",_", "url", "Port_", ",_", "user_", ",_", "password_", "=_", "self_", "._", "config_", "._", "get_", "(_", "\"", "proxy", "Sett", "ings", "\"_", ",_", "proxy", "Tuple_", "(_", "\"", "none", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "use", "Os", "Proxy_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Pro", "xy", " ", "configur", "ed", " ", "to", " ", "use", " ", "{", "0", "}.\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "Micro", "soft", " ", "Window", "s", " ", "Intern", "et", " ", "Sett", "ings", "'_", ")_", "if_", "sys_", "._", "platform_", "._", "startswith_", "(_", "\"", "win", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "(_", "\\u_", "(_", "'", "Mac", " ", "OS", " ", "X", " ", "System", " ", "Configura", "tion", "'_", ")_", "if_", "sys_", "._", "platform_", "in_", "(_", "\"", "dar", "win", "\"_", ",_", "\"", "macos", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\\u_", "(_", "'", "environ", "ment", " ", "variab", "les", "'_", ")_", ")_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "url", "Addr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Pro", "xy", " ", "setti", "ng", ":", " ", "http", "://", "{", "0", "}{", "1", "}{", "2", "}{", "3", "}{", "4", "}\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "if_", "user_", "else_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\":", "****", "\"_", "if_", "password_", "else_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"@\"_", "if_", "(_", "user_", "or_", "password_", ")_", "else_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "url", "Addr_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\":{", "0", "}\"_", "._", "format_", "(_", "url", "Port_", ")_", "if_", "url", "Port_", "else_", "\"\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Pro", "xy", " ", "is", " ", "disable", "d", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reset", "Plugins_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "Plug", "in", "Changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Plug", "in", "Modules_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "plugin", "Cmd_", "in_", "options_", "._", "plugins_", "._", "split_", "(_", "'|'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "plugin", "Cmd_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "==_", "\"", "show", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "show", "Plug", "in", "Modules_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "==_", "\"", "temp", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "save", "Plug", "in", "Changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"+\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "module", "Info_", "=_", "Plug", "in", "Manager_", "._", "add", "Plug", "in", "Module_", "(_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Addition", " ", "of", " ", "plug", "-", "in", " ", "{", "0", "}", " ", "success", "ful", ".\"_", ")_", "._", "format_", "(_", "module", "Info_", "._", "get_", "(_", "\"", "name", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "module", "Info_", "._", "get_", "(_", "\"", "module", "URL", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reset", "Plugins_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Optio", "ns", "\"_", "in_", "module", "Info_", "[_", "\"", "class", "Meth", "ods", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "adde", "d", "Plug", "in", "With", "Cnt", "lr", "Cmd", "Line", "Options_", "=_", "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 ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "load", " ", "plug", "-", "in", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"~\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "Plug", "in", "Manager_", "._", "relo", "ad", "Plug", "in", "Module_", "(_", "cmd_", "[_", "1_", ":_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Relo", "ad", " ", "of", " ", "plug", "-", "in", " ", "success", "ful", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reset", "Plugins_", "=_", "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_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "relo", "ad", " ", "plug", "-", "in", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"-\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "Plug", "in", "Manager_", "._", "remove", "Plug", "in", "Module_", "(_", "cmd_", "[_", "1_", ":_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Deletion", " ", "of", " ", "plug", "-", "in", " ", "success", "ful", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reset", "Plugins_", "=_", "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_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "delete", " ", "plug", "-", "in", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "assume", " ", "it", " ", "is", " ", "a", " ", "module", " ", "or", " ", "package", " ", "(", "may", " ", "als", "o", " ", "have", " ", "bee", "n", " ", "load", "ed", " ", "bef", "ore", " ", "for", " ", "option", " ", "pars", "ing", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "save", "Plug", "in", "Changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "in_", "self_", "._", "prelo", "aded", "Plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "module", "Info_", "=_", "self_", "._", "prelo", "aded", "Plugins_", "[_", "cmd_", "]_", "#", " ", "alr", "ead", "y", " ", "load", "ed", ",", " ", "add", " ", "activation", " ", "message", " ", "to", " ", "log", " ", "below_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "module", "Info_", "=_", "Plug", "in", "Manager_", "._", "add", "Plug", "in", "Module_", "(_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "reset", "Plugins_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Activat", "ion", " ", "of", " ", "plug", "-", "in", " ", "{", "0", "}", " ", "success", "ful", ",", " ", "version", " ", "{", "1", "}.\"_", ")_", "._", "format_", "(_", "module", "Info_", "._", "get_", "(_", "\"", "name", "\"_", ")_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "version", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "module", "Info_", "._", "get_", "(_", "\"", "module", "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 ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "load", " ", "\\\\\"", "%", "(", "name", ")", "s", "\\\\\"", " ", "as", " ", "a", " ", "plug", "-", "in", " ", "or", " ", "\\\\\"", "%", "(", "name", ")", "s", "\\\\\"", " ", "is", " ", "not", " ", "recognize", "d", " ", "as", " ", "a", " ", "plugin", " ", "command", ".", " ", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "are", "lle", ":", "plugin", "Parameter", "Error", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Args_", "=_", "{_", "\"", "name", "\"_", ":_", "cmd_", ",_", "\"", "file", "\"_", ":_", "cmd_", "}_", ",_", "level_", "=_", "logging_", "._", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "reset", "Plugins_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "Plug", "in", "Manager_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "save", "Plug", "in", "Changes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "Plug", "in", "Manager_", "._", "save_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "webse", "rver_", ":_", "#", " ", "options", " ", "may", " ", "need", " ", "repar", "sing", " ", "dynami", "call", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u", "options", "Parser_", "=_", "Parser", "For", "Dynamic", "Plugins_", "(_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "plug", "-", "in", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "options", "Extend", "er_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Optio", "ns", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "options", "Extend", "er_", "(_", "\\u", "options", "Parser_", ")_", "\\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_", "if_", "show", "Plug", "in", "Modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Plug", "-", "in", " ", "module", "s", ":\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "module", "Item_", "in_", "enumerate_", "(_", "sorted_", "(_", "Plug", "in", "Manager_", "._", "plugin", "Config_", "._", "get_", "(_", "\"", "module", "s", "\"_", ",_", "{_", "}_", ")_", "._", "items_", "(_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "module", "Info_", "=_", "module", "Item_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Plug", "-", "in", ":", " ", "{", "0", "};", " ", "author", ":", " ", "{", "1", "};", " ", "version", ":", " ", "{", "2", "};", " ", "status", ":", " ", "{", "3", "};", " ", "date", ":", " ", "{", "4", "};", " ", "description", ":", " ", "{", "5", "};", " ", "license", " ", "{", "6", "}.\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "module", "Item_", "[_", "0_", "]_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "author", "\"_", ")_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "version", "\"_", ")_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "status", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "Info_", "._", "get_", "(_", "\"", "file", "Date", "\"_", ")_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "description", "\"_", ")_", ",_", "module", "Info_", "._", "get_", "(_", "\"", "license", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "module", "Info_", "._", "get_", "(_", "\"", "module", "URL", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "are", "lle", "_", "import_", "Packa", "ge", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "save", "Packa", "ges", "Changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "show", "Packages_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "package", "Cmd_", "in_", "options_", "._", "packages_", "._", "split_", "(_", "'|'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "package", "Cmd_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cmd_", "==_", "\"", "show", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "show", "Packages_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "==_", "\"", "temp", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "save", "Packa", "ges", "Changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"+\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "package", "Info_", "=_", "Packa", "ge", "Manager_", "._", "add", "Package_", "(_", "self_", ",_", "cmd_", "[_", "1_", ":_", "]_", ",_", "options_", "._", "package", "Manifest", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "package", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Addition", " ", "of", " ", "package", " ", "{", "0", "}", " ", "success", "ful", ".\"_", ")_", "._", "format_", "(_", "package", "Info_", "._", "get_", "(_", "\"", "name", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "package", "Info_", "._", "get_", "(_", "\"", "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 ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "load", " ", "package", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"~\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "Packa", "ge", "Manager_", "._", "relo", "ad", "Packa", "ge", "Module_", "(_", "self_", ",_", "cmd_", "[_", "1_", ":_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Relo", "ad", " ", "of", " ", "package", " ", "success", "ful", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "relo", "ad", " ", "package", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "cmd_", "._", "startswith_", "(_", "\"-\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "Packa", "ge", "Manager_", "._", "remove", "Packa", "ge", "Module_", "(_", "self_", ",_", "cmd_", "[_", "1_", ":_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Deletion", " ", "of", " ", "package", " ", "success", "ful", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "delete", " ", "package", ".\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "cmd_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "assume", " ", "it", " ", "is", " ", "a", " ", "module", " ", "or", " ", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "save", "Packa", "ges", "Changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "Info_", "=_", "Packa", "ge", "Manager_", "._", "add", "Package_", "(_", "self_", ",_", "cmd_", ",_", "options_", "._", "package", "Manifest", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "package", "Info_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Activat", "ion", " ", "of", " ", "package", " ", "{", "0", "}", " ", "success", "ful", ".\"_", ")_", "._", "format_", "(_", "package", "Info_", "._", "get_", "(_", "\"", "name", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "package", "Info_", "._", "get_", "(_", "\"", "URL", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reset", "Plugins_", "=_", "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_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Una", "ble", " ", "to", " ", "load", " ", "package", " ", "\\\\\"", "%", "(", "name", ")", "s", "\\\\\".", " ", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "are", "lle", ":", "package", "Load", "ing", "Error", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Args_", "=_", "{_", "\"", "name", "\"_", ":_", "cmd_", ",_", "\"", "file", "\"_", ":_", "cmd_", "}_", ",_", "level_", "=_", "logging_", "._", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Packa", "ge", "Manager_", "._", "package", "s", "Config", "Changed_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Packa", "ge", "Manager_", "._", "rebu", "ild", "Rema", "ppi", "ngs_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "save", "Packa", "ges", "Changes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Packa", "ge", "Manager_", "._", "save_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Packa", "ge", "Manager_", "._", "package", "s", "Config", "Changed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "show", "Packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Taxon", "omy", " ", "package", "s", ":\"_", ")_", ",_", "message", "Code_", "=_", "\"", "info", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "package", "Info_", "in_", "Packa", "ge", "Manager_", "._", "order", "ed", "Packa", "ges", "Config_", "(_", ")_", "[_", "\"", "package", "s", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Packa", "ge", ":", " ", "{", "0", "};", " ", "version", ":", " ", "{", "1", "};", " ", "status", ":", " ", "{", "2", "};", " ", "date", ":", " ", "{", "3", "};", " ", "description", ":", " ", "{", "4", "}.\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "package", "Info_", "._", "get_", "(_", "\"", "name", "\"_", ")_", ",_", "package", "Info_", "._", "get_", "(_", "\"", "version", "\"_", ")_", ",_", "package", "Info_", "._", "get_", "(_", "\"", "status", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "Info_", "._", "get_", "(_", "\"", "file", "Date", "\"_", ")_", ",_", "package", "Info_", "._", "get_", "(_", "\"", "description", "\"_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "package", "Info_", "._", "get_", "(_", "\"", "URL", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "show", "Environment_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Config", " ", "director", "y", ":", " ", "{", "0", "}\"_", ")_", "._", "format_", "(_", "self_", "._", "config", "Dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Cache", " ", "director", "y", ":", " ", "{", "0", "}\"_", ")_", "._", "format_", "(_", "self_", "._", "user", "App", "Dir_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "env", "Var_", "in_", "(_", "\"", "XD", "G", "\\u", "CONFIG", "\\u", "HOM", "E", "\"_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "env", "Var_", "in_", "os_", "._", "environ_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "XD", "G", "\\u", "CONFIG", "\\u", "HOM", "E", "={", "0", "}\"_", ")_", "._", "format_", "(_", "os_", "._", "environ_", "[_", "env", "Var_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "custom", "Transforms", "_", "=_", "None_", "#", " ", "clear", " ", "out", " ", "prior", " ", "custom", " ", "transforms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "load", "Custom", "Transforms", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "utility", " ", "command", " ", "line", " ", "options", " ", "tha", "t", " ", "don", "'", "t", " ", "depend", " ", "on", " ", "entrypoint", " ", "Files_", "\\u\\u\\uNL\\u\\u\\u_", "has", "Utili", "ty", "Plugin_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Utili", "ty", ".", "Run", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "has", "Utili", "ty", "Plugin_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "source", "Zip", "Stream_", "=_", "source", "Zip", "Stream_", ",_", "response", "Zip", "Stream_", "=_", "response", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "System", "Exit_", ":_", "#", " ", "terminate", " ", "operati", "on", ",", " ", "plug", " ", "in", " ", "has", " ", "terminate", "d", " ", "all", " ", "processing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "#", " ", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "no", " ", "entrypoint", "File", " ", "is", " ", "applica", "ble", ",", " ", "quit", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "proxy_", "or_", "options_", "._", "plugins_", "or_", "has", "Utili", "ty", "Plugin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "(_", "options_", "._", "entrypoint", "File_", "or_", "source", "Zip", "Stream_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "#", " ", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "username_", "=_", "options_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "password_", "=_", "options_", "._", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "discl", "osu", "re", "System", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Disc", "los", "ure", "System_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "select_", "(_", "options_", "._", "discl", "osu", "re", "System", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "validat", "e", "EF", "M_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "bot", "h", " ", "--", "ef", "m", " ", "and", " ", "--", "discl", "osu", "re", "System", " ", "validation", " ", "are", " ", "request", "ed", ",", " ", "ign", "orin", "g", " ", "--", "ef", "m", " ", "only", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "options_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "validat", "e", "EF", "M_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Disc", "los", "ure", "System_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "select_", "(_", "\"", "ef", "m", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "validat", "e", "HM", "RC_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Disc", "los", "ure", "System_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "select_", "(_", "\"", "hm", "rc", "\"_", ")_", "\\u\\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_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "select_", "(_", "None_", ")_", "#", " ", "just", " ", "load", " ", "ordina", "ry", " ", "mappings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "validat", "e", "Disc", "los", "ure", "System_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "utr", "Url_", ":_", "#", " ", "override", " ", "discl", "osu", "re", "System", " ", "utr", "Url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "discl", "osu", "re", "System_", "._", "utr", "Url_", "=_", "options_", "._", "utr", "Url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "can", " ", "be", " ", "set", " ", "now", " ", "bec", "aus", "e", " ", "the", " ", "utr", " ", "is", " ", "first", " ", "load", "ed", " ", "at", " ", "validation", " ", "time", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "skip", "DT", "S_", ":_", "#", " ", "skip", " ", "DT", "S", " ", "load", "ing", ",", " ", "discove", "ry", ",", " ", "etc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "skip", "DT", "S_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "skip", "Load", "ing_", ":_", "#", " ", "skip", " ", "load", "ing", " ", "matchi", "ng", " ", "files", " ", "(", "list", " ", "of", " ", "unix", " ", "pattern", "s", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "skip", "Load", "ing_", "=_", "re_", "._", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'|'_", "._", "join_", "(_", "fnmatch_", "._", "translate_", "(_", "f_", ")_", "for_", "f_", "in_", "options_", "._", "skip", "Load", "ing_", "._", "split_", "(_", "'|'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "discl", "osu", "re", " ", "system", " ", "sets", " ", "logg", "ing", " ", "filter", "s", ",", " ", "override", " ", "discl", "osu", "re", " ", "filter", "s", ",", " ", "if", " ", "specified", " ", "by", " ", "command", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "log", "Leve", "l", "Filter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Log", "Leve", "l", "Filter_", "(_", "options_", "._", "log", "Leve", "l", "Filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "log", "Code", "Filter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set", "Log", "Code", "Filter_", "(_", "options_", "._", "log", "Code", "Filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "calc", "Deci", "mal", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "calc", "Precis", "ion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "bot", "h", " ", "--", "calc", "Deci", "mal", "s", " ", "and", " ", "--", "calc", "Precis", "ion", " ", "validation", " ", "are", " ", "request", "ed", ",", " ", "proceed", "ing", " ", "with", " ", "--", "calc", "Deci", "mal", "s", " ", "only", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "options_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "validat", "e", "Infer", "Deci", "mal", "s_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "validat", "e", "Calc", "LB", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "calc", "Precis", "ion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Infer", "Deci", "mal", "s_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "validat", "e", "Calc", "LB", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "utr", "Validate", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Ut", "r_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "infos", "et", "Validate", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "validat", "e", "Info", "set_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "abort", "On", "Maj", "or", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "abort", "On", "Maj", "or", "Error_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "collect", "Profil", "e", "Stats_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "collect", "Profil", "e", "Stats_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "output", "Attrib", "uti", "on_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "model", "Manager_", "._", "output", "Attrib", "uti", "on_", "=_", "options_", "._", "output", "Attrib", "uti", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "interne", "t", "Connectivity", "_", "==_", "\"", "offline", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "web", "Cache_", "._", "work", "Off", "line_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "options_", "._", "interne", "t", "Connectivity", "_", "==_", "\"", "onli", "ne", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "web", "Cache_", "._", "work", "Off", "line_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "interne", "t", "Timeout_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "web", "Cache_", "._", "timeout_", "=_", "(_", "options_", "._", "interne", "t", "Timeout_", "or_", "None_", ")_", "#", " ", "use", " ", "Non", "e", " ", "if", " ", "zero", " ", "specified", " ", "to", " ", "disable", " ", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "interne", "t", "Log", "Down", "loads_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "web", "Cache_", "._", "log", "Down", "loads_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fo_", "=_", "Form", "ula", "Options_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "parameters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameter", "Separator_", "=_", "(_", "options_", "._", "parameter", "Separator_", "or_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fo_", "._", "parameter", "Values_", "=_", "dict_", "(_", "(_", "(_", "qname_", "(_", "key_", ",_", "no", "Pref", "ix", "Is", "No", "Namespace_", "=_", "True_", ")_", ",_", "(_", "None_", ",_", "value_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "param_", "in_", "options_", "._", "parameters_", "._", "split_", "(_", "parameter", "Separator_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "key_", ",_", "sep_", ",_", "value_", "in_", "(_", "param_", "._", "partition_", "(_", "'='_", ")_", ",_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Param", "Exp", "r", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Parameter", "Expression", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Param", "Inp", "ut", "Value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Parameter", "Inp", "ut", "Value_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Call", "Exp", "r", "Source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Call", "Expression", "Source_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Call", "Exp", "r", "Code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Call", "Expression", "Code_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Call", "Exp", "r", "Eval_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Call", "Expression", "Evaluati", "on_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Call", "Exp", "r", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Call", "Expression", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Set", "Exp", "r", "Eval_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Set", "Expression", "Evaluati", "on_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Set", "Exp", "r", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Set", "Expression", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Asse", "r", "Result", "Counts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Assert", "ion", "Result", "Counts_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Sat", "isfi", "ed", "Asse", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Sat", "isfi", "ed", "Assert", "ions_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Uns", "ati", "sfi", "ed", "Assert", "ions_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Uns", "ati", "sfi", "ed", "Asse", "r", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "error", "Uns", "ati", "sfi", "ed", "Assert", "ions_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Form", "ula", "Rules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Form", "ula", "Rules_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "s", "Order_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "bles", "Order_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Expression", "Source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Expression", "Source_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Expression", "Code_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Expression", "Code_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Expression", "Evaluati", "on_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Expression", "Evaluati", "on_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Expression", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Expression", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "time", "Varia", "ble", "Set", "Evaluati", "on_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "time", "Varia", "ble", "Set", "Evaluati", "on_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Filter", "Win", "now", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Filter", "Win", "now", "ing_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Filter", "s", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Filter", "s", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Var", "Filter", "s", "Result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "trace", "Varia", "ble", "Filter", "s", "Result_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "Run", "ID", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fo_", "._", "run", "ID", "s_", "=_", "options_", "._", "formula", "Run", "ID", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "formula", "Options_", "=_", "fo_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "success_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "entrypoint", "File", " ", "may", " ", "be", " ", "absen", "t", " ", "(", "if", " ", "input", " ", "is", " ", "a", " ", "POST", "ED", " ", "zip", " ", "or", " ", "file", " ", "name", " ", "ending", " ", "in", " ", ".", "zip", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "or", " ", "may", " ", "be", " ", "a", " ", "|", " ", "separate", "d", " ", "set", " ", "of", " ", "file", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "entry", "Points_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "entrypoint", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "f_", "=_", "options_", "._", "entrypoint", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "#", " ", "may", " ", "be", " ", "a", " ", "json", " ", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "entry", "Points_", "=_", "json_", "._", "loads_", "(_", "\\u", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "it", " ", "mal", "formed", " ", "json", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\\u", "f_", "._", "startswith_", "(_", "\"[{", "\"_", ")_", "or_", "\\u", "f_", "._", "endswith_", "(_", "\"]}", "\"_", ")_", "or_", "'\"", "file", ":\"", "'_", "in_", "\\u", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "File", " ", "name", " ", "parameter", " ", "appear", "s", " ", "to", " ", "be", " ", "mal", "formed", " ", "JSO", "N", ":", " ", "{", "0", "}\"_", ")_", "._", "format_", "(_", "\\u", "f_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "File", "Name", "Format", "Error", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "logging_", "._", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "try", " ", "as", " ", "file", " ", "names", " ", "separate", "d", " ", "by", " ", "'|", "'", " ", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "f_", "in_", "(_", "\\u", "f_", "or_", "''_", ")_", "._", "split_", "(_", "'|'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "source", "Zip", "Stream_", "and_", "not_", "is", "Http", "Url_", "(_", "f_", ")_", "and_", "not_", "os_", "._", "path_", "._", "isabs_", "(_", "f_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "f_", "=_", "os_", "._", "path_", "._", "normpath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "getcwd_", "(_", ")_", ",_", "f_", ")_", ")_", "#", " ", "make", " ", "abs", "olute", " ", "norm", "ed", " ", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "entry", "Points_", "._", "append_", "(_", "{_", "\"", "file", "\"_", ":_", "f_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "files", "ource_", "=_", "None_", "#", " ", "file", " ", "source", " ", "for", " ", "all", " ", "instance", "s", " ", "if", " ", "not", " ", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "source", "Zip", "Stream_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files", "ource_", "=_", "File", "Source_", "._", "open", "File", "Source_", "(_", "None_", ",_", "self_", ",_", "source", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "\\u", "entry", "Points_", ")_", "==_", "1_", ":_", "#", " ", "check", " ", "if", " ", "a", " ", "zip", " ", "and", " ", "need", " ", "to", " ", "discove", "r", " ", "entry", " ", "points_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files", "ource_", "=_", "File", "Source_", "._", "open", "File", "Source_", "(_", "\\u", "entry", "Points_", "[_", "0_", "]_", "._", "get_", "(_", "\"", "file", "\"_", ",_", "None_", ")_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "entrypoint", "Files_", "=_", "\\u", "entry", "Points_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "files", "ource_", "and_", "not_", "files", "ource_", "._", "selection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "files", "ource_", "._", "is", "Archive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "entrypoint", "Files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "archive", "File_", "in_", "(_", "files", "ource_", "._", "dir_", "or_", "(_", ")_", ")_", ":_", "#", " ", ".", "dir", " ", "mig", "ht", " ", "be", " ", "none", " ", "if", " ", "IO", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "files", "ource_", "._", "select_", "(_", "\\u", "archive", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "Model", "Document_", "._", "Type_", "._", "identify", "_", "(_", "files", "ource_", ",_", "files", "ource_", "._", "url_", ")_", "in_", "(_", "Model", "Document_", "._", "Type_", "._", "INSTANCE", "_", ",_", "Model", "Document_", "._", "Type_", "._", "IN", "LINE", "XB", "RL", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u", "entrypoint", "Files_", "._", "append_", "(_", "{_", "\"", "file", "\"_", ":_", "files", "ource_", "._", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "isdir_", "(_", "files", "ource_", "._", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "entrypoint", "Files_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "\\u", "file_", "in_", "os_", "._", "listdir_", "(_", "files", "ource_", "._", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "files", "ource_", "._", "url_", ",_", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "\\u", "path_", ")_", "and_", "Model", "Document_", "._", "Type_", "._", "identify", "_", "(_", "files", "ource_", ",_", "\\u", "path_", ")_", "in_", "(_", "Model", "Document_", "._", "Type_", "._", "INSTANCE", "_", ",_", "Model", "Document_", "._", "Type_", "._", "IN", "LINE", "XB", "RL", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "\\u", "entrypoint", "Files_", "._", "append_", "(_", "{_", "\"", "file", "\"_", ":_", "\\u", "path_", "}_", ")_", "\\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_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Fil", "ing", ".", "Start", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "files", "ource_", ",_", "\\u", "entrypoint", "Files_", ",_", "source", "Zip", "Stream_", "=_", "source", "Zip", "Stream_", ",_", "response", "Zip", "Stream_", "=_", "response", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "\\u", "entrypoint", "_", "in_", "\\u", "entrypoint", "Files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "entrypoint", "File_", "=_", "\\u", "entrypoint", "_", "._", "get_", "(_", "\"", "file", "\"_", ",_", "None_", ")_", "if_", "isinstance_", "(_", "\\u", "entrypoint", "_", ",_", "dict_", ")_", "else_", "\\u", "entrypoint", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "files", "ource_", "and_", "files", "ource_", "._", "is", "Archive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files", "ource_", "._", "select_", "(_", "\\u", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "files", "ource_", "=_", "File", "Source_", "._", "open", "File", "Source_", "(_", "\\u", "entrypoint", "File_", ",_", "self_", ",_", "source", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "entrypoint", "File_", "=_", "\\u", "entrypoint", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "Now_", "=_", "Xm", "l", "Util_", "._", "date", "uni", "on", "Value_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "Start", "ed", "At_", "=_", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Diff", "Report_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "files", "ource_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "model", "Xbrl", "_", "=_", "self_", "._", "model", "Manager_", "._", "load_", "(_", "files", "ource_", ",_", "\\u_", "(_", "\"", "views", " ", "load", "ing", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Model", "Document_", "._", "Load", "ing", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"", "Entr", "y", " ", "point", " ", "load", "ing", " ", "Fail", "ed", " ", "to", " ", "complete", " ", "request", ":", " ", "\\\\", "n", "{", "0", "}", " ", "\\\\", "n", "{", "1", "}\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "err_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "tb_", "(_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "2_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "Except", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "logging_", "._", "ERROR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "#", " ", "load", "ing", " ", "error", "s", ",", " ", "don", "'", "t", " ", "atte", "mpt", " ", "to", " ", "utiliz", "e", " ", "load", "ed", " ", "DT", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model", "Xbrl", "_", "and_", "model", "Xbrl", "_", "._", "model", "Document_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "Time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "load", "\"_", ")_", ",_", "load", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "load", "ed", " ", "in", " ", "%", ".2", "f", " ", "secs", " ", "at", " ", "%", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "load", "Time_", ",_", "time", "Now_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "self_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "import", "Files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "import", "File_", "in_", "options_", "._", "import", "Files_", "._", "split_", "(_", "\"|\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "file", "Name_", "=_", "import", "File_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "source", "Zip", "Stream_", "is_", "not_", "None_", "and_", "not_", "(_", "file", "Name_", "._", "startswith_", "(_", "'", "http", "://'_", ")_", "or_", "os_", "._", "path_", "._", "isabs_", "(_", "file", "Name_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "file", "Name_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "model", "Xbrl", "_", "._", "uri_", ")_", "+_", "os_", "._", "sep_", "+_", "file", "Name_", "#", " ", "make", " ", "relative", " ", "to", " ", "source", "Zip", "Stream_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Model", "Document_", "._", "load_", "(_", "model", "Xbrl", "_", ",_", "file", "Name_", ",_", "is", "Suppl", "ement", "al_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "load", "Time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "import", " ", "in", " ", "%", ".2", "f", " ", "secs", " ", "at", " ", "%", "s", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "load", "Time_", ",_", "time", "Now_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "import", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "import", "\"_", ")_", ",_", "load", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model", "Xbrl", "_", "._", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "success_", "=_", "False_", "#", " ", "load", "ing", " ", "error", "s", ",", " ", "don", "'", "t", " ", "atte", "mpt", " ", "to", " ", "utiliz", "e", " ", "load", "ed", " ", "DT", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model", "Xbrl", "_", "._", "model", "Document_", "._", "type_", "in_", "Model", "Document_", "._", "Type_", "._", "TEST", "CASE", "TYPES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Test", "case", "s", ".", "Start", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "model", "Xbrl", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "not", " ", "a", " ", "test", " ", "case", ",", " ", "probab", "ly", " ", "instance", " ", "or", " ", "DT", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Xbrl", ".", "Load", "ed", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "model", "Xbrl", "_", ",_", "\\u", "entrypoint", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "success_", "and_", "options_", "._", "diff", "File_", "and_", "options_", "._", "vers", "Report", "File_", ":_", "\\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 ", " ", "_", "diff", "Files", "ource_", "=_", "File", "Source_", "._", "File", "Source_", "(_", "options_", "._", "diff", "File_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "2_", "=_", "self_", "._", "model", "Manager_", "._", "load_", "(_", "diff", "Files", "ource_", ",_", "\\u_", "(_", "\"", "views", " ", "load", "ing", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "model", "Xbrl", "2_", "._", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "options_", "._", "keep", "Open_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "model", "Xbrl", "2_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "load", "Time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "load", "\"_", ")_", ",_", "load", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "diff", " ", "compa", "ris", "on", " ", "DT", "S", " ", "load", "ed", " ", "in", " ", "%", ".2", "f", " ", "secs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "Time_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "self_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Diff", "Report_", "=_", "self_", "._", "model", "Manager_", "._", "compare", "DT", "Se", "s_", "(_", "options_", "._", "vers", "Report", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diff", "Time_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "diff", "\"_", ")_", ",_", "diff", "Time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "compare", "d", " ", "in", " ", "%", ".2", "f", " ", "secs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diff", "Time_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "self_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Model", "Document_", "._", "Load", "ing", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"[", "Except", "ion", "]", " ", "Fail", "ed", " ", "to", " ", "do", "ad", " ", "diff", " ", "file", ":", " ", "\\\\", "n", "{", "0", "}", " ", "\\\\", "n", "{", "1", "}\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "err_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "tb_", "(_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "2_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "success_", ":_", "\\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", "Xbrl", "_", "=_", "self_", "._", "model", "Manager_", "._", "model", "Xbrl", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "Form", "ula", "e_", "=_", "model", "Xbrl", "_", "._", "has", "Form", "ula", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "Al", "read", "y", "Validate", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Model", "Document", ".", "Is", "Validate", "d", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "plugin", "Xbrl", "Method_", "(_", "model", "Xbrl", "_", ")_", ":_", "#", " ", "e", ".", "g", ".,", " ", "stream", "ing", " ", "extensi", "ons", " ", "alr", "ead", "y", " ", "has", " ", "validated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "is", "Al", "read", "y", "Validate", "d_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "validate_", "and_", "not_", "is", "Al", "read", "y", "Validate", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "formula", "Action_", ":_", "#", " ", "don", "'", "t", " ", "automati", "call", "y", " ", "run", " ", "formulas", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "model", "Xbrl", "_", "._", "has", "Form", "ula", "e_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "model", "Manager_", "._", "validate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "formula", "Action_", ":_", "#", " ", "restore", " ", "setting_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "model", "Xbrl", "_", "._", "has", "Form", "ula", "e_", "=_", "has", "Form", "ula", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "validat", "ed", " ", "in", " ", "%", ".2", "f", " ", "secs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "self_", "._", "entrypoint", "File_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "options_", "._", "formula", "Action_", "in_", "(_", "\"", "validat", "e", "\"_", ",_", "\"", "run", "\"_", ")_", "and_", "#", " ", "do", " ", "not", "hing", " ", "here", " ", "if", " ", "\"", "none", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "is", "Al", "read", "y", "Validate", "d_", ")_", ":_", "#", " ", "formulas", " ", "can", "'", "t", " ", "run", " ", "if", " ", "stream", "ing", " ", "has", " ", "validat", "ed", " ", "the", " ", "instance", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "from_", "are", "lle", "_", "import_", "Validate", "Xbrl", "Dimensions_", ",_", "Validate", "Formula_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "ed", "At_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "options_", "._", "validate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "Validate", "Xbrl", "Dimensions_", "._", "load", "Dimen", "sion", "Defaults_", "(_", "model", "Xbrl", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "fresh", " ", "parameter", "s", " ", "from", " ", "formula", " ", "opt", "oin", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "model", "Xbrl", "_", "._", "parameters_", "=_", "fo_", "._", "typed", "Parameters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Validate", "Formula_", "._", "validate_", "(_", "model", "Xbrl", "_", ",_", "compile", "Only_", "=_", "(_", "options_", "._", "formula", "Action_", "!=_", "\"", "run", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "To", "Log_", "(_", "format\\u", "string_", "(_", "self_", "._", "model", "Manager_", "._", "locale_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "\"", "formula", " ", "validation", " ", "and", " ", "executi", "on", " ", "in", " ", "%", ".2", "f", " ", "secs", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "formula", "Action_", "==_", "\"", "run", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\\u_", "(_", "\"", "formula", " ", "validation", " ", "only", " ", "in", " ", "%", ".2", "f", " ", "secs", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "time_", "(_", ")_", "-_", "start", "ed", "At_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "info", "\"_", ",_", "file_", "=_", "self_", "._", "entrypoint", "File_", ")_", "\\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_", "options_", "._", "test", "Report_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Tests_", "._", "view", "Tests_", "(_", "self_", "._", "model", "Manager_", "._", "model", "Xbrl", "_", ",_", "options_", "._", "test", "Report_", ",_", "options_", "._", "test", "Report", "Cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "rs", "s", "Report_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Rs", "s", "Feed_", "._", "view", "Rs", "s", "Feed_", "(_", "self_", "._", "model", "Manager_", "._", "model", "Xbrl", "_", ",_", "options_", "._", "rs", "s", "Report_", ",_", "options_", "._", "rs", "s", "Report", "Cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "DT", "SF", "ile_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "DT", "S_", "._", "view", "DT", "S_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "DT", "SF", "ile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "fact", "s", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Fact", "List_", "._", "view", "Fact", "s_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "fact", "s", "File_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ",_", "cols_", "=_", "options_", "._", "fact", "List", "Cols_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "fact", "Table", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Fact", "Table_", "._", "view", "Fact", "s_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "fact", "Table", "File_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "concepts", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Concept", "s_", "._", "view", "Concept", "s_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "concepts", "File_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "pre", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Relationship", "Set_", "._", "view", "Relationship", "Set_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "pre", "File_", ",_", "\"", "Present", "ation", " ", "Link", "base", "\"_", ",_", "\"", "http", "://", "www", ".", "xbr", "l", ".", "org", "/", "2003", "/", "arc", "role", "/", "parent", "-", "child", "\"_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "cal", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Relationship", "Set_", "._", "view", "Relationship", "Set_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "cal", "File_", ",_", "\"", "Calculat", "ion", " ", "Link", "base", "\"_", ",_", "\"", "http", "://", "www", ".", "xbr", "l", ".", "org", "/", "2003", "/", "arc", "role", "/", "summa", "tion", "-", "item", "\"_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "dim", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Relationship", "Set_", "._", "view", "Relationship", "Set_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "dim", "File_", ",_", "\"", "Dimen", "sion", "s", "\"_", ",_", "\"", "XB", "RL", "-", "dimension", "s", "\"_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "formula", "e", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Form", "ula", "e_", "._", "view", "Form", "ula", "e_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "formula", "e", "File_", ",_", "\"", "Form", "ula", "e", "\"_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "view", "Arc", "role_", "and_", "options_", "._", "view", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Relationship", "Set_", "._", "view", "Relationship", "Set_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "view", "File_", ",_", "os_", "._", "path_", "._", "basename_", "(_", "options_", "._", "view", "Arc", "role_", ")_", ",_", "options_", "._", "view", "Arc", "role_", ",_", "label", "role_", "=_", "options_", "._", "label", "Role_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "role", "Type", "s", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Ro", "le", "Types_", "._", "view", "Ro", "le", "Types_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "role", "Type", "s", "File_", ",_", "\"", "Ro", "le", " ", "Type", "s", "\"_", ",_", "is", "Arc", "role_", "=_", "False_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "arc", "role", "Type", "s", "File_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "View", "File", "Ro", "le", "Types_", "._", "view", "Ro", "le", "Types_", "(_", "model", "Xbrl", "_", ",_", "options_", "._", "arc", "role", "Type", "s", "File_", ",_", "\"", "Arc", "role", " ", "Type", "s", "\"_", ",_", "is", "Arc", "role_", "=_", "True_", ",_", "lang_", "=_", "options_", "._", "label", "Lang_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Xbrl", ".", "Run", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "model", "Xbrl", "_", ",_", "\\u", "entrypoint", "_", ")_", "\\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_", "(_", "IO", "Error_", ",_", "Environ", "ment", "Error_", ")_", "as_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"[", "IO", "Error", "]", " ", "Fail", "ed", " ", "to", " ", "save", " ", "output", ":\\\\", "n", " ", "{", "0", "}\"_", ")_", "._", "format_", "(_", "err_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "\"", "IO", "Error", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "options_", "._", "entrypoint", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "logging_", "._", "CRITICAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "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_", "._", "add", "To", "Log_", "(_", "\\u_", "(_", "\"[", "Except", "ion", "]", " ", "Fail", "ed", " ", "to", " ", "complete", " ", "request", ":", " ", "\\\\", "n", "{", "0", "}", " ", "\\\\", "n", "{", "1", "}\"_", ")_", "._", "format_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "err_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "traceback_", "._", "format\\u", "tb_", "(_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "2_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "message", "Code_", "=_", "err_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "file_", "=_", "options_", "._", "entrypoint", "File_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "level_", "=_", "logging_", "._", "CRITICAL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "success_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model", "Xbrl", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "model", "Xbrl", "_", "._", "profile", "Stat_", "(_", "\\u_", "(_", "\"", "total", "\"_", ")_", ",_", "time_", "._", "time_", "(_", ")_", "-_", "first", "Start", "ed", "At_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "collect", "Profil", "e", "Stats_", "and_", "model", "Xbrl", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "model", "Xbrl", "_", "._", "log", "Profil", "e", "Stats_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "options_", "._", "keep", "Open_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "model", "Diff", "Report_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "model", "Manager_", "._", "close_", "(_", "model", "Diff", "Report_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "model", "Xbrl", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "model", "Manager_", "._", "close_", "(_", "model", "Xbrl", "_", ")_", "\\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_", "if_", "options_", "._", "validate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Fil", "ing", ".", "Validate", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "files", "ource_", ",_", "\\u", "entrypoint", "Files_", ",_", "source", "Zip", "Stream_", "=_", "source", "Zip", "Stream_", ",_", "response", "Zip", "Stream_", "=_", "response", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "plugin", "Xbrl", "Method_", "in_", "plugin", "Class", "Methods_", "(_", "\"", "Cnt", "lr", "Cmd", "Line", ".", "Fil", "ing", ".", "End", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plugin", "Xbrl", "Method_", "(_", "self_", ",_", "options_", ",_", "files", "ource_", ",_", "\\u", "entrypoint", "Files_", ",_", "source", "Zip", "Stream_", "=_", "source", "Zip", "Stream_", ",_", "response", "Zip", "Stream_", "=_", "response", "Zip", "Stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "username_", "=_", "self_", "._", "password_", "=_", "None_", "#", "dereferenc", "e", " ", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "status", "Pipe_", "and_", "getattr_", "(_", "self_", ",_", "\"", "status", "Pipe", "\"_", ",_", "None_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "win32", "file_", "._", "Write", "File_", "(_", "self_", "._", "status", "Pipe_", ",_", "b", "\"", " ", "\"_", ")_", "#", " ", "clear", " ", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "._", "Flu", "sh", "File", "Buffers", "_", "(_", "self_", "._", "status", "Pipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "._", "Set", "File", "Pointer_", "(_", "self_", "._", "status", "Pipe_", ",_", "0_", ",_", "win32", "file_", "._", "FILE", "\\u", "BEGIN", "_", ")_", "#", " ", "hang", "s", " ", "on", " ", "close", " ", "with", "out", " ", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "._", "Clos", "e", "Handle_", "(_", "self_", "._", "status", "Pipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status", "Pipe_", "=_", "None_", "#", " ", "dereferenc", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "success_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cnt", "lr", "Cmd", "Line_", "(_", "Cnt", "lr_", "._", "Cnt", "lr_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "interne", "t", "\\u", "user", "\\u", "password_", "(_", "self_", ",_", "host_", ",_", "realm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "self_", "._", "username_", ",_", "self_", "._", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cnt", "lr", "Cmd", "Line_", "(_", "Cnt", "lr_", "._", "Cnt", "lr_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "Status", "On", "Pipe_", "(_", "self_", ",_", "message_", ",_", "clear", "After_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "=", " ", "time", ".", "time", "()", " ", "#", " ", "see", "ms", " ", "ok", " ", "with", "out", " ", "time", "-", "limit", "ing", " ", "writes", " ", "to", " ", "the", " ", "pipe_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "status", "Pipe_", "is_", "not_", "None_", ":_", "#", " ", "max", " ", "status", " ", "update", "s", " ", "3", " ", "per", " ", "second", " ", "now", " ", "-", " ", "0.", "3", " ", ">", " ", "self", ".", "last", "Status", "Time", " ", "and", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "last", "Status", "Time", " ", "=", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "parent", "Process", "Handle_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "win32", "process_", "._", "Get", "Exi", "t", "Code", "Process_", "(_", "self_", "._", "parent", "Process", "Handle_", ")_", "!=_", "STI", "LL", "\\u", "ACTIVE_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win32", "file_", "._", "Write", "File_", "(_", "self_", "._", "status", "Pipe_", ",_", "(_", "message_", "or_", "\"\"_", ")_", "._", "encode_", "(_", "\"", "utf", "8", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "._", "Flu", "sh", "File", "Buffers", "_", "(_", "self_", "._", "status", "Pipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "win32", "file_", "._", "Set", "File", "Pointer_", "(_", "self_", "._", "status", "Pipe_", ",_", "0_", ",_", "win32", "file_", "._", "FILE", "\\u", "BEGIN", "_", ")_", "#", " ", "hang", "s", " ", "on", " ", "close", " ", "with", "out", " ", "this_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "with", " ", "open", "(\"", "Z", ":\\\\", "\\\\", "temp", "\\\\\\\\", "trace", ".", "log", "\",", " ", "\"", "at", "\",", " ", "encoding", "=\"", "utf", "-", "8", "\")", " ", "as", " ", "fh", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "fh", ".", "write", "(\"", "Status", " ", "pipe", " ", "exception", " ", "{}", " ", "{}", "\\\\", "n", "\".", "format", "(", "type", "(", "ex", "),", " ", "ex", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "system_", "._", "exit_", "(_", ")_", "\\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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,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/api/api2.py
[ { "content": " @web.removeslash\n def get(self, entity_id=None):\n if not entity_id:\n return self.json({\n 'error': 'No entity ID!',\n 'time': round(self.request.request_time(), 3),\n }, 400)\n\n entity = self.get_entities(entity_id=entity_id, limit=1)\n if not entity:\n return self.json({\n 'error': 'Entity with given ID is not found!',\n 'time': round(self.request.request_time(), 3),\n }, 404)\n entity['definition'] = {'keyname': entity['definition_keyname']}\n\n xml = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <CMD xmlns=\"http://www.clarin.eu/cmd/\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n CMDVersion=\"1.1\"\n xsi:schemaLocation=\"%(XSD)s\">\n <Header></Header>\n <Resources>\n <ResourceProxyList></ResourceProxyList>\n <JournalFileProxyList></JournalFileProxyList>\n <ResourceRelationList></ResourceRelationList>\n </Resources>\n <Components>\n <%(Component)s>\n <GeneralInfo>\n <ResourceName xml:lang=\"en\">%(ResourceName)s</ResourceName>\n <Version xml:lang=\"en\">%(Version)s</Version>\n <LastUpdate>%(LastUpdate)s</LastUpdate>\n <LegalOwner xml:lang=\"en\">%(LegalOwner)s</LegalOwner>\n </GeneralInfo>\n </%(Component)s>\n </Components>\n </CMD>\"\"\" % {\n 'XSD' : entity['properties']['XSD'].get('values',[{'value':''}])[0]['value'],\n 'Component' : entity['properties']['Component'].get('values',[{'value':''}])[0]['value'],\n 'ResourceName' : entity['properties']['ResourceName'].get('values',[{'value':''}])[0]['value'],\n 'Version' : entity['properties']['Version'].get('values',[{'value':''}])[0]['value'],\n 'LastUpdate' : entity['properties']['LastUpdate'].get('values',[{'value':''}])[0]['value'],\n 'LegalOwner' : entity['properties']['LegalOwner'].get('values',[{'value':''}])[0]['value'],\n }\n\n mimetypes.init()\n mime = mimetypes.types_map.get('.xml', 'application/octet-stream')\n filename = 'entu-cmd-%s.xml' % entity_id\n self.add_header('Content-Type', mime)\n # self.add_header('Content-Disposition', 'attachment; filename=\"%s\"' % filename)\n self.write(xml)", "metadata": "root.API2CmdiXml.get", "header": "['class', 'API2CmdiXml', '(', 'myRequestHandler', ',', 'Entity', ')', ':', '___EOS___']", "index": 117 }, { "content": " @web.removeslash\n def post(self, entity_id=None):\n #\n # Create new child entity (under entity with given ID)\n #\n if not self.current_user:\n return self.json({\n 'error': 'Forbidden!',\n 'time': round(self.request.request_time(), 3),\n }, 403)\n\n if not entity_id:\n return self.json({\n 'error': 'No entity ID!',\n 'time': round(self.request.request_time(), 3),\n }, 400)\n\n entity = self.get_entities(entity_id=entity_id, limit=1)\n if not entity:\n return self.json({\n 'error': 'Entity with given ID is not found!',\n 'time': round(self.request.request_time(), 3),\n }, 404)\n\n definition = self.get_argument('definition', default=None, strip=True)\n if not definition:\n return self.json({\n 'error': 'No definition!',\n 'time': round(self.request.request_time(), 3),\n }, 400)\n\n entity_id = self.create_entity(entity_definition_keyname=definition, parent_entity_id=entity_id)\n\n for dataproperty, value in self.request.arguments.iteritems():\n if dataproperty in ['user', 'policy', 'signature', 'definition']:\n continue\n if type(value) is not list:\n value = [value]\n for v in value:\n new_property_id = self.set_property(entity_id=entity_id, property_definition_keyname=dataproperty, value=v)\n\n self.json({\n 'result': {\n 'id': entity_id,\n },\n 'time': round(self.request.request_time(), 3),\n }, 201)", "metadata": "root.API2Entity.post", "header": "['class', 'API2Entity', '(', 'myRequestHandler', ',', 'Entity', ')', ':', '___EOS___']", "index": 259 } ]
[ { "span": "filename ", "start_line": 165, "start_column": 8, "end_line": 165, "end_column": 16 }, { "span": "new_property_id ", "start_line": 298, "start_column": 16, "end_line": 298, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "API", "2", "Cmd", "i", "Xml_", "(_", "my", "Request", "Handler_", ",_", "Entity_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "web_", "._", "remove", "slash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "entity", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "No", " ", "entity", " ", "ID", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "entity_", "=_", "self_", "._", "get", "\\u", "entities_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "Entit", "y", " ", "with", " ", "give", "n", " ", "ID", " ", "is", " ", "not", " ", "found", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "entity_", "[_", "'", "definit", "ion", "'_", "]_", "=_", "{_", "'", "keyn", "ame", "'_", ":_", "entity_", "[_", "'", "definit", "ion", "\\u", "keyn", "ame", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "xml_", "=_", "\"\"\"", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "encoding", "=\"", "UT", "F", "-", "8", "\"?", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "CMD", " ", "xml", "ns", "=\"", "http", "://", "www", ".", "clari", "n", ".", "eu", "/", "cmd", "/\"", "\\", "10", ";", " ", " ", " ", " ", " ", "xml", "ns", ":", "xsi", "=\"", "http", "://", "www", ".", "w3", ".", "org", "/", "200", "1", "/", "XML", "Schema", "-", "instance", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", "CMD", "Version", "=\"", "1.1", "\"", "\\", "10", ";", " ", " ", " ", " ", " ", "xsi", ":", "schema", "Locat", "ion", "=\"", "%", "(", "XSD", ")", "s", "\">", "\\", "10", ";", " ", " ", " ", " ", "<", "Head", "er", "><", "/", "Head", "er", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Reso", "urc", "es", ">", "\\", "10", ";", " ", " ", "<", "Reso", "urc", "e", "Pro", "xy", "List", "><", "/", "Reso", "urc", "e", "Pro", "xy", "List", ">", "\\", "10", ";", " ", " ", "<", "Journ", "al", "File", "Pro", "xy", "List", "><", "/", "Journ", "al", "File", "Pro", "xy", "List", ">", "\\", "10", ";", " ", " ", "<", "Reso", "urc", "e", "Relation", "List", "><", "/", "Reso", "urc", "e", "Relation", "List", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Reso", "urc", "es", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "Compo", "nent", "s", ">", "\\", "10", ";", " ", " ", "<", "%", "(", "Compo", "nent", ")", "s", ">", "\\", "10", ";", " ", " ", "<", "General", "Info", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Reso", "urc", "e", "Name", " ", "xml", ":", "lang", "=\"", "en", "\">", "%", "(", "Reso", "urc", "e", "Name", ")", "s", "</", "Reso", "urc", "e", "Name", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Version", " ", "xml", ":", "lang", "=\"", "en", "\">", "%", "(", "Version", ")", "s", "</", "Version", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Las", "t", "Update", ">", "%", "(", "Las", "t", "Update", ")", "s", "</", "Las", "t", "Update", ">", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "<", "Legal", "Owne", "r", " ", "xml", ":", "lang", "=\"", "en", "\">", "%", "(", "Legal", "Owne", "r", ")", "s", "</", "Legal", "Owne", "r", ">", "\\", "10", ";", " ", " ", "</", "General", "Info", ">", "\\", "10", ";", " ", " ", "</", "%", "(", "Compo", "nent", ")", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "Compo", "nent", "s", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "CMD", ">\"\"\"_", "%_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "XSD", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "XSD", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Compo", "nent", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "Compo", "nent", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Reso", "urc", "e", "Name", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "Reso", "urc", "e", "Name", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Version", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "Version", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Las", "t", "Update", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "Las", "t", "Update", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Legal", "Owne", "r", "'_", ":_", "entity_", "[_", "'", "proper", "ties", "'_", "]_", "[_", "'", "Legal", "Owne", "r", "'_", "]_", "._", "get_", "(_", "'", "values", "'_", ",_", "[_", "{_", "'", "value", "'_", ":_", "''_", "}_", "]_", ")_", "[_", "0_", "]_", "[_", "'", "value", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mimetypes_", "._", "init_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mime_", "=_", "mimetypes_", "._", "types", "\\u", "map_", "._", "get_", "(_", "'.", "xml", "'_", ",_", "'", "applica", "tion", "/", "oct", "et", "-", "stream", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "'", "ent", "u", "-", "cmd", "-%", "s", ".", "xml", "'_", "%_", "entity", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "header_", "(_", "'", "Conten", "t", "-", "Type", "'_", ",_", "mime_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "add", "\\u", "header", "('", "Conten", "t", "-", "Dispo", "sition", "',", " ", "'", "attach", "ment", ";", " ", "filename", "=\"", "%", "s", "\"'", " ", "%", " ", "filename", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "write_", "(_", "xml_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "API", "2E", "nti", "ty_", "(_", "my", "Request", "Handler_", ",_", "Entity_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "web_", "._", "remove", "slash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "post_", "(_", "self_", ",_", "entity", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "new", " ", "child", " ", "entity", " ", "(", "under", " ", "entity", " ", "with", " ", "give", "n", " ", "ID", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "current", "\\u", "user_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "For", "bid", "den", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "403_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "entity", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "No", " ", "entity", " ", "ID", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "entity_", "=_", "self_", "._", "get", "\\u", "entities_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "limit_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "entity_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "Entit", "y", " ", "with", " ", "give", "n", " ", "ID", " ", "is", " ", "not", " ", "found", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "404_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "definition_", "=_", "self_", "._", "get", "\\u", "argument_", "(_", "'", "definit", "ion", "'_", ",_", "default_", "=_", "None_", ",_", "strip_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "definition_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "error", "'_", ":_", "'", "No", " ", "definit", "ion", "!'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "400_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "entity", "\\u", "id_", "=_", "self_", "._", "create", "\\u", "entity_", "(_", "entity", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "definition_", ",_", "parent", "\\u", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "datapro", "pert", "y_", ",_", "value_", "in_", "self_", "._", "request_", "._", "arguments_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "datapro", "pert", "y_", "in_", "[_", "'", "user", "'_", ",_", "'", "policy", "'_", ",_", "'", "signa", "ture", "'_", ",_", "'", "definit", "ion", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "value_", ")_", "is_", "not_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "[_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "v_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "property", "\\u", "id_", "=_", "self_", "._", "set\\u", "property_", "(_", "entity", "\\u", "id_", "=_", "entity", "\\u", "id_", ",_", "property", "\\u", "definit", "ion", "\\u", "keyname_", "=_", "datapro", "pert", "y_", ",_", "value_", "=_", "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_", "self_", "._", "json_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "result", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "entity", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "round_", "(_", "self_", "._", "request_", "._", "request", "\\u", "time_", "(_", ")_", ",_", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "201_", ")_", "\\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, 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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 ]
Except block handles 'BaseException'
karesansui/pysilhouette/pysilhouette/prep.py
[ { "content": "def parse_conf(cf):\n from pysilhouette.util import is_int, is_key, set_cf_int\n from pysilhouette.uniqkey import is_uuid\n\n # env\n err_key = \"\"\n if len(err_key) <= 0 and is_key(cf, \"env.python\") is False:\n err_key = \"env.python\"\n if len(err_key) <= 0 and is_key(cf, \"env.sys.log.conf.path\") is False:\n err_key = \"env.sys.log.conf.path\"\n if len(err_key) <= 0 and is_key(cf, \"env.uniqkey\") is False:\n err_key = \"env.uniqkey\"\n if len(err_key) <= 0 and is_key(cf, \"daemon.stdin\") is False:\n err_key = \"daemon.stdin\"\n if len(err_key) <= 0 and is_key(cf, \"daemon.stdout\") is False:\n err_key = \"daemon.stdout\"\n if len(err_key) <= 0 and is_key(cf, \"daemon.stderr\") is False:\n err_key = \"daemon.stderr\"\n if len(err_key) <= 0 and is_key(cf, \"observer.target.python\") is False:\n err_key = \"observer.target.python\"\n if len(err_key) <= 0 and is_key(cf, \"observer.target.scheduler\") is False:\n err_key = \"observer.target.scheduler\"\n if len(err_key) <= 0 and is_key(cf, \"observer.target.performer\") is False:\n err_key = \"observer.target.performer\"\n if len(err_key) <= 0 and is_key(cf, \"observer.restart.count\") is False:\n err_key = \"observer.restart.count\"\n if len(err_key) <= 0 and is_key(cf, \"observer.restart.count.clear.time\") is False:\n err_key = \"observer.restart.count.clear.time\"\n if len(err_key) <= 0 and is_key(cf, \"observer.check.interval\") is False:\n err_key = \"observer.check.interval\"\n if len(err_key) <= 0 and is_key(cf, \"observer.status.path\") is False:\n err_key = \"observer.status.path\"\n\n # performer\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.start.code\") is False:\n err_key = \"performer.mkfifo.start.code\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.ignore.code\") is False:\n err_key = \"performer.mkfifo.ignore.code\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.stop.code\") is False:\n err_key = \"performer.mkfifo.stop.code\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.user.name\") is False:\n err_key = \"performer.mkfifo.user.name\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.group.name\") is False:\n err_key = \"performer.mkfifo.group.name\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.perms\") is False:\n err_key = \"performer.mkfifo.perms\"\n if len(err_key) <= 0 and is_key(cf, \"performer.mkfifo.path\") is False:\n err_key = \"performer.mkfifo.path\"\n\n # asynperformer\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.start.code\") is False:\n err_key = \"asynperformer.mkfifo.start.code\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.ignore.code\") is False:\n err_key = \"asynperformer.mkfifo.ignore.code\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.stop.code\") is False:\n err_key = \"asynperformer.mkfifo.stop.code\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.user.name\") is False:\n err_key = \"asynperformer.mkfifo.user.name\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.group.name\") is False:\n err_key = \"asynperformer.mkfifo.group.name\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.perms\") is False:\n err_key = \"asynperformer.mkfifo.perms\"\n if len(err_key) <= 0 and is_key(cf, \"asynperformer.mkfifo.path\") is False:\n err_key = \"asynperformer.mkfifo.path\"\n\n # asynscheduler\n if len(err_key) <= 0 and is_key(cf, \"asynscheduler.interval\") is False:\n err_key = \"asynscheduler.interval\"\n\n if len(err_key) <= 0 and is_key(cf, \"scheduler.interval\") is False:\n err_key = \"scheduler.interval\"\n if len(err_key) <= 0 and is_key(cf, \"job.popen.env.lang\") is False:\n err_key = \"job.popen.env.lang\"\n if len(err_key) <= 0 and is_key(cf, \"job.popen.timeout\") is False:\n err_key = \"job.popen.timeout\"\n if len(err_key) <= 0 and is_key(cf, \"job.popen.waittime\") is False:\n err_key = \"job.popen.waittime\"\n if len(err_key) <= 0 and is_key(cf, \"job.popen.output.limit\") is False:\n err_key = \"job.popen.output.limit\"\n\n if len(err_key) <= 0 and is_key(cf, \"database.url\") is False:\n err_key = \"database.url\"\n if len(err_key) <= 0 and is_key(cf, \"database.pool.status\") is False:\n err_key = \"database.pool.status\"\n\n if is_uuid(cf[\"env.uniqkey\"]) is False:\n print >>sys.stderr, 'UUID format is not set. - env.uniqkey'\n return False\n\n if 0 < len(err_key):\n print >>sys.stderr, 'Configuration files are missing. - %s' % (err_key)\n return False\n\n if os.access(cf[\"env.python\"], os.R_OK | os.X_OK) is False:\n print >>sys.stderr, 'Incorrect file permissions. - env.python=%s' % (cf[\"env.python\"])\n return False\n\n if os.access(cf[\"observer.target.python\"], os.R_OK | os.X_OK) is False:\n print >>sys.stderr, 'Incorrect file permissions. - observer.target.python=%s' % (cf[\"observer.target.python\"])\n return False\n\n if os.access(cf[\"observer.target.scheduler\"], os.R_OK) is False:\n print >>sys.stderr, 'Incorrect file permissions. - observer.target.scheduler=%s' % (cf[\"observer.target.scheduler\"])\n return False\n\n if os.access(cf[\"observer.target.performer\"], os.R_OK) is False:\n print >>sys.stderr, 'Incorrect file permissions. - observer.target.performer=%s' % (cf[\"observer.target.performer\"])\n return False\n\n if is_int(cf[\"observer.restart.count\"]) is False:\n print >>sys.stderr, 'Must be a number. - observer.restart.count=%s' % (cf[\"observer.restart.count\"])\n return False\n else:\n set_cf_int(cf, \"observer.restart.count\")\n\n if is_int(cf[\"observer.restart.count.clear.time\"]) is False:\n print >>sys.stderr, 'Must be a number. - observer.restart.count.clear.time=%s' % (cf[\"observer.restart.count.clear.time\"])\n return False\n else:\n set_cf_int(cf, \"observer.restart.count.clear.time\")\n\n if is_int(cf[\"observer.check.interval\"]) is False:\n print >>sys.stderr, 'Must be a number. - observer.check.interval=%s' % (cf[\"observer.check.interval\"])\n return False\n else:\n set_cf_int(cf, \"observer.check.interval\")\n\n # performer\n if is_int(cf[\"performer.mkfifo.start.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - performer.mkfifo.start.code=%s' % (cf[\"performer.mkfifo.start.code\"])\n return False\n\n if is_int(cf[\"performer.mkfifo.ignore.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - performer.mkfifo.ignore.code=%s' % (cf[\"performer.mkfifo.ignore.code\"])\n return False\n\n if is_int(cf[\"performer.mkfifo.stop.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - performer.mkfifo.stop.code=%s' % (cf[\"performer.mkfifo.stop.code\"])\n return False\n\n # asynperformer\n if is_int(cf[\"asynperformer.mkfifo.start.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - asynperformer.mkfifo.start.code=%s' % (cf[\"asynperformer.mkfifo.start.code\"])\n return False\n\n if is_int(cf[\"asynperformer.mkfifo.ignore.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - asynperformer.mkfifo.ignore.code=%s' % (cf[\"asynperformer.mkfifo.ignore.code\"])\n return False\n\n if is_int(cf[\"asynperformer.mkfifo.stop.code\"]) is False:\n print >>sys.stderr, 'Must be a number. - asynperformer.mkfifo.stop.code=%s' % (cf[\"asynperformer.mkfifo.stop.code\"])\n return False\n\n if is_int(cf[\"asynscheduler.interval\"]) is False:\n print >>sys.stderr, 'Must be a number. - asynscheduler.interval=%s' % (cf[\"asynscheduler.interval\"])\n return False\n else:\n set_cf_int(cf, \"asynscheduler.interval\")\n\n if is_int(cf[\"scheduler.interval\"]) is False:\n print >>sys.stderr, 'Must be a number. - scheduler.interval=%s' % (cf[\"scheduler.interval\"])\n return False\n else:\n set_cf_int(cf, \"scheduler.interval\")\n\n if is_int(cf[\"job.popen.timeout\"]) is False:\n print >>sys.stderr, 'Must be a number. - job.popen.timeout=%s' % (cf[\"job.popen.timeout\"])\n return False\n else:\n set_cf_int(cf, \"job.popen.timeout\")\n\n if is_int(cf[\"job.popen.waittime\"]) is False:\n print >>sys.stderr, 'Must be a number. - job.popen.waittime=%s' % (cf[\"job.popen.waittime\"])\n return False\n else:\n set_cf_int(cf, \"job.popen.waittime\")\n\n if is_int(cf[\"job.popen.output.limit\"]) is False:\n print >>sys.stderr, 'Must be a number. - job.popen.output.limit=%s' % (cf[\"job.popen.output.limit\"])\n return False\n else:\n set_cf_int(cf, \"job.popen.output.limit\")\n\n # performer\n p_mkfifo = set([cf[\"performer.mkfifo.start.code\"],\n cf[\"performer.mkfifo.ignore.code\"],\n cf[\"performer.mkfifo.stop.code\"]],\n )\n if len(p_mkfifo) != 3:\n print >>sys.stderr, 'Is not unique. - performer.mkfifo.[start,ignore,stop]=%s,%s,%s' \\\n % (cf[\"performer.mkfifo.start.code\"],\n cf[\"performer.mkfifo.ignore.code\"],\n cf[\"performer.mkfifo.stop.code\"],\n )\n return False\n\n try:\n pwd.getpwnam(cf[\"performer.mkfifo.user.name\"])\n except:\n print >>sys.stderr, 'Can not get information of the user (nonexistent?). - performer.mkfifo.user.name=%s' % (cf[\"performer.mkfifo.user.name\"])\n\n try:\n grp.getgrnam(cf[\"performer.mkfifo.group.name\"])\n except:\n print >>sys.stderr, 'Can not get information of the group (nonexistent?). - performer.mkfifo.group.name=%s' % (cf[\"performer.mkfifo.group.name\"])\n\n try:\n int(cf[\"performer.mkfifo.perms\"], 8)\n except:\n print >>sys.stderr, 'Incorrect file permissions. - performer.mkfifo.perms=%s' % (cf[\"performer.mkfifo.perms\"])\n return False\n\n # asynperformer\n a_mkfifo = set([cf[\"asynperformer.mkfifo.start.code\"],\n cf[\"asynperformer.mkfifo.ignore.code\"],\n cf[\"asynperformer.mkfifo.stop.code\"]],\n )\n if len(a_mkfifo) != 3:\n print >>sys.stderr, 'Is not unique. - asynperformer.mkfifo.[start,ignore,stop]=%s,%s,%s' \\\n % (cf[\"asynperformer.mkfifo.start.code\"],\n cf[\"asynperformer.mkfifo.ignore.code\"],\n cf[\"asynperformer.mkfifo.stop.code\"],\n )\n return False\n\n try:\n pwd.getpwnam(cf[\"asynperformer.mkfifo.user.name\"])\n except:\n print >>sys.stderr, 'Can not get information of the user (nonexistent?). - asynperformer.mkfifo.user.name=%s' % (cf[\"asynperformer.mkfifo.user.name\"])\n\n try:\n grp.getgrnam(cf[\"asynperformer.mkfifo.group.name\"])\n except:\n print >>sys.stderr, 'Can not get information of the group (nonexistent?). - asynperformer.mkfifo.group.name=%s' % (cf[\"asynperformer.mkfifo.group.name\"])\n\n try:\n int(cf[\"asynperformer.mkfifo.perms\"], 8)\n except:\n print >>sys.stderr, 'Incorrect file permissions. - asynperformer.mkfifo.perms=%s' % (cf[\"asynperformer.mkfifo.perms\"])\n return False\n\n if cf.has_key(\"job.whitelist.flag\") is True \\\n and cf[\"job.whitelist.flag\"] == \"1\" \\\n and cf.has_key(\"job.whitelist.path\") is True \\\n and 0 < len(cf[\"job.whitelist.path\"]):\n if os.path.isfile(cf[\"job.whitelist.path\"]) is False:\n print >>sys.stderr, 'File not found. - job.whitelist.path=%s' % (cf[\"job.whitelist.path\"])\n return False\n\n # database.pool.status\n if (cf[\"database.pool.status\"] in (\"0\",\"1\")) is False:\n print >>sys.stderr, 'The mistake is found in the set value. Please set 0 or 1. - database.pool.status'\n return False\n\n if cf[\"database.pool.status\"] == \"1\":\n # database.pool.max.overflow\n if cf.has_key(\"database.pool.max.overflow\") is False:\n print >>sys.stderr, 'Configuration information is missing. - database.pool.max.overflow'\n return False\n\n # database.pool.size\n if cf.has_key(\"database.pool.size\") is False:\n print >>sys.stderr, 'Configuration information is missing. - database.pool.size'\n return False\n\n # int\n if is_int(cf[\"database.pool.max.overflow\"]) is False:\n print >>sys.stderr, 'Please set it by the numerical value. - database.pool.max.overflow'\n return False\n else:\n set_cf_int(cf, \"database.pool.max.overflow\")\n\n if is_int(cf[\"database.pool.size\"]) is False:\n print >>sys.stderr, 'Please set it by the numerical value. - database.pool.size'\n return False\n else:\n set_cf_int(cf, \"database.pool.size\")\n\n if int(cf[\"database.pool.size\"]) <= 0:\n print >>sys.stderr, 'Please set values that are larger than 0. - database.pool.size'\n return False\n else:\n set_cf_int(cf, \"database.pool.size\")\n\n # Comparison\n if int(cf[\"database.pool.max.overflow\"]) < int(cf[\"database.pool.size\"]):\n print >>sys.stderr, 'Please set \"database.pool.max.overflow\" to a value that is larger than \"database.pool.size\".'\n return False\n\n # asynperformer.thread.pool.size\n if cf.has_key(\"asynperformer.thread.pool.size\") is False:\n print >>sys.stderr, 'Configuration information is missing. - asynperformer.thread.pool.size'\n return False\n\n if is_int(cf[\"asynperformer.thread.pool.size\"]) is False:\n print >>sys.stderr, 'Please set it by the numerical value. - asynperformer.thread.pool.size'\n return False\n else:\n set_cf_int(cf, \"asynperformer.thread.pool.size\")\n\n if int(cf[\"asynperformer.thread.pool.size\"]) <= 0:\n print >>sys.stderr, 'Please set values that are larger than 0. - asynperformer.thread.pool.size'\n return False\n\n return True", "metadata": "root.parse_conf", "header": "['module', '___EOS___']", "index": 77 } ]
[ { "span": "except:", "start_line": 275, "start_column": 4, "end_line": 275, "end_column": 11 }, { "span": "except:", "start_line": 280, "start_column": 4, "end_line": 280, "end_column": 11 }, { "span": "except:", "start_line": 285, "start_column": 4, "end_line": 285, "end_column": 11 }, { "span": "except:", "start_line": 304, "start_column": 4, "end_line": 304, "end_column": 11 }, { "span": "except:", "start_line": 309, "start_column": 4, "end_line": 309, "end_column": 11 }, { "span": "except:", "start_line": 314, "start_column": 4, "end_line": 314, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "conf_", "(_", "cf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pys", "il", "hou", "ette", "_", "._", "util_", "import_", "is", "\\u", "int_", ",_", "is", "\\u", "key_", ",_", "set\\u", "cf", "\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pys", "il", "hou", "ette", "_", "._", "uniq", "key_", "import_", "is", "\\u", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "env_", "\\u\\u\\uNL\\u\\u\\u_", "err", "\\u", "key_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "env", ".", "python", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "env", ".", "python", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "env", ".", "sys", ".", "log", ".", "conf", ".", "path", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "env", ".", "sys", ".", "log", ".", "conf", ".", "path", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "env", ".", "uniq", "key", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "env", ".", "uniq", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "daemon", ".", "std", "in", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "daemon", ".", "std", "in", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "daemon", ".", "stdout", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "daemon", ".", "stdout", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "daemon", ".", "std", "err", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "daemon", ".", "std", "err", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "target", ".", "python", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "target", ".", "python", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "target", ".", "schedule", "r", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "target", ".", "schedule", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "target", ".", "perform", "er", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "target", ".", "perform", "er", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "restart", ".", "count", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "restart", ".", "count", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "check", ".", "interval", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "check", ".", "interval", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "observer", ".", "status", ".", "path", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "observer", ".", "status", ".", "path", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "perform", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "path", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "path", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "asy", "npe", "rf", "orm", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "path", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "path", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "asy", "nsc", "hedule", "r_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "asy", "nsc", "hedule", "r", ".", "interval", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "asy", "nsc", "hedule", "r", ".", "interval", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "schedule", "r", ".", "interval", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "schedule", "r", ".", "interval", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "env", ".", "lang", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "job", ".", "popen", ".", "env", ".", "lang", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "timeo", "ut", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "job", ".", "popen", ".", "timeo", "ut", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "wait", "time", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "job", ".", "popen", ".", "wait", "time", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "output", ".", "limit", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "job", ".", "popen", ".", "output", ".", "limit", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "databa", "se", ".", "url", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "databa", "se", ".", "url", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "err", "\\u", "key_", ")_", "<=_", "0_", "and_", "is", "\\u", "key_", "(_", "cf_", ",_", "\"", "databa", "se", ".", "pool", ".", "status", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err", "\\u", "key_", "=_", "\"", "databa", "se", ".", "pool", ".", "status", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "uuid_", "(_", "cf_", "[_", "\"", "env", ".", "uniq", "key", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "UU", "ID", " ", "format", " ", "is", " ", "not", " ", "set", ".", " ", "-", " ", "env", ".", "uniq", "key", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "0_", "<_", "len_", "(_", "err", "\\u", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Configura", "tion", " ", "files", " ", "are", " ", "missi", "ng", ".", " ", "-", " ", "%", "s", "'_", "%_", "(_", "err", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "access_", "(_", "cf_", "[_", "\"", "env", ".", "python", "\"_", "]_", ",_", "os_", "._", "R", "\\u", "OK_", "|_", "os_", "._", "X", "\\u", "OK_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "env", ".", "python", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "env", ".", "python", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "access_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "python", "\"_", "]_", ",_", "os_", "._", "R", "\\u", "OK_", "|_", "os_", "._", "X", "\\u", "OK_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "observer", ".", "target", ".", "python", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "python", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "access_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "schedule", "r", "\"_", "]_", ",_", "os_", "._", "R", "\\u", "OK_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "observer", ".", "target", ".", "schedule", "r", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "schedule", "r", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "os_", "._", "access_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "perform", "er", "\"_", "]_", ",_", "os_", "._", "R", "\\u", "OK_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "observer", ".", "target", ".", "perform", "er", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "target", ".", "perform", "er", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "observer", ".", "restart", ".", "count", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "observer", ".", "restart", ".", "count", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "restart", ".", "count", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "observer", ".", "restart", ".", "count", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "observer", ".", "restart", ".", "count", ".", "clear", ".", "time", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "observer", ".", "check", ".", "interval", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "observer", ".", "check", ".", "interval", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "observer", ".", "check", ".", "interval", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "observer", ".", "check", ".", "interval", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "perform", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "asy", "npe", "rf", "orm", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "asy", "nsc", "hedule", "r", ".", "interval", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "asy", "nsc", "hedule", "r", ".", "interval", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "nsc", "hedule", "r", ".", "interval", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "asy", "nsc", "hedule", "r", ".", "interval", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "schedule", "r", ".", "interval", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "schedule", "r", ".", "interval", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "schedule", "r", ".", "interval", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "schedule", "r", ".", "interval", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "timeo", "ut", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "job", ".", "popen", ".", "timeo", "ut", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "timeo", "ut", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "timeo", "ut", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "wait", "time", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "job", ".", "popen", ".", "wait", "time", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "wait", "time", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "wait", "time", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "output", ".", "limit", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Mus", "t", " ", "be", " ", "a", " ", "number", ".", " ", "-", " ", "job", ".", "popen", ".", "output", ".", "limit", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "job", ".", "popen", ".", "output", ".", "limit", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "job", ".", "popen", ".", "output", ".", "limit", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "perform", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p", "\\u", "mkf", "ifo", "_", "=_", "set_", "(_", "[_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "p", "\\u", "mkf", "ifo", "_", ")_", "!=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Is", " ", "not", " ", "unique", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "[", "start", ",", "ignore", ",", "stop", "]=", "%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pwd_", "._", "getpw", "nam_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "user", ".", "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 ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Can", " ", "not", " ", "get", " ", "informati", "on", " ", "of", " ", "the", " ", "user", " ", "(", "nonexist", "ent", "?)", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grp_", "._", "getg", "rnam", "_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "group", ".", "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 ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Can", " ", "not", " ", "get", " ", "informati", "on", " ", "of", " ", "the", " ", "group", " ", "(", "nonexist", "ent", "?)", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "]_", ",_", "8_", ")_", "\\u\\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_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "perform", "er", ".", "mkf", "ifo", ".", "perm", "s", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "perform", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "asy", "npe", "rf", "orm", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "a", "\\u", "mkf", "ifo", "_", "=_", "set_", "(_", "[_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "a", "\\u", "mkf", "ifo", "_", ")_", "!=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Is", " ", "not", " ", "unique", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "[", "start", ",", "ignore", ",", "stop", "]=", "%", "s", ",%", "s", ",%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "start", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "ignore", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "stop", ".", "code", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pwd_", "._", "getpw", "nam_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "user", ".", "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 ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Can", " ", "not", " ", "get", " ", "informati", "on", " ", "of", " ", "the", " ", "user", " ", "(", "nonexist", "ent", "?)", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "user", ".", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "grp_", "._", "getg", "rnam", "_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "group", ".", "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 ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Can", " ", "not", " ", "get", " ", "informati", "on", " ", "of", " ", "the", " ", "group", " ", "(", "nonexist", "ent", "?)", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "group", ".", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "]_", ",_", "8_", ")_", "\\u\\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_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Inco", "rrect", " ", "file", " ", "permissi", "ons", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "perm", "s", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "mkf", "ifo", ".", "perm", "s", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cf_", "._", "has", "\\u", "key_", "(_", "\"", "job", ".", "whitelist", ".", "flag", "\"_", ")_", "is_", "True_", "and_", "cf_", "[_", "\"", "job", ".", "whitelist", ".", "flag", "\"_", "]_", "==_", "\"", "1", "\"_", "and_", "cf_", "._", "has", "\\u", "key_", "(_", "\"", "job", ".", "whitelist", ".", "path", "\"_", ")_", "is_", "True_", "and_", "0_", "<_", "len_", "(_", "cf_", "[_", "\"", "job", ".", "whitelist", ".", "path", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "cf_", "[_", "\"", "job", ".", "whitelist", ".", "path", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "File", " ", "not", " ", "found", ".", " ", "-", " ", "job", ".", "whitelist", ".", "path", "=", "%", "s", "'_", "%_", "(_", "cf_", "[_", "\"", "job", ".", "whitelist", ".", "path", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", ".", "pool", ".", "status_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "status", "\"_", "]_", "in_", "(_", "\"", "0", "\"_", ",_", "\"", "1", "\"_", ")_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "The", " ", "mist", "ake", " ", "is", " ", "found", " ", "in", " ", "the", " ", "set", " ", "value", ".", " ", "Ple", "ase", " ", "set", " ", "0", " ", "or", " ", "1", ".", " ", "-", " ", "databa", "se", ".", "pool", ".", "status", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "status", "\"_", "]_", "==_", "\"", "1", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cf_", "._", "has", "\\u", "key_", "(_", "\"", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Configura", "tion", " ", "informati", "on", " ", "is", " ", "missi", "ng", ".", " ", "-", " ", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "databa", "se", ".", "pool", ".", "size_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cf_", "._", "has", "\\u", "key_", "(_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Configura", "tion", " ", "informati", "on", " ", "is", " ", "missi", "ng", ".", " ", "-", " ", "databa", "se", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "int_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "it", " ", "by", " ", "the", " ", "numerical", " ", "value", ".", " ", "-", " ", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "'_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "it", " ", "by", " ", "the", " ", "numerical", " ", "value", ".", " ", "-", " ", "databa", "se", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", "]_", ")_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "values", " ", "tha", "t", " ", "are", " ", "large", "r", " ", "than", " ", "0.", " ", "-", " ", "databa", "se", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compari", "son_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "\"_", "]_", ")_", "<_", "int_", "(_", "cf_", "[_", "\"", "databa", "se", ".", "pool", ".", "size", "\"_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "\"", "databa", "se", ".", "pool", ".", "max", ".", "overflow", "\"", " ", "to", " ", "a", " ", "value", " ", "tha", "t", " ", "is", " ", "large", "r", " ", "than", " ", "\"", "databa", "se", ".", "pool", ".", "size", "\".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cf_", "._", "has", "\\u", "key_", "(_", "\"", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "\"_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Configura", "tion", " ", "informati", "on", " ", "is", " ", "missi", "ng", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "\"_", "]_", ")_", "is_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "it", " ", "by", " ", "the", " ", "numerical", " ", "value", ".", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\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 ", " _", "set\\u", "cf", "\\u", "int_", "(_", "cf_", ",_", "\"", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "int_", "(_", "cf_", "[_", "\"", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "\"_", "]_", ")_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "sys_", "._", "stderr_", ",_", "'", "Ple", "ase", " ", "set", " ", "values", " ", "tha", "t", " ", "are", " ", "large", "r", " ", "than", " ", "0.", " ", "-", " ", "asy", "npe", "rf", "orm", "er", ".", "thread", ".", "pool", ".", "size", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Inconsistent equality and hashing
rizar/attention-lvcsr/libs/Theano/theano/gof/opt.py
[ { "content": "class LocalOptimizer(object):\n \"\"\"\n A class for node-based optimizations.\n\n Instances should implement the transform function,\n and be passed to configure a fgraph-based Optimizer instance.\n\n \"\"\"\n\n\n\n\n", "metadata": "root.LocalOptimizer", "header": "['module', '___EOS___']", "index": 982 }, { "content": " def __hash__(self):\n if not hasattr(self, '_optimizer_idx'):\n self._optimizer_idx = _optimizer_idx[0]\n _optimizer_idx[0] += 1\n return self._optimizer_idx", "metadata": "root.LocalOptimizer.__hash__", "header": "['class', 'LocalOptimizer', '(', 'object', ')', ':', '___EOS___']", "index": 991 }, { "content": " def tracks(self):\n \"\"\"\n Return the list of op classes that this opt applies to.\n\n Return None to apply to all nodes.\n\n \"\"\"\n return None", "metadata": "root.LocalOptimizer.tracks", "header": "['class', 'LocalOptimizer', '(', 'object', ')', ':', '___EOS___']", "index": 997 }, { "content": " def transform(self, node):\n \"\"\"\n Transform a subgraph whose output is `node`.\n\n Subclasses should implement this function so that it returns one of two\n kinds of things:\n\n - False to indicate that no optimization can be applied to this `node`;\n or\n - <list of variables> to use in place of `node`'s outputs in the\n greater graph.\n - dict(old variables -> new variables). A dictionary that map\n from old variables to new variables to replace.\n\n Parameters\n ----------\n node : an Apply instance\n\n \"\"\"\n\n raise utils.MethodNotDefined(\"transform\",\n type(self), self.__class__.__name__)", "metadata": "root.LocalOptimizer.transform", "header": "['class', 'LocalOptimizer', '(', 'object', ')', ':', '___EOS___']", "index": 1006 }, { "content": " def add_requirements(self, fgraph):\n \"\"\"\n If this local optimization wants to add some requirements to the\n fgraph, this is the place to do it.\n\n \"\"\"\n # Added by default\n # fgraph.attach_feature(toolbox.ReplaceValidate())\n pass", "metadata": "root.LocalOptimizer.add_requirements", "header": "['class', 'LocalOptimizer', '(', 'object', ')', ':', '___EOS___']", "index": 1029 }, { "content": " def print_summary(self, stream=sys.stdout, level=0, depth=-1):\n print(\"%s%s id=%i\" % (\n (' ' * level), self.__class__.__name__, id(self)), file=stream)", "metadata": "root.LocalOptimizer.print_summary", "header": "['class', 'LocalOptimizer', '(', 'object', ')', ':', '___EOS___']", "index": 1039 } ]
[ { "span": "def __hash__(self):", "start_line": 991, "start_column": 4, "end_line": 991, "end_column": 23 } ]
[ { "span": "class LocalOptimizer(object):", "start_line": 982, "start_column": 0, "end_line": 982, "end_column": 29 } ]
1
false
[ "[CLS]_", "Inco", "nsis", "tent", "_", "equality", "_", "and_", "hashin", "g_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "class", " ", "for", " ", "node", "-", "based", " ", "optimization", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Insta", "nce", "s", " ", "shou", "ld", " ", "implement", " ", "the", " ", "transform", " ", "function", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "be", " ", "pass", "ed", " ", "to", " ", "configur", "e", " ", "a", " ", "fg", "raph", "-", "based", " ", "Optimize", "r", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "self_", ",_", "'\\u", "optimize", "r", "\\u", "idx", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "optimize", "r", "\\u", "idx_", "=_", "\\u", "optimize", "r", "\\u", "idx_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "optimize", "r", "\\u", "idx_", "[_", "0_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "optimize", "r", "\\u", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tracks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "list", " ", "of", " ", "op", " ", "classe", "s", " ", "tha", "t", " ", "this", " ", "opt", " ", "appli", "es", " ", "to", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "Non", "e", " ", "to", " ", "appl", "y", " ", "to", " ", "all", " ", "nodes", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "transform_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Transform", " ", "a", " ", "subgraph", " ", "who", "se", " ", "output", " ", "is", " ", "`", "node", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Subc", "lasse", "s", " ", "shou", "ld", " ", "implement", " ", "this", " ", "function", " ", "so", " ", "tha", "t", " ", "it", " ", "return", "s", " ", "one", " ", "of", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "kinds", " ", "of", " ", "thing", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "Fal", "se", " ", "to", " ", "indicat", "e", " ", "tha", "t", " ", "no", " ", "optimization", " ", "can", " ", "be", " ", "applied", " ", "to", " ", "this", " ", "`", "node", "`", ";", "\\", "10", ";", " ", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "<", "list", " ", "of", " ", "variab", "les", ">", " ", "to", " ", "use", " ", "in", " ", "place", " ", "of", " ", "`", "node", "`", "'", "s", " ", "output", "s", " ", "in", " ", "the", "\\", "10", ";", " ", " ", "great", "er", " ", "graph", ".", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "dict", "(", "old", " ", "variab", "les", " ", "->", " ", "new", " ", "variab", "les", ").", " ", "A", " ", "dictionar", "y", " ", "tha", "t", " ", "map", "\\", "10", ";", " ", " ", "from", " ", "old", " ", "variab", "les", " ", "to", " ", "new", " ", "variab", "les", " ", "to", " ", "replace", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "node", " ", ":", " ", "an", " ", "Apply", " ", "instance", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "raise_", "utils_", "._", "Meth", "od", "Not", "Define", "d_", "(_", "\"", "transform", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "(_", "self_", ")_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "requirements_", "(_", "self_", ",_", "fg", "raph_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "this", " ", "local", " ", "optimization", " ", "want", "s", " ", "to", " ", "add", " ", "some", " ", "require", "ment", "s", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "fg", "raph", ",", " ", "this", " ", "is", " ", "the", " ", "place", " ", "to", " ", "do", " ", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Added", " ", "by", " ", "default_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fg", "raph", ".", "attach", "\\u", "feature", "(", "toolb", "ox", ".", "Replace", "Validate", "())", "_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Local", "Optimizer_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "print", "\\u", "summary_", "(_", "self_", ",_", "stream_", "=_", "sys_", "._", "stdout_", ",_", "level_", "=_", "0_", ",_", "depth_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"%", "s", "%", "s", " ", "id", "=", "%", "i", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", " ", "'_", "*_", "level_", ")_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "id_", "(_", "self_", ")_", ")_", ",_", "file_", "=_", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 3, 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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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 ]
Constant in conditional expression or statement
jesolem/PCV/examples/ch8_gesture_recognition.py
[ { "content": "from PIL import Image\nfrom numpy import *\nfrom pylab import *\n\nfrom svmutil import *\nimport os\n\nfrom PCV.classifiers import knn, bayes\nfrom PCV.tools import imtools\nfrom PCV.localdescriptors import dsift, sift\n\n\n\"\"\"\nThis script collects the three classifiers applied to the hand gesture\nrecognition test.\n\nIf you have created the data files with the dsift features, this will\nreproduce all confucion matrices in Chapter 8.\n\nUse the if statements at the bottom to turn on/off different combinations.\n\"\"\"\n\n\n\n\n\n\n\n\n# read training data\n####################\nfeatures,labels = read_gesture_features_labels('../data/hand_gesture/train/')\nprint 'training data is:', features.shape, len(labels)\n\n# read test data\n####################\ntest_features,test_labels = read_gesture_features_labels('../data/hand_gesture/test/')\nprint 'test data is:', test_features.shape, len(test_labels)\n\nclassnames = unique(labels)\nnbr_classes = len(classnames)\n\n\nif False:\n # reduce dimensions with PCA\n from PCV.tools import pca\n\n V,S,m = pca.pca(features)\n\n # keep most important dimensions\n V = V[:50]\n features = array([dot(V,f-m) for f in features])\n test_features = array([dot(V,f-m) for f in test_features])\n\n\nif True:\n # test kNN\n k = 1\n knn_classifier = knn.KnnClassifier(labels,features)\n res = array([knn_classifier.classify(test_features[i],k) for i in range(len(test_labels))]) # TODO kan goras battre\n\n\nif False:\n # test Bayes\n bc = bayes.BayesClassifier()\n blist = [features[where(labels==c)[0]] for c in classnames]\n\n bc.train(blist,classnames)\n res = bc.classify(test_features)[0]\n\n\nif False:\n # test SVM\n # convert to lists for libsvm\n features = map(list,features)\n test_features = map(list,test_features)\n\n # create conversion function for the labels\n transl = {}\n for i,c in enumerate(classnames):\n transl[c],transl[i] = i,c\n\n # create SVM\n prob = svm_problem(convert_labels(labels,transl),features)\n param = svm_parameter('-t 0')\n\n # train SVM on data\n m = svm_train(prob,param)\n\n # how did the training do?\n res = svm_predict(convert_labels(labels,transl),features,m)\n\n # test the SVM\n res = svm_predict(convert_labels(test_labels,transl),test_features,m)[0]\n res = convert_labels(res,transl)\n\n\n# accuracy\nacc = sum(1.0*(res==test_labels)) / len(test_labels)\nprint 'Accuracy:', acc\n\nprint_confusion(res,test_labels,classnames)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "True:", "start_line": 87, "start_column": 3, "end_line": 87, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Constant_", "in_", "conditional", "_", "expression_", "or_", "statement_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "PIL_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pylab_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "svm", "util_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "PC", "V_", "._", "classifiers_", "import_", "knn", "_", ",_", "bayes", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PC", "V_", "._", "tools_", "import_", "im", "tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PC", "V_", "._", "locald", "escri", "pto", "rs_", "import_", "dsi", "ft_", ",_", "sift", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Thi", "s", " ", "script", " ", "collect", "s", " ", "the", " ", "three", " ", "classif", "iers", " ", "applied", " ", "to", " ", "the", " ", "hand", " ", "gesture", "\\", "10", ";", "recognition", " ", "test", ".", "\\", "10", ";", "\\", "10", ";", "If", " ", "you", " ", "have", " ", "created", " ", "the", " ", "data", " ", "files", " ", "with", " ", "the", " ", "dsi", "ft", " ", "features", ",", " ", "this", " ", "will", "\\", "10", ";", "reproduce", " ", "all", " ", "conf", "uci", "on", " ", "matric", "es", " ", "in", " ", "Chap", "ter", " ", "8", ".", "\\", "10", ";", "\\", "10", ";", "Us", "e", " ", "the", " ", "if", " ", "statem", "ents", " ", "at", " ", "the", " ", "bottom", " ", "to", " ", "turn", " ", "on", "/", "off", " ", "different", " ", "combinat", "ion", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "train", "ing", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "features_", ",_", "labels_", "=_", "read", "\\u", "gesture", "\\u", "features", "\\u", "labels_", "(_", "'../", "data", "/", "hand", "\\u", "gesture", "/", "train", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "train", "ing", " ", "data", " ", "is", ":'_", ",_", "features_", "._", "shape_", ",_", "len_", "(_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "test", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "test\\u", "features_", ",_", "test\\u", "labels_", "=_", "read", "\\u", "gesture", "\\u", "features", "\\u", "labels_", "(_", "'../", "data", "/", "hand", "\\u", "gesture", "/", "test", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "test", " ", "data", " ", "is", ":'_", ",_", "test\\u", "features_", "._", "shape_", ",_", "len_", "(_", "test\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class", "names_", "=_", "unique_", "(_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nbr", "\\u", "classes_", "=_", "len_", "(_", "class", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "reduce", " ", "dimension", "s", " ", "with", " ", "PCA", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "PC", "V_", "._", "tools_", "import_", "pca_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "V_", ",_", "S_", ",_", "m_", "=_", "pca_", "._", "pca_", "(_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "keep", " ", "most", " ", "importa", "nt", " ", "dimensions_", "\\u\\u\\uNL\\u\\u\\u_", "V_", "=_", "V_", "[_", ":_", "50_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", "=_", "array_", "(_", "[_", "dot_", "(_", "V_", ",_", "f_", "-_", "m_", ")_", "for_", "f_", "in_", "features_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "features_", "=_", "array_", "(_", "[_", "dot_", "(_", "V_", ",_", "f_", "-_", "m_", ")_", "for_", "f_", "in_", "test\\u", "features_", "]_", ")_", "\\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_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "k", "NN_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "knn", "\\u", "classifier_", "=_", "knn", "_", "._", "Kn", "n", "Classifier_", "(_", "labels_", ",_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "array_", "(_", "[_", "knn", "\\u", "classifier_", "._", "classify_", "(_", "test\\u", "features_", "[_", "i_", "]_", ",_", "k_", ")_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "test\\u", "labels_", ")_", ")_", "]_", ")_", "#", " ", "TOD", "O", " ", "kan", " ", "gor", "as", " ", "batt", "re_", "\\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_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "Bayes", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bc_", "=_", "bayes", "_", "._", "Bayes", "Classifier_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blis", "t_", "=_", "[_", "features_", "[_", "where_", "(_", "labels_", "==_", "c_", ")_", "[_", "0_", "]_", "]_", "for_", "c_", "in_", "class", "names_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bc_", "._", "train_", "(_", "blis", "t_", ",_", "class", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "bc_", "._", "classify_", "(_", "test\\u", "features_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "test", " ", "SV", "M_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "to", " ", "lists", " ", "for", " ", "libs", "vm_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", "=_", "map_", "(_", "list_", ",_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test\\u", "features_", "=_", "map_", "(_", "list_", ",_", "test\\u", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "conve", "rsi", "on", " ", "function", " ", "for", " ", "the", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "transl", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "c_", "in_", "enumerate_", "(_", "class", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transl", "_", "[_", "c_", "]_", ",_", "transl", "_", "[_", "i_", "]_", "=_", "i_", ",_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "SV", "M_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "prob_", "=_", "svm", "\\u", "problem_", "(_", "convert", "\\u", "labels_", "(_", "labels_", ",_", "transl", "_", ")_", ",_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param_", "=_", "svm", "\\u", "parameter_", "(_", "'-", "t", " ", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "train", " ", "SV", "M", " ", "on", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "svm", "\\u", "train_", "(_", "prob_", ",_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "how", " ", "did", " ", "the", " ", "train", "ing", " ", "do", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "svm", "\\u", "predict_", "(_", "convert", "\\u", "labels_", "(_", "labels_", ",_", "transl", "_", ")_", ",_", "features_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "test", " ", "the", " ", "SV", "M_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "svm", "\\u", "predict_", "(_", "convert", "\\u", "labels_", "(_", "test\\u", "labels_", ",_", "transl", "_", ")_", ",_", "test\\u", "features_", ",_", "m_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "convert", "\\u", "labels_", "(_", "res_", ",_", "transl", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "accuracy_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "acc_", "=_", "sum_", "(_", "1.0_", "*_", "(_", "res_", "==_", "test\\u", "labels_", ")_", ")_", "/_", "len_", "(_", "test\\u", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Accu", "rac", "y", ":'_", ",_", "acc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_",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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
kevinrenskers/django-generic-notifications/notifications/migrations/0001_initial.py
[ { "content": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'auth.group': {\n 'Meta': {'object_name': 'Group'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),\n 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n 'auth.permission': {\n 'Meta': {'ordering': \"('content_type__app_label', 'content_type__model', 'codename')\", 'unique_together': \"(('content_type', 'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n 'auth.user': {\n 'Meta': {'object_name': 'User'},\n 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'unique': 'True', 'null': 'True'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Group']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),\n 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),\n 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),\n 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': \"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'notifications.notificationbackendsettings': {\n 'Meta': {'unique_together': \"(['user', 'notification_backend'],)\", 'object_name': 'NotificationBackendSettings'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'notification_backend': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'settings': ('django.db.models.fields.TextField', [], {'default': \"'{}'\"}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\"})\n },\n 'notifications.notificationqueue': {\n 'Meta': {'object_name': 'NotificationQueue'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'notification_backend': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'subject': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),\n 'text': ('django.db.models.fields.TextField', [], {'blank': 'True'}),\n 'tries': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'notifications'\", 'to': \"orm['auth.User']\"})\n },\n 'notifications.selectednotificationstype': {\n 'Meta': {'unique_together': \"(['user', 'notification_type'],)\", 'object_name': 'SelectedNotificationsType'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'notification_backends': ('django.db.models.fields.TextField', [], {}),\n 'notification_type': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['auth.User']\"})\n }\n }\n\n complete_apps = ['notifications']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def forwards(self, orm):\n \n # Adding model 'NotificationQueue'\n db.create_table('notifications_notificationqueue', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='notifications', to=orm['auth.User'])),\n ('subject', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),\n ('text', self.gf('django.db.models.fields.TextField')(blank=True)),\n ('tries', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),\n ('notification_backend', self.gf('django.db.models.fields.CharField')(max_length=255)),\n ))\n db.send_create_signal('notifications', ['NotificationQueue'])\n\n # Adding model 'SelectedNotificationsType'\n db.create_table('notifications_selectednotificationstype', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),\n ('notification_type', self.gf('django.db.models.fields.CharField')(max_length=255)),\n ('notification_backends', self.gf('django.db.models.fields.TextField')()),\n ))\n db.send_create_signal('notifications', ['SelectedNotificationsType'])\n\n # Adding unique constraint on 'SelectedNotificationsType', fields ['user', 'notification_type']\n db.create_unique('notifications_selectednotificationstype', ['user_id', 'notification_type'])\n\n # Adding model 'NotificationBackendSettings'\n db.create_table('notifications_notificationbackendsettings', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),\n ('notification_backend', self.gf('django.db.models.fields.CharField')(max_length=255)),\n ('settings', self.gf('django.db.models.fields.TextField')(default='{}')),\n ))\n db.send_create_signal('notifications', ['NotificationBackendSettings'])\n\n # Adding unique constraint on 'NotificationBackendSettings', fields ['user', 'notification_backend']\n db.create_unique('notifications_notificationbackendsettings', ['user_id', 'notification_backend'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 8 }, { "content": " def backwards(self, orm):\n \n # Removing unique constraint on 'NotificationBackendSettings', fields ['user', 'notification_backend']\n db.delete_unique('notifications_notificationbackendsettings', ['user_id', 'notification_backend'])\n\n # Removing unique constraint on 'SelectedNotificationsType', fields ['user', 'notification_type']\n db.delete_unique('notifications_selectednotificationstype', ['user_id', 'notification_type'])\n\n # Deleting model 'NotificationQueue'\n db.delete_table('notifications_notificationqueue')\n\n # Deleting model 'SelectedNotificationsType'\n db.delete_table('notifications_selectednotificationstype')\n\n # Deleting model 'NotificationBackendSettings'\n db.delete_table('notifications_notificationbackendsettings')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 46 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "80", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "code", "name", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "code", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", ".", "user", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "date", "\\u", "joine", "d", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Ema", "il", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "7", "5", "'_", ",_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "active", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "sta", "ff", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "super", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "login", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "128", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "permissi", "ons", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "unique", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "30", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "s", ".", "notification", "back", "ends", "etti", "ngs", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"([", "'", "user", "',", " ", "'", "notification", "\\u", "back", "end", "']", ",)", "\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "\\u", "back", "end", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "settings", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'{", "}'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "s", ".", "notification", "queue", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Notifi", "cation", "Queue", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "\\u", "back", "end", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "subject", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "trie", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "0", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "notification", "s", "'\"_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "s", ".", "selecte", "dno", "tif", "ication", "sty", "pe", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"([", "'", "user", "',", " ", "'", "notification", "\\u", "type", "']", ",)", "\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Select", "ed", "Notifi", "cations", "Type", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "\\u", "back", "ends", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "notification", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "notification", "s", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Notifi", "cation", "Queue", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "notification", "queue", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "relate", "d\\u", "name_", "=_", "'", "notification", "s", "'_", ",_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "subject", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "255_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "text", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "trie", "s", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ")_", "(_", "default_", "=_", "0_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "notification", "\\u", "back", "end", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "255_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "notification", "s", "'_", ",_", "[_", "'", "Notifi", "cation", "Queue", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Select", "ed", "Notifi", "cations", "Type", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "selecte", "dno", "tif", "ication", "sty", "pe", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "notification", "\\u", "type", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "255_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "notification", "\\u", "back", "ends", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "notification", "s", "'_", ",_", "[_", "'", "Select", "ed", "Notifi", "cations", "Type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Select", "ed", "Notifi", "cations", "Type", "',", " ", "fields", " ", "['", "user", "',", " ", "'", "notification", "\\u", "type", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "'", "notification", "s", "\\u", "selecte", "dno", "tif", "ication", "sty", "pe", "'_", ",_", "[_", "'", "user", "\\u", "id", "'_", ",_", "'", "notification", "\\u", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "model", " ", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "notification", "back", "ends", "etti", "ngs", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "user", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "auth", ".", "User", "'_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "notification", "\\u", "back", "end", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "255_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "settings", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ")_", "(_", "default_", "=_", "'{}'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "notification", "s", "'_", ",_", "[_", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "',", " ", "fields", " ", "['", "user", "',", " ", "'", "notification", "\\u", "back", "end", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "'", "notification", "s", "\\u", "notification", "back", "ends", "etti", "ngs", "'_", ",_", "[_", "'", "user", "\\u", "id", "'_", ",_", "'", "notification", "\\u", "back", "end", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "',", " ", "fields", " ", "['", "user", "',", " ", "'", "notification", "\\u", "back", "end", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "unique_", "(_", "'", "notification", "s", "\\u", "notification", "back", "ends", "etti", "ngs", "'_", ",_", "[_", "'", "user", "\\u", "id", "'_", ",_", "'", "notification", "\\u", "back", "end", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remo", "ving", " ", "unique", " ", "constraint", " ", "on", " ", "'", "Select", "ed", "Notifi", "cations", "Type", "',", " ", "fields", " ", "['", "user", "',", " ", "'", "notification", "\\u", "type", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "unique_", "(_", "'", "notification", "s", "\\u", "selecte", "dno", "tif", "ication", "sty", "pe", "'_", ",_", "[_", "'", "user", "\\u", "id", "'_", ",_", "'", "notification", "\\u", "type", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Notifi", "cation", "Queue", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "notification", "queue", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Select", "ed", "Notifi", "cations", "Type", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "selecte", "dno", "tif", "ication", "sty", "pe", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "model", " ", "'", "Notifi", "cation", "Back", "end", "Sett", "ings", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "table_", "(_", "'", "notification", "s", "\\u", "notification", "back", "ends", "etti", "ngs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
CollabQ/CollabQ/vendor/django/contrib/gis/db/backend/__init__.py
[ { "content": "\"\"\"\n This module provides the backend for spatial SQL construction with Django.\n\n Specifically, this module will import the correct routines and modules\n needed for GeoDjango to interface with the spatial database.\n\"\"\"\nfrom django.conf import settings\nfrom django.contrib.gis.db.backend.util import gqn\n\n# Retrieving the necessary settings from the backend.\nif settings.DATABASE_ENGINE == 'postgresql_psycopg2':\n from django.contrib.gis.db.backend.postgis import create_test_spatial_db, get_geo_where_clause, SpatialBackend\nelif settings.DATABASE_ENGINE == 'oracle':\n from django.contrib.gis.db.backend.oracle import create_test_spatial_db, get_geo_where_clause, SpatialBackend\nelif settings.DATABASE_ENGINE == 'mysql':\n from django.contrib.gis.db.backend.mysql import create_test_spatial_db, get_geo_where_clause, SpatialBackend\nelif settings.DATABASE_ENGINE == 'sqlite3':\n from django.contrib.gis.db.backend.spatialite import create_test_spatial_db, get_geo_where_clause, SpatialBackend\nelse:\n raise NotImplementedError('No Geographic Backend exists for %s' % settings.DATABASE_ENGINE)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.contrib.gis.db.backend.util import gqn", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 50 }, { "span": "from django.contrib.gis.db.backend.postgis import create_test_spatial_db, get_geo_where_clause, SpatialBackend", "start_line": 11, "start_column": 4, "end_line": 11, "end_column": 114 }, { "span": "from django.contrib.gis.db.backend.oracle import create_test_spatial_db, get_geo_where_clause, SpatialBackend", "start_line": 13, "start_column": 4, "end_line": 13, "end_column": 113 }, { "span": "from django.contrib.gis.db.backend.mysql import create_test_spatial_db, get_geo_where_clause, SpatialBackend", "start_line": 15, "start_column": 4, "end_line": 15, "end_column": 112 }, { "span": "from django.contrib.gis.db.backend.spatialite import create_test_spatial_db, get_geo_where_clause, SpatialBackend", "start_line": 17, "start_column": 4, "end_line": 17, "end_column": 117 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", "Thi", "s", " ", "module", " ", "provide", "s", " ", "the", " ", "back", "end", " ", "for", " ", "spat", "ial", " ", "SQL", " ", "constructi", "on", " ", "with", " ", "Dj", "ang", "o", ".", "\\", "10", ";", "\\", "10", ";", " ", "Specifi", "call", "y", ",", " ", "this", " ", "module", " ", "will", " ", "import", " ", "the", " ", "correct", " ", "routin", "es", " ", "and", " ", "module", "s", "\\", "10", ";", " ", "need", "ed", " ", "for", " ", "Geo", "Dj", "ang", "o", " ", "to", " ", "interface", " ", "with", " ", "the", " ", "spat", "ial", " ", "databa", "se", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "db_", "._", "backend_", "._", "util_", "import_", "gq", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Retriev", "ing", " ", "the", " ", "necessar", "y", " ", "settings", " ", "from", " ", "the", " ", "back", "end", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "settings_", "._", "DATA", "BASE", "\\u", "ENGINE_", "==_", "'", "postgres", "ql", "\\u", "psy", "cop", "g2", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "db_", "._", "backend_", "._", "post", "gis_", "import_", "create", "\\u", "test\\u", "spat", "ial", "\\u", "db_", ",_", "get", "\\u", "geo", "\\u", "where", "\\u", "clause_", ",_", "Spa", "tial", "Backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "settings_", "._", "DATA", "BASE", "\\u", "ENGINE_", "==_", "'", "oracle", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "db_", "._", "backend_", "._", "oracle", "_", "import_", "create", "\\u", "test\\u", "spat", "ial", "\\u", "db_", ",_", "get", "\\u", "geo", "\\u", "where", "\\u", "clause_", ",_", "Spa", "tial", "Backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "settings_", "._", "DATA", "BASE", "\\u", "ENGINE_", "==_", "'", "mysql", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "db_", "._", "backend_", "._", "mysql_", "import_", "create", "\\u", "test\\u", "spat", "ial", "\\u", "db_", ",_", "get", "\\u", "geo", "\\u", "where", "\\u", "clause_", ",_", "Spa", "tial", "Backend_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "settings_", "._", "DATA", "BASE", "\\u", "ENGINE_", "==_", "'", "sql", "ite", "3", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "gis_", "._", "db_", "._", "backend_", "._", "spat", "iali", "te_", "import_", "create", "\\u", "test\\u", "spat", "ial", "\\u", "db_", ",_", "get", "\\u", "geo", "\\u", "where", "\\u", "clause_", ",_", "Spa", "tial", "Backend_", "\\u\\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_", "(_", "'", "No", " ", "Geo", "graphic", " ", "Back", "end", " ", "exist", "s", " ", "for", " ", "%", "s", "'_", "%_", "settings_", "._", "DATA", "BASE", "\\u", "ENGINE_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cpbotha/nvpy/nvpy/nvpy.py
[ { "content": "#!/usr/bin/env python\n\n# nvPY: cross-platform note-taking app with simplenote syncing\n# copyright 2012 by Charl P. Botha <[email protected]>\n# new BSD license\n\n# inspired by notational velocity and nvALT, neither of which I've used,\n# and ResophNotes, which I have used.\n\n# full width horizontal bar at top to search\n# left column with current results: name, mod date, summary, tags\n# right column with text of currently selected note\n\n# * typing in the search bar:\n# - press enter: focus jumps to note if ANYTHING is selected. if nothing is\n# selected, enter creates a new note with the current string as its name.\n# - esc clears the search entry, esc again jumps to list\n# - up and down changes currently selected list\n# * in note conten area\n# - esc goes back to notes list.\n\n# http://www.scribd.com/doc/91277952/Simple-Note-API-v2-1-3\n# this also has a sync algorithm!\n\n# 1. finish implementing search\n# 1.5. think about other storage formats. What if we want to store more? (cursor position and so on. sqlite?)\n# 2. note editing\n# a) saving to disc: remember lmodified or whatever.\n# b) syncing with simplenote\n\n# to check if we're online\n\nimport codecs\nimport ConfigParser\nimport logging\nfrom logging.handlers import RotatingFileHandler\nfrom notes_db import NotesDB, SyncError, ReadError, WriteError\nimport argparse\nimport os\nimport sys\nimport time\n\nfrom utils import KeyValueObject, SubjectMixin\nimport view\nimport webbrowser\n\ntry:\n import markdown\nexcept ImportError:\n HAVE_MARKDOWN = False\nelse:\n HAVE_MARKDOWN = True\n\ntry:\n import docutils\n import docutils.core\nexcept ImportError:\n HAVE_DOCUTILS = False\nelse:\n HAVE_DOCUTILS = True\n\nVERSION = \"1.0.0 BETA2\"\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Config:\n \"\"\"\n @ivar files_read: list of config files that were parsed.\n @ivar ok: True if config files had a default section, False otherwise.\n \"\"\"\n", "metadata": "root.Config", "header": "['module', '___EOS___']", "index": 64 }, { "content": " def __init__(self, app_dir):\n \"\"\"\n @param app_dir: the directory containing nvpy.py\n \"\"\"\n\n self.app_dir = app_dir\n # cross-platform way of getting home dir!\n # http://stackoverflow.com/a/4028943/532513\n home = os.path.abspath(os.path.expanduser('~'))\n defaults = {'app_dir': app_dir,\n 'appdir': app_dir,\n 'home': home,\n 'notes_as_txt': '0',\n 'housekeeping_interval': '2',\n 'search_mode': 'gstyle',\n 'case_sensitive': '1',\n 'search_tags': '1',\n 'sort_mode': '1',\n 'pinned_ontop': '1',\n 'db_path': os.path.join(home, '.nvpy'),\n 'txt_path': os.path.join(home, '.nvpy/notes'),\n 'theme': 'default',\n 'font_family': 'Courier', # monospaced on all platforms\n 'font_size': '10',\n 'list_font_family': 'Helvetica', # sans on all platforms\n 'list_font_family_fixed': 'Courier', # monospace on all platforms\n 'list_font_size': '10',\n 'layout': 'horizontal',\n 'print_columns': '0',\n 'background_color': 'white',\n 'sn_username': '',\n 'sn_password': '',\n 'simplenote_sync': '1',\n 'debug': '1',\n # Filename or filepath to a css file used style the rendered\n # output; e.g. nvpy.css or /path/to/my.css\n 'rest_css_path': None,\n }\n\n # parse command-line arguments\n args = self.parse_cmd_line_opts()\n\n # later config files overwrite earlier files\n # try a number of alternatives\n cfg_files = [os.path.join(app_dir, 'nvpy.cfg'),\n os.path.join(home, 'nvpy.cfg'),\n os.path.join(home, '.nvpy.cfg'),\n os.path.join(home, '.nvpy'),\n os.path.join(home, '.nvpyrc')]\n\n # user has specified either a specific path to a CFG file, or a\n # path relative to the nvpy.py location. specific takes precedence.\n if args is not None and args.cfg is not None:\n cfg_files.extend([os.path.join(app_dir, args.cfg), args.cfg])\n\n cp = ConfigParser.SafeConfigParser(defaults)\n self.files_read = cp.read(cfg_files)\n\n cfg_sec = 'nvpy'\n\n if not cp.has_section(cfg_sec):\n cp.add_section(cfg_sec)\n self.ok = False\n\n else:\n self.ok = True\n\n # for the username and password, we don't want interpolation,\n # hence the raw parameter. Fixes\n # https://github.com/cpbotha/nvpy/issues/9\n self.sn_username = cp.get(cfg_sec, 'sn_username', raw=True)\n self.sn_password = cp.get(cfg_sec, 'sn_password', raw=True)\n self.simplenote_sync = cp.getint(cfg_sec, 'simplenote_sync')\n # make logic to find in $HOME if not set\n self.db_path = cp.get(cfg_sec, 'db_path')\n # 0 = alpha sort, 1 = last modified first\n self.notes_as_txt = cp.getint(cfg_sec, 'notes_as_txt')\n self.txt_path = os.path.join(home, cp.get(cfg_sec, 'txt_path'))\n self.search_mode = cp.get(cfg_sec, 'search_mode')\n self.case_sensitive = cp.getint(cfg_sec, 'case_sensitive')\n self.search_tags = cp.getint(cfg_sec, 'search_tags')\n self.sort_mode = cp.getint(cfg_sec, 'sort_mode')\n self.pinned_ontop = cp.getint(cfg_sec, 'pinned_ontop')\n self.housekeeping_interval = cp.getint(cfg_sec, 'housekeeping_interval')\n self.housekeeping_interval_ms = self.housekeeping_interval * 1000\n\n self.theme = cp.get(cfg_sec, 'theme')\n self.font_family = cp.get(cfg_sec, 'font_family')\n self.font_size = cp.getint(cfg_sec, 'font_size')\n\n self.list_font_family = cp.get(cfg_sec, 'list_font_family')\n self.list_font_family_fixed = cp.get(cfg_sec, 'list_font_family_fixed')\n self.list_font_size = cp.getint(cfg_sec, 'list_font_size')\n\n self.layout = cp.get(cfg_sec, 'layout')\n self.print_columns = cp.getint(cfg_sec, 'print_columns')\n\n self.background_color = cp.get(cfg_sec, 'background_color')\n\n self.rest_css_path = cp.get(cfg_sec, 'rest_css_path')\n self.debug = cp.getint(cfg_sec, 'debug')", "metadata": "root.Config.__init__", "header": "['class', 'Config', ':', '___EOS___']", "index": 69 }, { "content": " def parse_cmd_line_opts(self):\n if __name__ != '__main__':\n return None\n\n parser = argparse.ArgumentParser()\n parser.add_argument('--cfg', '-c', default='', dest='cfg',\n metavar='nvpy.cfg', help='path to config file')\n args = parser.parse_args()\n return args", "metadata": "root.Config.parse_cmd_line_opts", "header": "['class', 'Config', ':', '___EOS___']", "index": 171 }, { "content": "class NotesListModel(SubjectMixin):\n \"\"\"\n @ivar list: List of (str key, dict note) objects.\n \"\"\"\n\n", "metadata": "root.NotesListModel", "header": "['module', '___EOS___']", "index": 182 }, { "content": " def __init__(self):\n # call mixin ctor\n SubjectMixin.__init__(self)\n\n self.list = []\n self.match_regexps = []", "metadata": "root.NotesListModel.__init__", "header": "['class', 'NotesListModel', '(', 'SubjectMixin', ')', ':', '___EOS___']", "index": 186 }, { "content": " def set_list(self, alist):\n self.list = alist\n self.notify_observers('set:list', None)", "metadata": "root.NotesListModel.set_list", "header": "['class', 'NotesListModel', '(', 'SubjectMixin', ')', ':', '___EOS___']", "index": 193 }, { "content": " def get_idx(self, key):\n \"\"\"Find idx for passed LOCAL key.\n \"\"\"\n found = [i for i, e in enumerate(self.list) if e.key == key]\n if found:\n return found[0]\n\n else:\n return -1", "metadata": "root.NotesListModel.get_idx", "header": "['class', 'NotesListModel', '(', 'SubjectMixin', ')', ':', '___EOS___']", "index": 197 }, { "content": "class Controller:\n \"\"\"Main application class.\n \"\"\"\n\n\n\n\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.Controller", "header": "['module', '___EOS___']", "index": 208 }, { "content": " def __init__(self, config):\n # should probably also look in $HOME\n self.config = config\n self.config.app_version = VERSION\n\n # configure logging module\n #############################\n\n # first create db directory if it doesn't exist yet.\n if not os.path.exists(self.config.db_path):\n os.mkdir(self.config.db_path)\n\n log_filename = os.path.join(self.config.db_path, 'nvpy.log')\n # file will get nuked when it reaches 100kB\n lhandler = RotatingFileHandler(log_filename, maxBytes=100000, backupCount=1)\n lhandler.setLevel(logging.DEBUG)\n lhandler.setFormatter(logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s'))\n # we get the root logger and configure it\n logger = logging.getLogger()\n if self.config.debug == 1:\n logger.setLevel(logging.DEBUG)\n logger.addHandler(lhandler)\n # this will go to the root logger\n logging.debug('nvpy logging initialized')\n\n logging.debug('config read from %s' % (str(self.config.files_read),))\n\n if self.config.sn_username == '':\n self.config.simplenote_sync = 0\n\n css = self.config.rest_css_path\n if css:\n if css.startswith(\"~/\"):\n # On Mac, paths that start with '~/' aren't found by path.exists\n css = css.replace(\n \"~\", os.path.abspath(os.path.expanduser('~')), 1)\n self.config.rest_css_path = css\n if not os.path.exists(css):\n # Couldn't find the user-defined css file. Use docutils css instead.\n self.config.rest_css_path = None\n\n self.notes_list_model = NotesListModel()\n # create the interface\n self.view = view.View(self.config, self.notes_list_model)\n\n # read our database of notes into memory\n # and sync with simplenote.\n try:\n self.notes_db = NotesDB(self.config)\n\n except ReadError, e:\n emsg = \"Please check nvpy.log.\\n\" + str(e)\n self.view.show_error('Sync error', emsg)\n exit(1)\n\n self.notes_db.add_observer('synced:note', self.observer_notes_db_synced_note)\n self.notes_db.add_observer('change:note-status', self.observer_notes_db_change_note_status)\n\n if self.config.simplenote_sync:\n self.notes_db.add_observer('progress:sync_full', self.observer_notes_db_sync_full)\n self.sync_full()\n\n # we want to be notified when the user does stuff\n self.view.add_observer('click:notelink',\n self.observer_view_click_notelink)\n self.view.add_observer('delete:note', self.observer_view_delete_note)\n self.view.add_observer('select:note', self.observer_view_select_note)\n self.view.add_observer('change:entry', self.observer_view_change_entry)\n self.view.add_observer('change:text', self.observer_view_change_text)\n self.view.add_observer('change:pinned', self.observer_view_change_pinned)\n self.view.add_observer('create:note', self.observer_view_create_note)\n self.view.add_observer('keep:house', self.observer_view_keep_house)\n self.view.add_observer('command:markdown', self.observer_view_markdown)\n self.view.add_observer('command:rest', self.observer_view_rest)\n self.view.add_observer('delete:tag', self.observer_view_delete_tag)\n self.view.add_observer('add:tag', self.observer_view_add_tag)\n\n if self.config.simplenote_sync:\n self.view.add_observer('command:sync_full', lambda v, et, e: self.sync_full())\n self.view.add_observer('command:sync_current_note', self.observer_view_sync_current_note)\n\n self.view.add_observer('close', self.observer_view_close)\n\n # setup UI to reflect our search mode and case sensitivity\n self.view.set_cs(self.config.case_sensitive, silent=True)\n self.view.set_search_mode(self.config.search_mode, silent=True)\n\n self.view.add_observer('change:cs', self.observer_view_change_cs)\n self.view.add_observer('change:search_mode', self.observer_view_change_search_mode)\n\n # nn is a list of (key, note) objects\n nn, match_regexp, active_notes = self.notes_db.filter_notes()\n # this will trigger the list_change event\n self.notes_list_model.set_list(nn)\n self.notes_list_model.match_regexp = match_regexp\n self.view.set_note_tally(len(nn), active_notes, len(self.notes_db.notes))\n\n # we'll use this to keep track of the currently selected note\n # we only use idx, because key could change from right under us.\n self.selected_note_idx = -1\n self.view.select_note(0)", "metadata": "root.Controller.__init__", "header": "['class', 'Controller', ':', '___EOS___']", "index": 212 }, { "content": " def get_selected_note_key(self):\n if self.selected_note_idx >= 0:\n return self.notes_list_model.list[self.selected_note_idx].key\n else:\n return None", "metadata": "root.Controller.get_selected_note_key", "header": "['class', 'Controller', ':', '___EOS___']", "index": 314 }, { "content": " def main_loop(self):\n if not self.config.files_read:\n self.view.show_warning('No config file',\n 'Could not read any configuration files. See https://github.com/cpbotha/nvpy for details.')\n\n elif not self.config.ok:\n wmsg = ('Please rename [default] to [nvpy] in %s. ' + \\\n 'Config file format changed after nvPY 0.8.') % \\\n (str(self.config.files_read),)\n self.view.show_warning('Rename config section', wmsg)\n\n self.view.main_loop()", "metadata": "root.Controller.main_loop", "header": "['class', 'Controller', ':', '___EOS___']", "index": 320 }, { "content": " def observer_notes_db_change_note_status(self, notes_db, evt_type, evt):\n skey = self.get_selected_note_key()\n if skey == evt.key:\n self.view.set_note_status(self.notes_db.get_note_status(skey))", "metadata": "root.Controller.observer_notes_db_change_note_status", "header": "['class', 'Controller', ':', '___EOS___']", "index": 333 }, { "content": " def observer_notes_db_sync_full(self, notes_db, evt_type, evt):\n logging.debug(evt.msg)\n self.view.set_status_text(evt.msg)", "metadata": "root.Controller.observer_notes_db_sync_full", "header": "['class', 'Controller', ':', '___EOS___']", "index": 338 }, { "content": " def observer_notes_db_synced_note(self, notes_db, evt_type, evt):\n \"\"\"This observer gets called only when a note returns from\n a sync that's more recent than our most recent mod to that note.\n \"\"\"\n\n selected_note_o = self.notes_list_model.list[self.selected_note_idx]\n # if the note synced back matches our currently selected note,\n # we overwrite.\n\n if selected_note_o.key == evt.lkey:\n if selected_note_o.note['content'] != evt.old_note['content']:\n self.view.mute_note_data_changes()\n # in this case, we want to keep the user's undo buffer so that they\n # can undo synced back changes if they would want to.\n self.view.set_note_data(selected_note_o.note, reset_undo=False)\n self.view.unmute_note_data_changes()", "metadata": "root.Controller.observer_notes_db_synced_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 342 }, { "content": " def observer_view_click_notelink(self, view, evt_type, note_name):\n # find note_name in titles, try to jump to that note\n # if not in current list, change search string in case\n # it's somewhere else\n # FIXME: implement find_note_by_name\n idx = self.view.select_note_by_name(note_name)\n\n if idx < 0:\n # this means a note with that name was not found\n # because nvpy kicks ass, it then assumes the contents of [[]]\n # to be a new regular expression to search for in the notes db.\n self.view.set_search_entry_text(note_name)", "metadata": "root.Controller.observer_view_click_notelink", "header": "['class', 'Controller', ':', '___EOS___']", "index": 359 }, { "content": " def observer_view_delete_note(self, view, evt_type, evt):\n # delete note from notes_db\n # remove the note from the notes_list_model.list\n\n # if these two are not equal, something is not kosher.\n assert(evt.sel == self.selected_note_idx)\n\n # first get key of note that is to be deleted\n key = self.get_selected_note_key()\n\n # then try to select after the one that is to be deleted\n nidx = evt.sel + 1\n if nidx >= 0 and nidx < self.view.get_number_of_notes():\n self.view.select_note(nidx)\n\n # finally delete the note\n self.notes_db.delete_note(key)\n\n # easiest now is just to regenerate the list by resetting search string\n # if the note after the deleted one is already selected, this will\n # simply keep that selection!\n self.view.set_search_entry_text(self.view.get_search_entry_text())", "metadata": "root.Controller.observer_view_delete_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 372 }, { "content": " def helper_markdown_to_html(self):\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n c = self.notes_db.get_note_content(key)\n logging.debug(\"Trying to convert %s to html.\" % (key,))\n if HAVE_MARKDOWN:\n logging.debug(\"Convert note %s to html.\" % (key,))\n html = markdown.markdown(c)\n logging.debug(\"Convert done.\")\n\n else:\n logging.debug(\"Markdown not installed.\")\n html = \"<p>python markdown not installed, required for rendering to HTML.</p>\"\n html += \"<p>Please install with \\\"pip install markdown\\\".</p>\"\n\n # create filename based on key\n fn = os.path.join(self.config.db_path, key + '.html')\n f = codecs.open(fn, mode='wb', encoding='utf-8')\n s = u\"\"\"\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n%s\n</head>\n<body>\n%s\n</body>\n</html>\n \"\"\" % ('<meta http-equiv=\"refresh\" content=\"5\">' if self.view.get_continuous_rendering() else \"\",html,)\n f.write(s)\n f.close()\n return fn", "metadata": "root.Controller.helper_markdown_to_html", "header": "['class', 'Controller', ':', '___EOS___']", "index": 395 }, { "content": " def helper_rest_to_html(self):\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n c = self.notes_db.get_note_content(key)\n if HAVE_DOCUTILS:\n settings = {}\n if self.config.rest_css_path:\n settings['stylesheet_path'] = self.config.rest_css_path\n # this gives the whole document\n html = docutils.core.publish_string(\n c, writer_name='html', settings_overrides=settings)\n # publish_parts(\"*anurag*\",writer_name='html')['body']\n # gives just the desired part of the tree\n\n else:\n html = \"<p>python docutils not installed, required for rendering reST to HTML.</p>\"\n html += \"<p>Please install with \\\"pip install docutils\\\".</p>\"\n\n # create filename based on key\n fn = os.path.join(self.config.db_path, key + '_rest.html')\n f = codecs.open(fn, mode='wb', encoding='utf-8')\n\n # explicit decode from utf8 into unicode object. If we don't\n # specify utf8, python falls back to default ascii and then we get\n # \"'ascii' codec can't decode byte\" error\n s = u\"\"\"\n%s\n \"\"\" % (unicode(html, 'utf8'),)\n\n f.write(s)\n f.close()\n return fn", "metadata": "root.Controller.helper_rest_to_html", "header": "['class', 'Controller', ':', '___EOS___']", "index": 428 }, { "content": " def observer_view_markdown(self, view, evt_type, evt):\n fn = self.helper_markdown_to_html()\n # turn filename into URI (mac wants this)\n fn_uri = 'file://' + os.path.abspath(fn)\n webbrowser.open(fn_uri)", "metadata": "root.Controller.observer_view_markdown", "header": "['class', 'Controller', ':', '___EOS___']", "index": 461 }, { "content": " def observer_view_rest(self, view, evt_type, evt):\n fn = self.helper_rest_to_html()\n # turn filename into URI (mac wants this)\n fn_uri = 'file://' + os.path.abspath(fn)\n webbrowser.open(fn_uri)", "metadata": "root.Controller.observer_view_rest", "header": "['class', 'Controller', ':', '___EOS___']", "index": 467 }, { "content": " def helper_save_sync_msg(self):\n\n # Saving 2 notes. Syncing 3 notes, waiting for simplenote server.\n # All notes saved. All notes synced.\n\n saven = self.notes_db.get_save_queue_len()\n\n if self.config.simplenote_sync:\n syncn = self.notes_db.get_sync_queue_len()\n wfsn = self.notes_db.waiting_for_simplenote\n else:\n syncn = wfsn = 0\n\n savet = 'Saving %d notes.' % (saven,) if saven > 0 else ''\n synct = 'Waiting to sync %d notes.' % (syncn,) if syncn > 0 else ''\n wfsnt = 'Syncing with simplenote server.' if wfsn else ''\n\n return ' '.join([i for i in [savet, synct, wfsnt] if i])", "metadata": "root.Controller.helper_save_sync_msg", "header": "['class', 'Controller', ':', '___EOS___']", "index": 473 }, { "content": " def observer_view_keep_house(self, view, evt_type, evt):\n # queue up all notes that need to be saved\n nsaved = self.notes_db.save_threaded()\n msg = self.helper_save_sync_msg()\n\n if self.config.simplenote_sync:\n nsynced, sync_errors = self.notes_db.sync_to_server_threaded()\n if sync_errors:\n msg = ' '.join([i for i in [msg, 'Could not connect to simplenote server.'] if i])\n\n self.view.set_status_text(msg)\n\n # in continous rendering mode, we also generate a new HTML\n # the browser, if open, will refresh!\n if self.view.get_continuous_rendering():\n self.helper_markdown_to_html()", "metadata": "root.Controller.observer_view_keep_house", "header": "['class', 'Controller', ':', '___EOS___']", "index": 492 }, { "content": " def observer_view_select_note(self, view, evt_type, evt):\n self.select_note(evt.sel)", "metadata": "root.Controller.observer_view_select_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 509 }, { "content": " def observer_view_sync_current_note(self, view, evt_type, evt):\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n # this call will update our in-memory version if necessary\n ret = self.notes_db.sync_note_unthreaded(key)\n if ret and ret[1] == True:\n self.view.update_selected_note_data(\n self.notes_db.notes[key])\n self.view.set_status_text(\n 'Synced updated note from server.')\n\n elif ret[1] == False:\n self.view.set_status_text(\n 'Server had nothing newer for this note.')\n\n elif ret is None:\n self.view.set_status_text(\n 'Unable to sync with server. Offline?')", "metadata": "root.Controller.observer_view_sync_current_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 512 }, { "content": " def observer_view_change_cs(self, view, evt_type, evt):\n # evt.value is the new value\n # only do something if user has really toggled\n if evt.value != self.config.case_sensitive:\n self.config.case_sensitive = evt.value\n self.view.refresh_notes_list()", "metadata": "root.Controller.observer_view_change_cs", "header": "['class', 'Controller', ':', '___EOS___']", "index": 531 }, { "content": " def observer_view_change_search_mode(self, view, evt_type, evt):\n if evt.value != self.config.search_mode:\n self.config.search_mode = evt.value\n self.view.refresh_notes_list()", "metadata": "root.Controller.observer_view_change_search_mode", "header": "['class', 'Controller', ':', '___EOS___']", "index": 538 }, { "content": " def observer_view_change_entry(self, view, evt_type, evt):\n # store the currently selected note key\n k = self.get_selected_note_key()\n # for each new evt.value coming in, get a new list from the notes_db\n # and set it in the notes_list_model\n nn, match_regexp, active_notes = self.notes_db.filter_notes(evt.value)\n self.notes_list_model.set_list(nn)\n self.notes_list_model.match_regexp = match_regexp\n self.view.set_note_tally(len(nn), active_notes, len(self.notes_db.notes))\n\n idx = self.notes_list_model.get_idx(k)\n\n if idx < 0:\n self.view.select_note(0)\n # the user is typing, but her previously selected note is\n # not in the new filtered list. as a convenience, we move\n # the text in the text widget so it's on the first\n # occurrence of the search string, IF there's such an\n # occurrence.\n self.view.see_first_search_instance()\n\n else:\n # we don't want new text to be implanted (YET) so we keep this silent\n # if it does turn out to be new note content, this will be handled\n # a few lines down.\n self.view.select_note(idx, silent=True)\n # but of course we DO have to record the possibly new IDX!!\n self.selected_note_idx = idx\n\n # see if the note has been updated (content, tags, pin)\n new_note = self.notes_db.get_note(k)\n\n # check if the currently selected note is different from the one\n # currently being displayed. this could happen if a sync gets\n # a new note of the server to replace the currently displayed one.\n if self.view.is_note_different(new_note):\n logging.debug(\"Currently selected note %s replaced by newer from server.\" % (k,))\n # carefully update currently selected note\n # restore cursor position, search and link highlights\n self.view.update_selected_note_data(new_note)\n\n else:\n # we have a new search string, but did not make any text changes\n # so we have to update the search highlighting here. (usually\n # text changes trigger this)\n self.view.activate_search_string_highlights()", "metadata": "root.Controller.observer_view_change_entry", "header": "['class', 'Controller', ':', '___EOS___']", "index": 543 }, { "content": " def observer_view_change_text(self, view, evt_type, evt):\n # get new text and update our database\n # need local key of currently selected note for this\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n self.notes_db.set_note_content(key,\n self.view.get_text())", "metadata": "root.Controller.observer_view_change_text", "header": "['class', 'Controller', ':', '___EOS___']", "index": 590 }, { "content": " def observer_view_change_tags(self, view, evt_type, evt):\n # get new text and update our database\n # need local key of currently selected note for this\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n self.notes_db.set_note_tags(key, evt.value)\n self.view.cmd_notes_list_select()", "metadata": "root.Controller.observer_view_change_tags", "header": "['class', 'Controller', ':', '___EOS___']", "index": 598 }, { "content": " def observer_view_delete_tag(self, view, evt_type, evt):\n key = self.notes_list_model.list[self.selected_note_idx].key\n self.notes_db.delete_note_tag(key, evt.tag)\n self.view.cmd_notes_list_select()", "metadata": "root.Controller.observer_view_delete_tag", "header": "['class', 'Controller', ':', '___EOS___']", "index": 606 }, { "content": " def observer_view_add_tag(self, view, evt_type, evt):\n key = self.notes_list_model.list[self.selected_note_idx].key\n self.notes_db.add_note_tags(key, evt.tags)\n self.view.cmd_notes_list_select()\n self.view.tags_entry_var.set('')", "metadata": "root.Controller.observer_view_add_tag", "header": "['class', 'Controller', ':', '___EOS___']", "index": 611 }, { "content": " def observer_view_change_pinned(self, view, evt_type, evt):\n # get new text and update our database\n # need local key of currently selected note for this\n if self.selected_note_idx >= 0:\n key = self.notes_list_model.list[self.selected_note_idx].key\n self.notes_db.set_note_pinned(key, evt.value)", "metadata": "root.Controller.observer_view_change_pinned", "header": "['class', 'Controller', ':', '___EOS___']", "index": 617 }, { "content": " def observer_view_close(self, view, evt_type, evt):\n # check that everything has been saved and synced before exiting\n\n # first make sure all our queues are up to date\n self.notes_db.save_threaded()\n if self.config.simplenote_sync:\n self.notes_db.sync_to_server_threaded(wait_for_idle=False)\n syncn = self.notes_db.get_sync_queue_len()\n wfsn = self.notes_db.waiting_for_simplenote\n else:\n syncn = wfsn = 0\n\n # then check all queues\n saven = self.notes_db.get_save_queue_len()\n\n # if there's still something to do, warn the user.\n if saven or syncn or wfsn:\n msg = \"Are you sure you want to exit? I'm still busy: \" + self.helper_save_sync_msg()\n really_want_to_exit = self.view.askyesno(\"Confirm exit\", msg)\n\n if really_want_to_exit:\n self.view.close()\n\n else:\n self.view.close()", "metadata": "root.Controller.observer_view_close", "header": "['class', 'Controller', ':', '___EOS___']", "index": 624 }, { "content": " def observer_view_create_note(self, view, evt_type, evt):\n # create the note\n new_key = self.notes_db.create_note(evt.title)\n # clear the search entry, this should trigger a new list being returned\n self.view.set_search_entry_text('')\n # we should focus on our thingy\n idx = self.notes_list_model.get_idx(new_key)\n self.view.select_note(idx)", "metadata": "root.Controller.observer_view_create_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 650 }, { "content": " def select_note(self, idx):\n \"\"\"Called whenever user selects a different note via the UI.\n\n This sets all machinery in motion to put the now note's data in all\n the right places.\n\n @param idx:\n @return:\n \"\"\"\n if idx >= 0:\n key = self.notes_list_model.list[idx].key\n note = self.notes_db.get_note(key)\n # valid note, so note editing should be enabled\n self.view.set_note_editing(True)\n\n else:\n key = None\n note = None\n idx = -1\n # no note selected, so we clear the UI (and display a clear\n # message that no note is selected) and we disable note\n # editing controls.\n self.view.clear_note_ui()\n self.view.set_note_editing(False)\n\n self.selected_note_idx = idx\n\n # when we do this, we don't want the change:{text,tags,pinned} events\n # because those should only fire when they are changed through the UI\n self.view.mute_note_data_changes()\n self.view.set_note_data(note)\n if key:\n self.view.set_note_status(self.notes_db.get_note_status(key))\n\n self.view.unmute_note_data_changes()", "metadata": "root.Controller.select_note", "header": "['class', 'Controller', ':', '___EOS___']", "index": 659 }, { "content": " def sync_full(self):\n try:\n sync_from_server_errors = self.notes_db.sync_full()\n\n except SyncError, e:\n self.view.show_error('Sync error', e)\n except WriteError, e:\n emsg = \"Please check nvpy.log.\\n\" + str(e)\n self.view.show_error('Sync error', emsg)\n exit(1)\n\n else:\n # regenerate display list\n # reselect old selection\n # put cursor where it used to be.\n self.view.refresh_notes_list()\n\n if sync_from_server_errors > 0:\n self.view.show_error('Error syncing notes from server', 'Error syncing %d notes from server. Please check nvpy.log for details.' % (sync_from_server_errors,))", "metadata": "root.Controller.sync_full", "header": "['class', 'Controller', ':', '___EOS___']", "index": 695 }, { "content": "def main():\n # setup appdir\n if hasattr(sys, 'frozen') and sys.frozen:\n appdir, _ = os.path.split(sys.executable)\n\n else:\n dirname, _ = os.path.split(os.path.realpath(__file__))\n if dirname and dirname != os.curdir:\n appdir = dirname\n else:\n appdir = os.getcwd()\n\n # make sure it's the full path\n appdir_full_path = os.path.abspath(appdir)\n\n config = Config(appdir_full_path)\n\n controller = Controller(config)\n controller.main_loop()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 716 } ]
[ { "span": "import time", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 11 }, { "span": "from utils import KeyValueObject, SubjectMixin", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nv", "PY", ":", " ", "cross", "-", "platform", " ", "note", "-", "tak", "ing", " ", "app", " ", "with", " ", "simple", "note", " ", "sync", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "copyr", "ight", " ", "2012", " ", "by", " ", "Charl", " ", "P", ".", " ", "Bot", "ha", " ", "<", "cp", "bot", "ha", "@", "vx", "labs", ".", "com", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", " ", "BS", "D", " ", "license_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inspire", "d", " ", "by", " ", "notation", "al", " ", "velo", "city", " ", "and", " ", "nv", "ALT", ",", " ", "nei", "ther", " ", "of", " ", "whi", "ch", " ", "I", "'", "ve", " ", "used", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "Reso", "ph", "Not", "es", ",", " ", "whi", "ch", " ", "I", " ", "have", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "full", " ", "widt", "h", " ", "horizon", "tal", " ", "bar", " ", "at", " ", "top", " ", "to", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "left", " ", "column", " ", "with", " ", "current", " ", "results", ":", " ", "name", ",", " ", "mod", " ", "date", ",", " ", "summar", "y", ",", " ", "tags_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "right", " ", "column", " ", "with", " ", "text", " ", "of", " ", "currentl", "y", " ", "selecte", "d", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "typ", "ing", " ", "in", " ", "the", " ", "search", " ", "bar", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "press", " ", "enter", ":", " ", "foc", "us", " ", "jumps", " ", "to", " ", "note", " ", "if", " ", "ANY", "THI", "NG", " ", "is", " ", "selecte", "d", ".", " ", "if", " ", "not", "hing", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "selecte", "d", ",", " ", "enter", " ", "create", "s", " ", "a", " ", "new", " ", "note", " ", "with", " ", "the", " ", "current", " ", "string", " ", "as", " ", "its", " ", "name", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "esc", " ", "clear", "s", " ", "the", " ", "search", " ", "entry", ",", " ", "esc", " ", "again", " ", "jumps", " ", "to", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "up", " ", "and", " ", "down", " ", "change", "s", " ", "currentl", "y", " ", "selecte", "d", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "in", " ", "note", " ", "conten", " ", "area_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "esc", " ", "go", "es", " ", "back", " ", "to", " ", "note", "s", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "www", ".", "scri", "bd", ".", "com", "/", "doc", "/", "912", "779", "5", "2", "/", "Simple", "-", "Not", "e-", "API", "-", "v2", "-1", "-3_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "als", "o", " ", "has", " ", "a", " ", "sync", " ", "algo", "rit", "hm", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "finish", " ", "implement", "ing", " ", "search_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1.5", ".", " ", "think", " ", "abo", "ut", " ", "other", " ", "storage", " ", "formats", ".", " ", "What", " ", "if", " ", "we", " ", "want", " ", "to", " ", "store", " ", "more", "?", " ", "(", "cursor", " ", "position", " ", "and", " ", "so", " ", "on", ".", " ", "sql", "ite", "?)", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "note", " ", "editin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "a", ")", " ", "saving", " ", "to", " ", "disc", ":", " ", "remember", " ", "lmo", "difi", "ed", " ", "or", " ", "what", "ever", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "b", ")", " ", "sync", "ing", " ", "with", " ", "simple", "note_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "check", " ", "if", " ", "we", "'", "re", " ", "online_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "logging_", "._", "handlers_", "import_", "Rot", "ati", "ng", "File", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "note", "s", "\\u", "db_", "import_", "Not", "es", "DB_", ",_", "Sync", "Error_", ",_", "Read", "Error_", ",_", "Write", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "argparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "utils_", "import_", "Key", "Value", "Object_", ",_", "Sub", "ject", "Mixin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "view_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "webbrowser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "markdown_", "\\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 ", " _", "HA", "VE", "\\u", "MARK", "DOWN_", "=_", "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 ", " _", "HA", "VE", "\\u", "MARK", "DOWN_", "=_", "True_", "\\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_", "docutils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "docutils_", "._", "core_", "\\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 ", " _", "HA", "VE", "\\u", "DOC", "UTIL", "S_", "=_", "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 ", " _", "HA", "VE", "\\u", "DOC", "UTIL", "S_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "VERSION_", "=_", "\"", "1.0", ".0", " ", "BET", "A2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "files", "\\u", "read", ":", " ", "list", " ", "of", " ", "config", " ", "files", " ", "tha", "t", " ", "wer", "e", " ", "parsed", ".", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "ok", ":", " ", "Tru", "e", " ", "if", " ", "config", " ", "files", " ", "had", " ", "a", " ", "default", " ", "section", ",", " ", "Fal", "se", " ", "other", "wis", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Config_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "app", "\\u", "dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "app", "\\u", "dir", ":", " ", "the", " ", "director", "y", " ", "contain", "ing", " ", "nvp", "y", ".", "py", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "app", "\\u", "dir_", "=_", "app", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "cross", "-", "platform", " ", "way", " ", "of", " ", "getti", "ng", " ", "home", " ", "dir", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "402", "894", "3", "/", "532", "513", "_", "\\u\\u\\uNL\\u\\u\\u_", "home_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "'~'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "=_", "{_", "'", "app", "\\u", "dir", "'_", ":_", "app", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "appd", "ir", "'_", ":_", "app", "\\u", "dir_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "home", "'_", ":_", "home_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "s", "\\u", "as", "\\u", "txt", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "house", "keep", "ing", "\\u", "interval", "'_", ":_", "'", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "mode", "'_", ":_", "'", "gst", "yle", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "case", "\\u", "sensi", "tiv", "e", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "search", "\\u", "tags", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sort", "\\u", "mode", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pinned", "\\u", "onto", "p", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "db", "\\u", "path", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'.", "nvp", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "txt", "\\u", "path", "'_", ":_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'.", "nvp", "y", "/", "note", "s", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "them", "e", "'_", ":_", "'", "default", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "font", "\\u", "famil", "y", "'_", ":_", "'", "Cour", "ier", "'_", ",_", "#", " ", "monospace", "d", " ", "on", " ", "all", " ", "platforms_", "\\u\\u\\uNL\\u\\u\\u_", "'", "font", "\\u", "size", "'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "font", "\\u", "famil", "y", "'_", ":_", "'", "Hel", "vet", "ica", "'_", ",_", "#", " ", "san", "s", " ", "on", " ", "all", " ", "platforms_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "font", "\\u", "famil", "y", "\\u", "fixed", "'_", ":_", "'", "Cour", "ier", "'_", ",_", "#", " ", "monospace", " ", "on", " ", "all", " ", "platforms_", "\\u\\u\\uNL\\u\\u\\u_", "'", "list", "\\u", "font", "\\u", "size", "'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "layout", "'_", ":_", "'", "horizon", "tal", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "print", "\\u", "column", "s", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "background", "\\u", "color", "'_", ":_", "'", "white", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sn", "\\u", "user", "name", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sn", "\\u", "password", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "simple", "note", "\\u", "sync", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "debug", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "File", "name", " ", "or", " ", "filepath", " ", "to", " ", "a", " ", "css", " ", "file", " ", "used", " ", "style", " ", "the", " ", "rendered_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ";", " ", "e", ".", "g", ".", " ", "nvp", "y", ".", "css", " ", "or", " ", "/", "path", "/", "to", "/", "my", ".", "css_", "\\u\\u\\uNL\\u\\u\\u_", "'", "rest", "\\u", "css", "\\u", "path", "'_", ":_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "command", "-", "line", " ", "arguments_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "self_", "._", "parse", "\\u", "cmd", "\\u", "line", "\\u", "opts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "late", "r", " ", "config", " ", "files", " ", "overwrit", "e", " ", "ear", "lie", "r", " ", "files_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "a", " ", "number", " ", "of", " ", "alternatives", "_", "\\u\\u\\uNL\\u\\u\\u_", "cfg", "\\u", "files_", "=_", "[_", "os_", "._", "path_", "._", "join_", "(_", "app", "\\u", "dir_", ",_", "'", "nvp", "y", ".", "cfg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'", "nvp", "y", ".", "cfg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'.", "nvp", "y", ".", "cfg", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'.", "nvp", "y", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "'.", "nvp", "yr", "c", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "user", " ", "has", " ", "specified", " ", "eit", "her", " ", "a", " ", "specific", " ", "path", " ", "to", " ", "a", " ", "CF", "G", " ", "file", ",", " ", "or", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "path", " ", "relative", " ", "to", " ", "the", " ", "nvp", "y", ".", "py", " ", "location", ".", " ", "specific", " ", "take", "s", " ", "preceden", "ce", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "args_", "is_", "not_", "None_", "and_", "args_", "._", "cfg_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cfg", "\\u", "files_", "._", "extend_", "(_", "[_", "os_", "._", "path_", "._", "join_", "(_", "app", "\\u", "dir_", ",_", "args_", "._", "cfg_", ")_", ",_", "args_", "._", "cfg_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cp_", "=_", "Config", "Parser_", "._", "Safe", "Config", "Parser_", "(_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "files", "\\u", "read_", "=_", "cp_", "._", "read_", "(_", "cfg", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cfg", "\\u", "sec_", "=_", "'", "nvp", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cp_", "._", "has", "\\u", "section_", "(_", "cfg", "\\u", "sec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cp_", "._", "add", "\\u", "section_", "(_", "cfg", "\\u", "sec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ok_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ok_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "user", "name", " ", "and", " ", "password", ",", " ", "we", " ", "don", "'", "t", " ", "want", " ", "interpolati", "on", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hen", "ce", " ", "the", " ", "raw", " ", "parameter", ".", " ", "Fix", "es_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "https", "://", "git", "hub", ".", "com", "/", "cp", "bot", "ha", "/", "nvp", "y", "/", "issue", "s", "/", "9_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "sn", "\\u", "username_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "sn", "\\u", "user", "name", "'_", ",_", "raw_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sn", "\\u", "password_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "sn", "\\u", "password", "'_", ",_", "raw_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "simple", "note", "\\u", "sync_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "simple", "note", "\\u", "sync", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "logic", " ", "to", " ", "find", " ", "in", " ", "$", "HOM", "E", " ", "if", " ", "not", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "db", "\\u", "path_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "db", "\\u", "path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", "0", " ", "=", " ", "alpha", " ", "sort", ",", " ", "1", " ", "=", " ", "last", " ", "modifi", "ed", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "as", "\\u", "txt_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "note", "s", "\\u", "as", "\\u", "txt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "txt", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "home_", ",_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "txt", "\\u", "path", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "search", "\\u", "mode_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "search", "\\u", "mode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "case", "\\u", "sensitive_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "case", "\\u", "sensi", "tiv", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "search", "\\u", "tags_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "search", "\\u", "tags", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sort", "\\u", "mode_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "sort", "\\u", "mode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "pinned", "\\u", "onto", "p_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "pinned", "\\u", "onto", "p", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "house", "keep", "ing", "\\u", "interval_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "house", "keep", "ing", "\\u", "interval", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "house", "keep", "ing", "\\u", "interval", "\\u", "ms_", "=_", "self_", "._", "house", "keep", "ing", "\\u", "interval_", "*_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "theme_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "them", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "font", "\\u", "family_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "font", "\\u", "famil", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "font", "\\u", "size_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "font", "\\u", "size", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "list", "\\u", "font", "\\u", "family_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "list", "\\u", "font", "\\u", "famil", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "\\u", "font", "\\u", "famil", "y", "\\u", "fixed_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "list", "\\u", "font", "\\u", "famil", "y", "\\u", "fixed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "list", "\\u", "font", "\\u", "size_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "list", "\\u", "font", "\\u", "size", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "layout_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "layout", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "print", "\\u", "columns_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "print", "\\u", "column", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "background", "\\u", "color_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "background", "\\u", "color", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rest", "\\u", "css", "\\u", "path_", "=_", "cp_", "._", "get_", "(_", "cfg", "\\u", "sec_", ",_", "'", "rest", "\\u", "css", "\\u", "path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "debug_", "=_", "cp_", "._", "getint_", "(_", "cfg", "\\u", "sec_", ",_", "'", "debug", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Config_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "cmd", "\\u", "line", "\\u", "opts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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 ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "cfg", "'_", ",_", "'-", "c", "'_", ",_", "default_", "=_", "''_", ",_", "dest_", "=_", "'", "cfg", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metavar_", "=_", "'", "nvp", "y", ".", "cfg", "'_", ",_", "help_", "=_", "'", "path", " ", "to", " ", "config", " ", "file", "'_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Not", "es", "List", "Model_", "(_", "Sub", "ject", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "@", "ivar", " ", "list", ":", " ", "List", " ", "of", " ", "(", "str", " ", "key", ",", " ", "dict", " ", "note", ")", " ", "object", "s", ".", "\\", "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_", "[SEP]_", "class_", "Not", "es", "List", "Model_", "(_", "Sub", "ject", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "call", " ", "mix", "in", " ", "ctor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Sub", "ject", "Mixin_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "match", "\\u", "regexp", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Not", "es", "List", "Model_", "(_", "Sub", "ject", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "list_", "(_", "self_", ",_", "alist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "list_", "=_", "alist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "notif", "y", "\\u", "observers_", "(_", "'", "set", ":", "list", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Not", "es", "List", "Model_", "(_", "Sub", "ject", "Mixin_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "idx_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "idx", " ", "for", " ", "pass", "ed", " ", "LOCAL", " ", "key", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "[_", "i_", "for_", "i_", ",_", "e_", "in_", "enumerate_", "(_", "self_", "._", "list_", ")_", "if_", "e_", "._", "key_", "==_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "found_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Controller_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Main", " ", "applica", "tion", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "config_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "shou", "ld", " ", "probab", "ly", " ", "als", "o", " ", "look", " ", "in", " ", "$", "HOME_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "=_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "._", "app", "\\u", "version_", "=_", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "configur", "e", " ", "logg", "ing", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "create", " ", "db", " ", "director", "y", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "exist", " ", "ye", "t", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "self_", "._", "config_", "._", "db", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "self_", "._", "config_", "._", "db", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log", "\\u", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "config_", "._", "db", "\\u", "path_", ",_", "'", "nvp", "y", ".", "log", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "file", " ", "will", " ", "get", " ", "nuk", "ed", " ", "whe", "n", " ", "it", " ", "reache", "s", " ", "100", "k", "B_", "\\u\\u\\uNL\\u\\u\\u_", "lha", "ndl", "er_", "=_", "Rot", "ati", "ng", "File", "Handler_", "(_", "log", "\\u", "filename_", ",_", "max", "Bytes_", "=_", "100000_", ",_", "backup", "Count_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lha", "ndl", "er_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lha", "ndl", "er_", "._", "set", "Formatter_", "(_", "logging_", "._", "Formatter_", "(_", "fmt_", "=_", "'%", "(", "asc", "time", ")", "s", " ", "-", " ", "%", "(", "level", "name", ")", "s", " ", "-", " ", "%", "(", "message", ")", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "get", " ", "the", " ", "root", " ", "logg", "er", " ", "and", " ", "configur", "e", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "debug_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "set", "Level_", "(_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "add", "Handler_", "(_", "lha", "ndl", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "will", " ", "go", " ", "to", " ", "the", " ", "root", " ", "logger_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "nvp", "y", " ", "logg", "ing", " ", "initialize", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "config", " ", "read", " ", "from", " ", "%", "s", "'_", "%_", "(_", "str_", "(_", "self_", "._", "config_", "._", "files", "\\u", "read_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "sn", "\\u", "username_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "css_", "=_", "self_", "._", "config_", "._", "rest", "\\u", "css", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "css_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "css_", "._", "startswith_", "(_", "\"~/", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", " ", "Mac", ",", " ", "path", "s", " ", "tha", "t", " ", "start", " ", "with", " ", "'", "~", "/'", " ", "are", "n", "'", "t", " ", "found", " ", "by", " ", "path", ".", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "css_", "=_", "css_", "._", "replace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"~\"_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "os_", "._", "path_", "._", "expanduser_", "(_", "'~'_", ")_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "config_", "._", "rest", "\\u", "css", "\\u", "path_", "=_", "css_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "css_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cou", "ld", "n", "'", "t", " ", "find", " ", "the", " ", "user", "-", "defin", "ed", " ", "css", " ", "file", ".", " ", "Us", "e", " ", "docu", "til", "s", " ", "css", " ", "inst", "ead", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "rest", "\\u", "css", "\\u", "path_", "=_", "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_", "._", "note", "s", "\\u", "list", "\\u", "model_", "=_", "Not", "es", "List", "Model_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "interface_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "=_", "view_", "._", "View_", "(_", "self_", "._", "config_", ",_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "read", " ", "our", " ", "databa", "se", " ", "of", " ", "note", "s", " ", "int", "o", " ", "memory_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "sync", " ", "with", " ", "simple", "note", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "note", "s", "\\u", "db_", "=_", "Not", "es", "DB_", "(_", "self_", "._", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Read", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ems", "g_", "=_", "\"", "Ple", "ase", " ", "check", " ", "nvp", "y", ".", "log", ".\\\\", "n", "\"_", "+_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "show", "\\u", "error_", "(_", "'", "Sync", " ", "error", "'_", ",_", "ems", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "add", "\\u", "observer_", "(_", "'", "synced", ":", "note", "'_", ",_", "self_", "._", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "synced", "\\u", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "note", "-", "status", "'_", ",_", "self_", "._", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "change", "\\u", "note", "\\u", "status_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "note", "s", "\\u", "db_", "._", "add", "\\u", "observer_", "(_", "'", "progress", ":", "sync", "\\u", "full", "'_", ",_", "self_", "._", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "sync", "\\u", "full_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sync", "\\u", "full_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "want", " ", "to", " ", "be", " ", "notified", " ", "whe", "n", " ", "the", " ", "user", " ", "doe", "s", " ", "stuff_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "click", ":", "note", "link", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "observer", "\\u", "view", "\\u", "click", "\\u", "note", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "delete", ":", "note", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "delete", "\\u", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "select", ":", "note", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "select", "\\u", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "entry", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "change", "\\u", "entry_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "text", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "change", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "pinned", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "change", "\\u", "pinned", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "create", ":", "note", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "create", "\\u", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "keep", ":", "house", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "keep", "\\u", "house_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "command", ":", "mark", "down", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "markdown_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "command", ":", "rest", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "rest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "delete", ":", "tag", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "delete", "\\u", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "add", ":", "tag", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "add", "\\u", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "command", ":", "sync", "\\u", "full", "'_", ",_", "lambda_", "v_", ",_", "et_", ",_", "e_", ":_", "self_", "._", "sync", "\\u", "full_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "command", ":", "sync", "\\u", "current", "\\u", "note", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "sync", "\\u", "current", "\\u", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "close", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "close_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "setup", " ", "UI", " ", "to", " ", "reflect", " ", "our", " ", "search", " ", "mode", " ", "and", " ", "case", " ", "sensitivity", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "cs_", "(_", "self_", "._", "config_", "._", "case", "\\u", "sensitive_", ",_", "silent_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "search", "\\u", "mode_", "(_", "self_", "._", "config_", "._", "search", "\\u", "mode_", ",_", "silent_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "cs", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "change", "\\u", "cs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "add", "\\u", "observer_", "(_", "'", "change", ":", "search", "\\u", "mode", "'_", ",_", "self_", "._", "observer", "\\u", "view", "\\u", "change", "\\u", "search", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "nn", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "key", ",", " ", "note", ")", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "nn_", ",_", "match", "\\u", "regexp_", ",_", "active", "\\u", "notes_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "filter", "\\u", "notes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "will", " ", "trigger", " ", "the", " ", "list", "\\u", "change", " ", "event_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "set\\u", "list_", "(_", "nn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "match", "\\u", "regexp_", "=_", "match", "\\u", "regexp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "tally", "_", "(_", "len_", "(_", "nn_", ")_", ",_", "active", "\\u", "notes_", ",_", "len_", "(_", "self_", "._", "note", "s", "\\u", "db_", "._", "notes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", "'", "ll", " ", "use", " ", "this", " ", "to", " ", "keep", " ", "track", " ", "of", " ", "the", " ", "currentl", "y", " ", "selecte", "d", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "only", " ", "use", " ", "idx", ",", " ", "bec", "aus", "e", " ", "key", " ", "coul", "d", " ", "change", " ", "from", " ", "right", " ", "under", " ", "us", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "select", "\\u", "note_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "selecte", "d\\u", "note", "\\u", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main", "\\u", "loop_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "config_", "._", "files", "\\u", "read_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "show", "\\u", "warning_", "(_", "'", "No", " ", "config", " ", "file", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Cou", "ld", " ", "not", " ", "read", " ", "any", " ", "configura", "tion", " ", "files", ".", " ", "See", " ", "https", "://", "git", "hub", ".", "com", "/", "cp", "bot", "ha", "/", "nvp", "y", " ", "for", " ", "deta", "il", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "self_", "._", "config_", "._", "ok_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wms", "g_", "=_", "(_", "'", "Ple", "ase", " ", "rename", " ", "[", "default", "]", " ", "to", " ", "[", "nvp", "y", "]", " ", "in", " ", "%", "s", ".", " ", "'_", "+_", "'", "Config", " ", "file", " ", "format", " ", "change", "d", " ", "after", " ", "nv", "PY", " ", "0.", "8", ".'_", ")_", "%_", "(_", "str_", "(_", "self_", "._", "config_", "._", "files", "\\u", "read_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "show", "\\u", "warning_", "(_", "'", "Rename", " ", "config", " ", "section", "'_", ",_", "wms", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "view_", "._", "main", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "change", "\\u", "note", "\\u", "status_", "(_", "self_", ",_", "note", "s", "\\u", "db_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "skey", "_", "=_", "self_", "._", "get", "\\u", "selecte", "d\\u", "note", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "skey", "_", "==_", "evt_", "._", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "status_", "(_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note", "\\u", "status_", "(_", "skey", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "sync", "\\u", "full_", "(_", "self_", ",_", "note", "s", "\\u", "db_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "evt_", "._", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "evt_", "._", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "note", "s", "\\u", "db", "\\u", "synced", "\\u", "note_", "(_", "self_", ",_", "note", "s", "\\u", "db_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thi", "s", " ", "observer", " ", "gets", " ", "call", "ed", " ", "only", " ", "whe", "n", " ", "a", " ", "note", " ", "return", "s", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "sync", " ", "tha", "t", "'", "s", " ", "more", " ", "recent", " ", "than", " ", "our", " ", "most", " ", "recent", " ", "mod", " ", "to", " ", "tha", "t", " ", "note", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "selecte", "d\\u", "note", "\\u", "o_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "note", " ", "synced", " ", "back", " ", "matche", "s", " ", "our", " ", "currentl", "y", " ", "selecte", "d", " ", "note", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "overwrit", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "selecte", "d\\u", "note", "\\u", "o_", "._", "key_", "==_", "evt_", "._", "lke", "y_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "selecte", "d\\u", "note", "\\u", "o_", "._", "note_", "[_", "'", "content", "'_", "]_", "!=_", "evt_", "._", "old", "\\u", "note_", "[_", "'", "content", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "mute", "\\u", "note", "\\u", "data\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "in", " ", "this", " ", "case", ",", " ", "we", " ", "want", " ", "to", " ", "keep", " ", "the", " ", "user", "'", "s", " ", "undo", " ", "buffer", " ", "so", " ", "tha", "t", " ", "the", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "can", " ", "undo", " ", "synced", " ", "back", " ", "change", "s", " ", "if", " ", "the", "y", " ", "wou", "ld", " ", "want", " ", "to", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "data_", "(_", "selecte", "d\\u", "note", "\\u", "o_", "._", "note_", ",_", "reset", "\\u", "undo_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "unm", "ute", "\\u", "note", "\\u", "data\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "click", "\\u", "note", "link_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "note", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "note", "\\u", "name", " ", "in", " ", "titles", ",", " ", "try", " ", "to", " ", "jump", " ", "to", " ", "tha", "t", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "not", " ", "in", " ", "current", " ", "list", ",", " ", "change", " ", "search", " ", "string", " ", "in", " ", "case_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", "'", "s", " ", "some", "where", " ", "else_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "implement", " ", "find", "\\u", "note", "\\u", "by", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "idx_", "=_", "self_", "._", "view_", "._", "select", "\\u", "note", "\\u", "by", "\\u", "name_", "(_", "note", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "idx_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "means", " ", "a", " ", "note", " ", "with", " ", "tha", "t", " ", "name", " ", "was", " ", "not", " ", "found_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "nvp", "y", " ", "kick", "s", " ", "ass", ",", " ", "it", " ", "then", " ", "assume", "s", " ", "the", " ", "content", "s", " ", "of", " ", "[[", "]]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "a", " ", "new", " ", "regular", " ", "express", "ion", " ", "to", " ", "search", " ", "for", " ", "in", " ", "the", " ", "note", "s", " ", "db", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "set\\u", "search", "\\u", "entry", "\\u", "text_", "(_", "note", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "delete", "\\u", "note_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete", " ", "note", " ", "from", " ", "note", "s", "\\u", "db_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "remove", " ", "the", " ", "note", " ", "from", " ", "the", " ", "note", "s", "\\u", "list", "\\u", "model", ".", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "these", " ", "two", " ", "are", " ", "not", " ", "equal", ",", " ", "somet", "hing", " ", "is", " ", "not", " ", "ko", "sher", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "(_", "evt_", "._", "sel_", "==_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "get", " ", "key", " ", "of", " ", "note", " ", "tha", "t", " ", "is", " ", "to", " ", "be", " ", "deleted_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "self_", "._", "get", "\\u", "selecte", "d\\u", "note", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "try", " ", "to", " ", "select", " ", "after", " ", "the", " ", "one", " ", "tha", "t", " ", "is", " ", "to", " ", "be", " ", "deleted_", "\\u\\u\\uNL\\u\\u\\u_", "nid", "x_", "=_", "evt_", "._", "sel_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "nid", "x_", ">=_", "0_", "and_", "nid", "x_", "<_", "self_", "._", "view_", "._", "get", "\\u", "number", "\\u", "of", "\\u", "notes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "select", "\\u", "note_", "(_", "nid", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "final", "ly", " ", "delete", " ", "the", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "delete", "\\u", "note_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "easi", "est", " ", "now", " ", "is", " ", "just", " ", "to", " ", "regenerate", " ", "the", " ", "list", " ", "by", " ", "reset", "ting", " ", "search", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "note", " ", "after", " ", "the", " ", "delete", "d", " ", "one", " ", "is", " ", "alr", "ead", "y", " ", "selecte", "d", ",", " ", "this", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "simp", "ly", " ", "keep", " ", "tha", "t", " ", "selection", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "search", "\\u", "entry", "\\u", "text_", "(_", "self_", "._", "view_", "._", "get", "\\u", "search", "\\u", "entry", "\\u", "text_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "help", "er", "\\u", "mark", "down", "\\u", "to", "\\u", "html_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note", "\\u", "content_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "Tr", "ying", " ", "to", " ", "convert", " ", "%", "s", " ", "to", " ", "html", ".\"_", "%_", "(_", "key_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "HA", "VE", "\\u", "MARK", "DOWN_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "Convert", " ", "note", " ", "%", "s", " ", "to", " ", "html", ".\"_", "%_", "(_", "key_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "=_", "markdown_", "._", "markdown_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "Convert", " ", "don", "e", ".\"_", ")_", "\\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 ", " _", "logging_", "._", "debug_", "(_", "\"", "Markdown", " ", "not", " ", "install", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "=_", "\"<", "p", ">", "python", " ", "mark", "down", " ", "not", " ", "install", "ed", ",", " ", "require", "d", " ", "for", " ", "render", "ing", " ", "to", " ", "HTM", "L", ".", "</", "p", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "+=_", "\"<", "p", ">", "Ple", "ase", " ", "install", " ", "with", " ", "\\\\\"", "pip", " ", "install", " ", "mark", "down", "\\\\\".", "</", "p", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "filename", " ", "based", " ", "on", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "config_", "._", "db", "\\u", "path_", ",_", "key_", "+_", "'.", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "codecs_", "._", "open_", "(_", "fn_", ",_", "mode_", "=_", "'", "wb", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "u", "\"\"\"", "\\", "10", ";<", "html", ">", "\\", "10", ";<", "head", ">", "\\", "10", ";<", "meta", " ", "http", "-", "equiv", "=\"", "Conten", "t", "-", "Type", "\"", " ", "content", "=\"", "text", "/", "html", ";", " ", "charset", "=", "UT", "F", "-", "8", "\"/>", "\\", "10", ";", "%", "s", "\\", "10", ";<", "/", "head", ">", "\\", "10", ";<", "body", ">", "\\", "10", ";", "%", "s", "\\", "10", ";<", "/", "body", ">", "\\", "10", ";<", "/", "html", ">", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "'<", "meta", " ", "http", "-", "equiv", "=\"", "refre", "sh", "\"", " ", "content", "=\"", "5", "\">'_", "if_", "self_", "._", "view_", "._", "get", "\\u", "continuous", "\\u", "render", "ing_", "(_", ")_", "else_", "\"\"_", ",_", "html_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "help", "er", "\\u", "rest", "\\u", "to", "\\u", "html_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note", "\\u", "content_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "HA", "VE", "\\u", "DOC", "UTIL", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "rest", "\\u", "css", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "settings_", "[_", "'", "stylesheet", "\\u", "path", "'_", "]_", "=_", "self_", "._", "config_", "._", "rest", "\\u", "css", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "give", "s", " ", "the", " ", "whole", " ", "document_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "html_", "=_", "docutils_", "._", "core_", "._", "publi", "sh", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "writer", "\\u", "name_", "=_", "'", "html", "'_", ",_", "settings", "\\u", "overrides_", "=_", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "publi", "sh", "\\u", "part", "s", "(\"", "*", "anu", "rag", "*\"", ",", "writer", "\\u", "name", "='", "html", "')", "['", "body", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", "s", " ", "just", " ", "the", " ", "desi", "red", " ", "part", " ", "of", " ", "the", " ", "tree_", "\\u\\u\\uNL\\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 ", " _", "html_", "=_", "\"<", "p", ">", "python", " ", "docu", "til", "s", " ", "not", " ", "install", "ed", ",", " ", "require", "d", " ", "for", " ", "render", "ing", " ", "re", "ST", " ", "to", " ", "HTM", "L", ".", "</", "p", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "+=_", "\"<", "p", ">", "Ple", "ase", " ", "install", " ", "with", " ", "\\\\\"", "pip", " ", "install", " ", "docu", "til", "s", "\\\\\".", "</", "p", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "filename", " ", "based", " ", "on", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fn_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "config_", "._", "db", "\\u", "path_", ",_", "key_", "+_", "'\\u", "rest", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "codecs_", "._", "open_", "(_", "fn_", ",_", "mode_", "=_", "'", "wb", "'_", ",_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", " ", "decode", " ", "from", " ", "utf", "8", " ", "int", "o", " ", "unicode", " ", "object", ".", " ", "If", " ", "we", " ", "don", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "speci", "fy", " ", "utf", "8", ",", " ", "python", " ", "fall", "s", " ", "back", " ", "to", " ", "default", " ", "ascii", " ", "and", " ", "then", " ", "we", " ", "get_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"'", "ascii", "'", " ", "codec", " ", "can", "'", "t", " ", "decode", " ", "byte", "\"", " ", "error_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "u", "\"\"\"", "\\", "10", ";", "%", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "unicode_", "(_", "html_", ",_", "'", "utf", "8", "'_", ")_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "._", "write_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "fn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "markdown_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "self_", "._", "help", "er", "\\u", "mark", "down", "\\u", "to", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "turn", " ", "filename", " ", "int", "o", " ", "URI", " ", "(", "mac", " ", "want", "s", " ", "this", ")_", "\\u\\u\\uNL\\u\\u\\u_", "fn", "\\u", "uri_", "=_", "'", "file", "://'_", "+_", "os_", "._", "path_", "._", "abspath_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "webbrowser_", "._", "open_", "(_", "fn", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "rest_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fn_", "=_", "self_", "._", "help", "er", "\\u", "rest", "\\u", "to", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "turn", " ", "filename", " ", "int", "o", " ", "URI", " ", "(", "mac", " ", "want", "s", " ", "this", ")_", "\\u\\u\\uNL\\u\\u\\u_", "fn", "\\u", "uri_", "=_", "'", "file", "://'_", "+_", "os_", "._", "path_", "._", "abspath_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "webbrowser_", "._", "open_", "(_", "fn", "\\u", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "help", "er", "\\u", "save", "\\u", "sync", "\\u", "msg_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sav", "ing", " ", "2", " ", "note", "s", ".", " ", "Sync", "ing", " ", "3", " ", "note", "s", ",", " ", "wait", "ing", " ", "for", " ", "simple", "note", " ", "server", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "note", "s", " ", "saved", ".", " ", "All", " ", "note", "s", " ", "synced", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "save", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "save", "\\u", "queue", "\\u", "len_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sync", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "sync", "\\u", "queue", "\\u", "len_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wfs", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "wait", "ing", "\\u", "for", "\\u", "simple", "note_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sync", "n_", "=_", "wfs", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "save", "t_", "=_", "'", "Sav", "ing", " ", "%", "d", " ", "note", "s", ".'_", "%_", "(_", "save", "n_", ",_", ")_", "if_", "save", "n_", ">_", "0_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sync", "t_", "=_", "'", "Wait", "ing", " ", "to", " ", "sync", " ", "%", "d", " ", "note", "s", ".'_", "%_", "(_", "sync", "n_", ",_", ")_", "if_", "sync", "n_", ">_", "0_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wfs", "nt_", "=_", "'", "Sync", "ing", " ", "with", " ", "simple", "note", " ", "server", ".'_", "if_", "wfs", "n_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "'", " ", "'_", "._", "join_", "(_", "[_", "i_", "for_", "i_", "in_", "[_", "save", "t_", ",_", "sync", "t_", ",_", "wfs", "nt_", "]_", "if_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "keep", "\\u", "house_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "queue", " ", "up", " ", "all", " ", "note", "s", " ", "tha", "t", " ", "need", " ", "to", " ", "be", " ", "saved_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "nsa", "ved", "_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "save", "\\u", "threaded", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "self_", "._", "help", "er", "\\u", "save", "\\u", "sync", "\\u", "msg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "ync", "ed_", ",_", "sync", "\\u", "errors_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "sync", "\\u", "to", "\\u", "server", "\\u", "threaded", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sync", "\\u", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", " ", "'_", "._", "join_", "(_", "[_", "i_", "for_", "i_", "in_", "[_", "msg_", ",_", "'", "Cou", "ld", " ", "not", " ", "connect", " ", "to", " ", "simple", "note", " ", "server", ".'_", "]_", "if_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "conti", "nous", " ", "render", "ing", " ", "mode", ",", " ", "we", " ", "als", "o", " ", "generat", "e", " ", "a", " ", "new", " ", "HTML_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "browse", "r", ",", " ", "if", " ", "open", ",", " ", "will", " ", "refre", "sh", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "view_", "._", "get", "\\u", "continuous", "\\u", "render", "ing_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "help", "er", "\\u", "mark", "down", "\\u", "to", "\\u", "html_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "select", "\\u", "note_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "select", "\\u", "note_", "(_", "evt_", "._", "sel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "sync", "\\u", "current", "\\u", "note_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "call", " ", "will", " ", "update", " ", "our", " ", "in", "-", "memory", " ", "version", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "ret_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "sync", "\\u", "note", "\\u", "unt", "hread", "ed_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ret_", "and_", "ret_", "[_", "1_", "]_", "==_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "update", "\\u", "selecte", "d\\u", "note", "\\u", "data_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "notes_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sync", "ed", " ", "update", "d", " ", "note", " ", "from", " ", "server", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ret_", "[_", "1_", "]_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Server", " ", "had", " ", "not", "hing", " ", "newe", "r", " ", "for", " ", "this", " ", "note", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "ret_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "set\\u", "status", "\\u", "text_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Una", "ble", " ", "to", " ", "sync", " ", "with", " ", "server", ".", " ", "Off", "line", "?'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "cs_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "evt", ".", "value", " ", "is", " ", "the", " ", "new", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "only", " ", "do", " ", "somet", "hing", " ", "if", " ", "user", " ", "has", " ", "reall", "y", " ", "toggled_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "evt_", "._", "value_", "!=_", "self_", "._", "config_", "._", "case", "\\u", "sensitive_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "case", "\\u", "sensitive_", "=_", "evt_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "refre", "sh", "\\u", "note", "s", "\\u", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "search", "\\u", "mode_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "evt_", "._", "value_", "!=_", "self_", "._", "config_", "._", "search", "\\u", "mode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "config_", "._", "search", "\\u", "mode_", "=_", "evt_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "refre", "sh", "\\u", "note", "s", "\\u", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "entry_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "store", " ", "the", " ", "currentl", "y", " ", "selecte", "d", " ", "note", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k_", "=_", "self_", "._", "get", "\\u", "selecte", "d\\u", "note", "\\u", "key_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "each", " ", "new", " ", "evt", ".", "value", " ", "comi", "ng", " ", "in", ",", " ", "get", " ", "a", " ", "new", " ", "list", " ", "from", " ", "the", " ", "note", "s", "\\u", "db_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "set", " ", "it", " ", "in", " ", "the", " ", "note", "s", "\\u", "list", "\\u", "model_", "\\u\\u\\uNL\\u\\u\\u_", "nn_", ",_", "match", "\\u", "regexp_", ",_", "active", "\\u", "notes_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "filter", "\\u", "notes_", "(_", "evt_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "set\\u", "list_", "(_", "nn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "match", "\\u", "regexp_", "=_", "match", "\\u", "regexp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "tally", "_", "(_", "len_", "(_", "nn_", ")_", ",_", "active", "\\u", "notes_", ",_", "len_", "(_", "self_", "._", "note", "s", "\\u", "db_", "._", "notes_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "idx_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "get", "\\u", "idx_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "idx_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "select", "\\u", "note_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "user", " ", "is", " ", "typ", "ing", ",", " ", "but", " ", "her", " ", "previ", "ously", " ", "selecte", "d", " ", "note", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "in", " ", "the", " ", "new", " ", "filter", "ed", " ", "list", ".", " ", "as", " ", "a", " ", "convenien", "ce", ",", " ", "we", " ", "move_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "text", " ", "in", " ", "the", " ", "text", " ", "widget", " ", "so", " ", "it", "'", "s", " ", "on", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "occurrence", " ", "of", " ", "the", " ", "search", " ", "string", ",", " ", "IF", " ", "there", "'", "s", " ", "suc", "h", " ", "an_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "occurrence", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "see", "\\u", "first", "\\u", "search", "\\u", "instance_", "(_", ")_", "\\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_", "#", " ", "we", " ", "don", "'", "t", " ", "want", " ", "new", " ", "text", " ", "to", " ", "be", " ", "impl", "ante", "d", " ", "(", "YE", "T", ")", " ", "so", " ", "we", " ", "keep", " ", "this", " ", "silent_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "it", " ", "doe", "s", " ", "turn", " ", "out", " ", "to", " ", "be", " ", "new", " ", "note", " ", "content", ",", " ", "this", " ", "will", " ", "be", " ", "handled_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "few", " ", "lines", " ", "down", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "select", "\\u", "note_", "(_", "idx_", ",_", "silent_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "but", " ", "of", " ", "course", " ", "we", " ", "DO", " ", "have", " ", "to", " ", "record", " ", "the", " ", "possib", "ly", " ", "new", " ", "IDX", "!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "see", " ", "if", " ", "the", " ", "note", " ", "has", " ", "bee", "n", " ", "update", "d", " ", "(", "content", ",", " ", "tags", ",", " ", "pin", ")_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "note_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note_", "(_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "the", " ", "currentl", "y", " ", "selecte", "d", " ", "note", " ", "is", " ", "different", " ", "from", " ", "the", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "currentl", "y", " ", "bei", "ng", " ", "displaye", "d", ".", " ", "this", " ", "coul", "d", " ", "happ", "en", " ", "if", " ", "a", " ", "sync", " ", "gets", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "new", " ", "note", " ", "of", " ", "the", " ", "server", " ", "to", " ", "replace", " ", "the", " ", "currentl", "y", " ", "displaye", "d", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "view_", "._", "is", "\\u", "note", "\\u", "different", "_", "(_", "new", "\\u", "note_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "Curr", "ent", "ly", " ", "selecte", "d", " ", "note", " ", "%", "s", " ", "replaced", " ", "by", " ", "newe", "r", " ", "from", " ", "server", ".\"_", "%_", "(_", "k_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "care", "full", "y", " ", "update", " ", "currentl", "y", " ", "selecte", "d", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "restore", " ", "cursor", " ", "position", ",", " ", "search", " ", "and", " ", "link", " ", "highlight", "s_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "update", "\\u", "selecte", "d\\u", "note", "\\u", "data_", "(_", "new", "\\u", "note_", ")_", "\\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_", "#", " ", "we", " ", "have", " ", "a", " ", "new", " ", "search", " ", "string", ",", " ", "but", " ", "did", " ", "not", " ", "make", " ", "any", " ", "text", " ", "changes_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "we", " ", "have", " ", "to", " ", "update", " ", "the", " ", "search", " ", "highlight", "ing", " ", "here", ".", " ", "(", "usual", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "text", " ", "change", "s", " ", "trigger", " ", "this", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "activat", "e\\u", "search", "\\u", "string", "\\u", "highlight", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "text_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "new", " ", "text", " ", "and", " ", "update", " ", "our", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "local", " ", "key", " ", "of", " ", "currentl", "y", " ", "selecte", "d", " ", "note", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "set\\u", "note", "\\u", "content_", "(_", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "get", "\\u", "text_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "tags_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "new", " ", "text", " ", "and", " ", "update", " ", "our", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "local", " ", "key", " ", "of", " ", "currentl", "y", " ", "selecte", "d", " ", "note", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "set\\u", "note", "\\u", "tags_", "(_", "key_", ",_", "evt_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "cmd", "\\u", "note", "s", "\\u", "list", "\\u", "select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "delete", "\\u", "tag_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "delete", "\\u", "note", "\\u", "tag_", "(_", "key_", ",_", "evt_", "._", "tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "cmd", "\\u", "note", "s", "\\u", "list", "\\u", "select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "add", "\\u", "tag_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "add", "\\u", "note", "\\u", "tags_", "(_", "key_", ",_", "evt_", "._", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "cmd", "\\u", "note", "s", "\\u", "list", "\\u", "select_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "tags", "\\u", "entry", "\\u", "var_", "._", "set_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "change", "\\u", "pinned", "_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "new", " ", "text", " ", "and", " ", "update", " ", "our", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "local", " ", "key", " ", "of", " ", "currentl", "y", " ", "selecte", "d", " ", "note", " ", "for", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "note", "s", "\\u", "db_", "._", "set\\u", "note", "\\u", "pinned", "_", "(_", "key_", ",_", "evt_", "._", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "close_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "tha", "t", " ", "every", "thing", " ", "has", " ", "bee", "n", " ", "saved", " ", "and", " ", "synced", " ", "bef", "ore", " ", "exit", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "make", " ", "sure", " ", "all", " ", "our", " ", "queue", "s", " ", "are", " ", "up", " ", "to", " ", "date_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "note", "s", "\\u", "db_", "._", "save", "\\u", "threaded", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "simple", "note", "\\u", "sync_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "note", "s", "\\u", "db_", "._", "sync", "\\u", "to", "\\u", "server", "\\u", "threaded", "_", "(_", "wait", "\\u", "for", "\\u", "idle_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sync", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "sync", "\\u", "queue", "\\u", "len_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wfs", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "wait", "ing", "\\u", "for", "\\u", "simple", "note_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sync", "n_", "=_", "wfs", "n_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "check", " ", "all", " ", "queues_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "save", "n_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "save", "\\u", "queue", "\\u", "len_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "there", "'", "s", " ", "still", " ", "somet", "hing", " ", "to", " ", "do", ",", " ", "warn", " ", "the", " ", "user", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "save", "n_", "or_", "sync", "n_", "or_", "wfs", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Are", " ", "you", " ", "sure", " ", "you", " ", "want", " ", "to", " ", "exit", "?", " ", "I", "'", "m", " ", "still", " ", "bus", "y", ":", " ", "\"_", "+_", "self_", "._", "help", "er", "\\u", "save", "\\u", "sync", "\\u", "msg_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reall", "y", "\\u", "want", "\\u", "to", "\\u", "exit_", "=_", "self_", "._", "view_", "._", "ask", "yesno", "_", "(_", "\"", "Confirm", " ", "exit", "\"_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "reall", "y", "\\u", "want", "\\u", "to", "\\u", "exit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "observer", "\\u", "view", "\\u", "create", "\\u", "note_", "(_", "self_", ",_", "view_", ",_", "evt", "\\u", "type_", ",_", "evt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "key_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "create", "\\u", "note_", "(_", "evt_", "._", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "clear", " ", "the", " ", "search", " ", "entry", ",", " ", "this", " ", "shou", "ld", " ", "trigger", " ", "a", " ", "new", " ", "list", " ", "bei", "ng", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "search", "\\u", "entry", "\\u", "text_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "shou", "ld", " ", "foc", "us", " ", "on", " ", "our", " ", "thing", "y_", "\\u\\u\\uNL\\u\\u\\u_", "idx_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "get", "\\u", "idx_", "(_", "new", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "select", "\\u", "note_", "(_", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select", "\\u", "note_", "(_", "self_", ",_", "idx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Call", "ed", " ", "whe", "neve", "r", " ", "user", " ", "select", "s", " ", "a", " ", "different", " ", "note", " ", "via", " ", "the", " ", "UI", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "sets", " ", "all", " ", "machine", "ry", " ", "in", " ", "moti", "on", " ", "to", " ", "put", " ", "the", " ", "now", " ", "note", "'", "s", " ", "data", " ", "in", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "right", " ", "place", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "param", " ", "idx", ":", "\\", "10", ";", " ", " ", " ", " ", "@", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "idx_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "self_", "._", "note", "s", "\\u", "list", "\\u", "model_", "._", "list_", "[_", "idx_", "]_", "._", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "note_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "valid", " ", "note", ",", " ", "so", " ", "note", " ", "editin", "g", " ", "shou", "ld", " ", "be", " ", "enabled_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "editin", "g_", "(_", "True_", ")_", "\\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 ", " _", "key_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "note_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "note", " ", "selecte", "d", ",", " ", "so", " ", "we", " ", "clear", " ", "the", " ", "UI", " ", "(", "and", " ", "display", " ", "a", " ", "clear_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "message", " ", "tha", "t", " ", "no", " ", "note", " ", "is", " ", "selecte", "d", ")", " ", "and", " ", "we", " ", "disable", " ", "note_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "editin", "g", " ", "controls", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "clear", "\\u", "note", "\\u", "ui_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "editin", "g_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "selecte", "d\\u", "note", "\\u", "idx_", "=_", "idx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "we", " ", "do", " ", "this", ",", " ", "we", " ", "don", "'", "t", " ", "want", " ", "the", " ", "change", ":", "{", "text", ",", "tags", ",", "pinned", "}", " ", "events_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bec", "aus", "e", " ", "tho", "se", " ", "shou", "ld", " ", "only", " ", "fire", " ", "whe", "n", " ", "the", "y", " ", "are", " ", "change", "d", " ", "through", " ", "the", " ", "UI_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "view_", "._", "mute", "\\u", "note", "\\u", "data\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "data_", "(_", "note_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "set\\u", "note", "\\u", "status_", "(_", "self_", "._", "note", "s", "\\u", "db_", "._", "get", "\\u", "note", "\\u", "status_", "(_", "key_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "view_", "._", "unm", "ute", "\\u", "note", "\\u", "data\\u", "changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Controller_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sync", "\\u", "full_", "(_", "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 ", " _", "sync", "\\u", "from", "\\u", "server", "\\u", "errors_", "=_", "self_", "._", "note", "s", "\\u", "db_", "._", "sync", "\\u", "full_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Sync", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "show", "\\u", "error_", "(_", "'", "Sync", " ", "error", "'_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Write", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ems", "g_", "=_", "\"", "Ple", "ase", " ", "check", " ", "nvp", "y", ".", "log", ".\\\\", "n", "\"_", "+_", "str_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "view_", "._", "show", "\\u", "error_", "(_", "'", "Sync", " ", "error", "'_", ",_", "ems", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "regenerate", " ", "display", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rese", "lect", " ", "old", " ", "selection_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "cursor", " ", "where", " ", "it", " ", "used", " ", "to", " ", "be", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "refre", "sh", "\\u", "note", "s", "\\u", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sync", "\\u", "from", "\\u", "server", "\\u", "errors_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "view_", "._", "show", "\\u", "error_", "(_", "'", "Error", " ", "sync", "ing", " ", "note", "s", " ", "from", " ", "server", "'_", ",_", "'", "Error", " ", "sync", "ing", " ", "%", "d", " ", "note", "s", " ", "from", " ", "server", ".", " ", "Ple", "ase", " ", "check", " ", "nvp", "y", ".", "log", " ", "for", " ", "deta", "il", "s", ".'_", "%_", "(_", "sync", "\\u", "from", "\\u", "server", "\\u", "errors_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "appd", "ir_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "sys_", ",_", "'", "frozen", "'_", ")_", "and_", "sys_", "._", "frozen_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appd", "ir_", ",_", "\\u_", "=_", "os_", "._", "path_", "._", "split_", "(_", "sys_", "._", "executable_", ")_", "\\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 ", " _", "dirname_", ",_", "\\u_", "=_", "os_", "._", "path_", "._", "split_", "(_", "os_", "._", "path_", "._", "realpath_", "(_", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dirname_", "and_", "dirname_", "!=_", "os_", "._", "curdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appd", "ir_", "=_", "dirname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appd", "ir_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "full", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "appd", "ir", "\\u", "full", "\\u", "path_", "=_", "os_", "._", "path_", "._", "abspath_", "(_", "appd", "ir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "Config_", "(_", "appd", "ir", "\\u", "full", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "controller_", "=_", "Controller_", "(_", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "controller_", "._", "main", "\\u", "loop_", "(_", ")_", "\\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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
zzzeek/sqlalchemy/test/ext/test_serializer.py
[ { "content": "# coding: utf-8\n\nfrom sqlalchemy.ext import serializer\nfrom sqlalchemy import testing\nfrom sqlalchemy import Integer, String, ForeignKey, select, \\\n desc, func, util, MetaData, literal_column\nfrom sqlalchemy.testing.schema import Table\nfrom sqlalchemy.testing.schema import Column\nfrom sqlalchemy.orm import relationship, sessionmaker, scoped_session, \\\n class_mapper, mapper, joinedload, configure_mappers, aliased\nfrom sqlalchemy.testing import eq_, AssertsCompiledSQL\nfrom sqlalchemy.util import u, ue\n\nfrom sqlalchemy.testing import fixtures\n\n\n\nusers = addresses = Session = None\n\n\n\nif __name__ == '__main__':\n testing.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class User(fixtures.ComparableEntity):\n pass", "metadata": "root.User", "header": "['module', '___EOS___']", "index": 15 }, { "content": "class Address(fixtures.ComparableEntity):\n pass", "metadata": "root.Address", "header": "['module', '___EOS___']", "index": 18 }, { "content": "class SerializeTest(AssertsCompiledSQL, fixtures.MappedTest):\n\n run_setup_mappers = 'once'\n run_inserts = 'once'\n run_deletes = None\n\n\n\n\n\n\n\n\n\n\n\n # fails too often/randomly\n #@testing.requires.non_broken_pickle\n #def test_query_three(self):\n # ua = aliased(User)\n # q = \\\n # Session.query(ua).join(ua.addresses).\\\n # filter(Address.email.like('%fred%'))\n # q2 = serializer.loads(serializer.dumps(q, -1), users.metadata,\n # Session)\n # eq_(q2.all(), [User(name='fred')])\n #\n # try to pull out the aliased entity here...\n # ua_2 = q2._entities[0].entity_zero.entity\n # eq_(list(q2.values(ua_2.id, ua_2.name)), [(9, 'fred')])\n\n\n\n", "metadata": "root.SerializeTest", "header": "['module', '___EOS___']", "index": 23 }, { "content": " @classmethod\n def define_tables(cls, metadata):\n global users, addresses\n users = Table('users', metadata, Column('id', Integer,\n primary_key=True), Column('name', String(50)))\n addresses = Table('addresses', metadata, Column('id', Integer,\n primary_key=True), Column('email',\n String(50)), Column('user_id', Integer,\n ForeignKey('users.id')))", "metadata": "root.SerializeTest.define_tables", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 29 }, { "content": " @classmethod\n def setup_mappers(cls):\n global Session\n Session = scoped_session(sessionmaker())\n mapper(User, users, properties={'addresses'\n : relationship(Address, backref='user',\n order_by=addresses.c.id)})\n mapper(Address, addresses)\n configure_mappers()", "metadata": "root.SerializeTest.setup_mappers", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 39 }, { "content": " @classmethod\n def insert_data(cls):\n params = [dict(list(zip(('id', 'name'), column_values)))\n for column_values in [(7, 'jack'), (8, 'ed'), (9,\n 'fred'), (10, 'chuck')]]\n users.insert().execute(params)\n addresses.insert().execute([dict(list(zip(('id', 'user_id', 'email'\n ), column_values)))\n for column_values in [(1, 7,\n '[email protected]'), (2, 8,\n '[email protected]'), (3, 8,\n '[email protected]'), (4, 8,\n '[email protected]'), (5, 9,\n '[email protected]')]])", "metadata": "root.SerializeTest.insert_data", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 49 }, { "content": " def test_tables(self):\n assert serializer.loads(serializer.dumps(users, -1),\n users.metadata, Session) is users", "metadata": "root.SerializeTest.test_tables", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 64 }, { "content": " def test_columns(self):\n assert serializer.loads(serializer.dumps(users.c.name, -1),\n users.metadata, Session) is users.c.name", "metadata": "root.SerializeTest.test_columns", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 68 }, { "content": " def test_mapper(self):\n user_mapper = class_mapper(User)\n assert serializer.loads(serializer.dumps(user_mapper, -1),\n None, None) is user_mapper", "metadata": "root.SerializeTest.test_mapper", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 72 }, { "content": " def test_attribute(self):\n assert serializer.loads(serializer.dumps(User.name, -1), None,\n None) is User.name", "metadata": "root.SerializeTest.test_attribute", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 77 }, { "content": " def test_expression(self):\n expr = \\\n select([users]).select_from(users.join(addresses)).limit(5)\n re_expr = serializer.loads(serializer.dumps(expr, -1),\n users.metadata, None)\n eq_(str(expr), str(re_expr))\n assert re_expr.bind is testing.db\n eq_(re_expr.execute().fetchall(), [(7, 'jack'), (8, 'ed'),\n (8, 'ed'), (8, 'ed'), (9, 'fred')])", "metadata": "root.SerializeTest.test_expression", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 81 }, { "content": " def test_query_one(self):\n q = Session.query(User).\\\n filter(User.name == 'ed').\\\n options(joinedload(User.addresses))\n\n q2 = serializer.loads(\n serializer.dumps(q, -1),\n users.metadata, Session)\n def go():\n eq_(q2.all(), [\n User(name='ed', addresses=[Address(id=2),\n Address(id=3), Address(id=4)])])\n\n self.assert_sql_count(testing.db, go, 1)\n\n eq_(q2.join(User.addresses).filter(Address.email\n == '[email protected]').value(func.count(literal_column('*'))), 1)\n u1 = Session.query(User).get(8)\n q = Session.query(Address).filter(Address.user\n == u1).order_by(desc(Address.email))\n q2 = serializer.loads(serializer.dumps(q, -1), users.metadata,\n Session)\n eq_(q2.all(), [Address(email='[email protected]'),\n Address(email='[email protected]'),\n Address(email='[email protected]')])", "metadata": "root.SerializeTest.test_query_one", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 91 }, { "content": " @testing.requires.non_broken_pickle\n def test_query_two(self):\n q = \\\n Session.query(User).join(User.addresses).\\\n filter(Address.email.like('%fred%'))\n q2 = serializer.loads(serializer.dumps(q, -1), users.metadata,\n Session)\n eq_(q2.all(), [User(name='fred')])\n eq_(list(q2.values(User.id, User.name)), [(9, 'fred')])", "metadata": "root.SerializeTest.test_query_two", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 117 }, { "content": " @testing.requires.non_broken_pickle\n def test_orm_join(self):\n from sqlalchemy.orm.util import join\n\n j = join(User, Address, User.addresses)\n\n j2 = serializer.loads(serializer.dumps(j, -1), users.metadata)\n assert j2.left is j.left\n assert j2.right is j.right\n assert j2._target_adapter._next", "metadata": "root.SerializeTest.test_orm_join", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 142 }, { "content": " @testing.exclude('sqlite', '<=', (3, 5, 9),\n 'id comparison failing on the buildbot')\n def test_aliases(self):\n u7, u8, u9, u10 = Session.query(User).order_by(User.id).all()\n ualias = aliased(User)\n q = Session.query(User, ualias).join(ualias, User.id\n < ualias.id).filter(User.id < 9).order_by(User.id,\n ualias.id)\n eq_(list(q.all()), [(u7, u8), (u7, u9), (u7, u10), (u8, u9),\n (u8, u10)])\n q2 = serializer.loads(serializer.dumps(q, -1), users.metadata,\n Session)\n eq_(list(q2.all()), [(u7, u8), (u7, u9), (u7, u10), (u8, u9),\n (u8, u10)])", "metadata": "root.SerializeTest.test_aliases", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 153 }, { "content": " @testing.requires.non_broken_pickle\n def test_any(self):\n r = User.addresses.any(Address.email == 'x')\n ser = serializer.dumps(r, -1)\n x = serializer.loads(ser, users.metadata)\n eq_(str(r), str(x))", "metadata": "root.SerializeTest.test_any", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 168 }, { "content": " def test_unicode(self):\n m = MetaData()\n t = Table(ue('\\u6e2c\\u8a66'), m,\n Column(ue('\\u6e2c\\u8a66_id'), Integer))\n\n expr = select([t]).where(t.c[ue('\\u6e2c\\u8a66_id')] == 5)\n\n expr2 = serializer.loads(serializer.dumps(expr, -1), m)\n\n self.assert_compile(\n expr2,\n ue('SELECT \"\\u6e2c\\u8a66\".\"\\u6e2c\\u8a66_id\" FROM \"\\u6e2c\\u8a66\" '\n 'WHERE \"\\u6e2c\\u8a66\".\"\\u6e2c\\u8a66_id\" = :\\u6e2c\\u8a66_id_1'),\n dialect=\"default\"\n )", "metadata": "root.SerializeTest.test_unicode", "header": "['class', 'SerializeTest', '(', 'AssertsCompiledSQL', ',', 'fixtures', '.', 'MappedTest', ')', ':', '___EOS___']", "index": 175 } ]
[ { "span": "from sqlalchemy import Integer, String, ForeignKey, select, \\\n desc, func, util, MetaData, literal_column", "start_line": 4, "start_column": 0, "end_line": 5, "end_column": 46 }, { "span": "from sqlalchemy.util import u, ue", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "._", "ext_", "import_", "serializer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "testing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "Integer_", ",_", "String_", ",_", "Fore", "ign", "Key_", ",_", "select_", ",_", "desc_", ",_", "func_", ",_", "util_", ",_", "Meta", "Data_", ",_", "literal", "\\u", "column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "._", "schema_", "import_", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "._", "schema_", "import_", "Column_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "orm_", "import_", "relationship_", ",_", "sessionmaker_", ",_", "scoped", "\\u", "session_", ",_", "class", "\\u", "mapper_", ",_", "mapper_", ",_", "joine", "dlo", "ad_", ",_", "configur", "e\\u", "mapper", "s_", ",_", "aliased", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "import_", "eq\\u_", ",_", "Assert", "s", "Compiled", "SQL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "util_", "import_", "u_", ",_", "ue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "._", "testing_", "import_", "fixtures_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "users_", "=_", "addresses_", "=_", "Session_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "testing_", "._", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User_", "(_", "fixtures_", "._", "Compara", "ble", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Address_", "(_", "fixtures_", "._", "Compara", "ble", "Entity_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "run", "\\u", "setup", "\\u", "mapper", "s_", "=_", "'", "onc", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "inserts", "_", "=_", "'", "onc", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "run", "\\u", "delete", "s_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fail", "s", " ", "too", " ", "oft", "en", "/", "random", "ly_", "\\u\\u\\uNL\\u\\u\\u_", "#@", "testi", "ng", ".", "require", "s", ".", "non", "\\u", "broken", "\\u", "pickle_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "test\\u", "query", "\\u", "three", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ua", " ", "=", " ", "aliased", "(", "User", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "q", " ", "=", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Sess", "ion", ".", "query", "(", "ua", ").", "join", "(", "ua", ".", "addresse", "s", ").", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "filter", "(", "Address", ".", "email", ".", "like", "('", "%", "fre", "d", "%'", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "q2", " ", "=", " ", "serialize", "r", ".", "load", "s", "(", "serialize", "r", ".", "dump", "s", "(", "q", ",", " ", "-1", "),", " ", "users", ".", "metadata", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Sess", "ion", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "eq", "\\u(", "q2", ".", "all", "()", ",", " ", "[", "User", "(", "name", "='", "fre", "d", "')]", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "try", " ", "to", " ", "pull", " ", "out", " ", "the", " ", "aliased", " ", "entity", " ", "here", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ua", "\\u", "2", " ", "=", " ", "q2", ".\\u", "entit", "ies", "[", "0", "].", "entity", "\\u", "zero", ".", "entity_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "eq", "\\u(", "list", "(", "q2", ".", "values", "(", "ua", "\\u", "2", ".", "id", ",", " ", "ua", "\\u", "2", ".", "name", "))", ",", " ", "[(", "9", ",", " ", "'", "fre", "d", "')]", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "defin", "e\\u", "tables_", "(_", "cls_", ",_", "metadata_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "users_", ",_", "addresses_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "=_", "Table_", "(_", "'", "users", "'_", ",_", "metadata_", ",_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "Column_", "(_", "'", "name", "'_", ",_", "String_", "(_", "50_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addresses_", "=_", "Table_", "(_", "'", "addresse", "s", "'_", ",_", "metadata_", ",_", "Column_", "(_", "'", "id", "'_", ",_", "Integer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "primary", "\\u", "key_", "=_", "True_", ")_", ",_", "Column_", "(_", "'", "email", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "String_", "(_", "50_", ")_", ")_", ",_", "Column_", "(_", "'", "user", "\\u", "id", "'_", ",_", "Integer_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Fore", "ign", "Key_", "(_", "'", "users", ".", "id", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\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_", "setup", "\\u", "mapper", "s_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "Session_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Session_", "=_", "scoped", "\\u", "session_", "(_", "sessionmaker_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapper_", "(_", "User_", ",_", "users_", ",_", "properties_", "=_", "{_", "'", "addresse", "s", "'_", "\\u\\u\\uNL\\u\\u\\u_", ":_", "relationship_", "(_", "Address_", ",_", "backref_", "=_", "'", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "order", "\\u", "by_", "=_", "addresses_", "._", "c_", "._", "id_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mapper_", "(_", "Address_", ",_", "addresses_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configur", "e\\u", "mapper", "s_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\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_", "insert", "\\u", "data_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "=_", "[_", "dict_", "(_", "list_", "(_", "zip_", "(_", "(_", "'", "id", "'_", ",_", "'", "name", "'_", ")_", ",_", "column", "\\u", "values_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "column", "\\u", "values_", "in_", "[_", "(_", "7_", ",_", "'", "jack", "'_", ")_", ",_", "(_", "8_", ",_", "'", "ed", "'_", ")_", ",_", "(_", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fre", "d", "'_", ")_", ",_", "(_", "10_", ",_", "'", "chu", "ck", "'_", ")_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", "._", "insert_", "(_", ")_", "._", "execute_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "addresses_", "._", "insert_", "(_", ")_", "._", "execute_", "(_", "[_", "dict_", "(_", "list_", "(_", "zip_", "(_", "(_", "'", "id", "'_", ",_", "'", "user", "\\u", "id", "'_", ",_", "'", "email", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "column", "\\u", "values_", ")_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "column", "\\u", "values_", "in_", "[_", "(_", "1_", ",_", "7_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "jack", "@", "bean", ".", "com", "'_", ")_", ",_", "(_", "2_", ",_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ed", "@", "wood", ".", "com", "'_", ")_", ",_", "(_", "3_", ",_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ed", "@", "bett", "ybo", "op", ".", "com", "'_", ")_", ",_", "(_", "4_", ",_", "8_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ed", "@", "lal", "a", ".", "com", "'_", ")_", ",_", "(_", "5_", ",_", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fre", "d", "@", "fre", "d", ".", "com", "'_", ")_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tables_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "users_", ",_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "users_", "._", "metadata_", ",_", "Session_", ")_", "is_", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "columns_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "users_", "._", "c_", "._", "name_", ",_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "users_", "._", "metadata_", ",_", "Session_", ")_", "is_", "users_", "._", "c_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "mapper_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "mapper_", "=_", "class", "\\u", "mapper_", "(_", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "user", "\\u", "mapper_", ",_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "None_", ")_", "is_", "user", "\\u", "mapper_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "User_", "._", "name_", ",_", "-_", "1_", ")_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ")_", "is_", "User_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "expression_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expr_", "=_", "select_", "(_", "[_", "users_", "]_", ")_", "._", "select", "\\u", "from_", "(_", "users_", "._", "join_", "(_", "addresses_", ")_", ")_", "._", "limit_", "(_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "\\u", "expr_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "expr_", ",_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "users_", "._", "metadata_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "str_", "(_", "expr_", ")_", ",_", "str_", "(_", "re", "\\u", "expr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "re", "\\u", "expr_", "._", "bind_", "is_", "testing_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "re", "\\u", "expr_", "._", "execute_", "(_", ")_", "._", "fetchall_", "(_", ")_", ",_", "[_", "(_", "7_", ",_", "'", "jack", "'_", ")_", ",_", "(_", "8_", ",_", "'", "ed", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "8_", ",_", "'", "ed", "'_", ")_", ",_", "(_", "8_", ",_", "'", "ed", "'_", ")_", ",_", "(_", "9_", ",_", "'", "fre", "d", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "query", "\\u", "one_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "Session_", "._", "query_", "(_", "User_", ")_", "._", "filter_", "(_", "User_", "._", "name_", "==_", "'", "ed", "'_", ")_", "._", "options_", "(_", "joine", "dlo", "ad_", "(_", "User_", "._", "addresses_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "q2_", "=_", "serializer_", "._", "loads_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "serializer_", "._", "dumps_", "(_", "q_", ",_", "-_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "users_", "._", "metadata_", ",_", "Session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "go_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "q2_", "._", "all_", "(_", ")_", ",_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "User_", "(_", "name_", "=_", "'", "ed", "'_", ",_", "addresses_", "=_", "[_", "Address_", "(_", "id_", "=_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Address_", "(_", "id_", "=_", "3_", ")_", ",_", "Address_", "(_", "id_", "=_", "4_", ")_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "\\u", "sql", "\\u", "count_", "(_", "testing_", "._", "db_", ",_", "go_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "q2_", "._", "join_", "(_", "User_", "._", "addresses_", ")_", "._", "filter_", "(_", "Address_", "._", "email_", "\\u\\u\\uNL\\u\\u\\u_", "==_", "'", "ed", "@", "bett", "ybo", "op", ".", "com", "'_", ")_", "._", "value_", "(_", "func_", "._", "count_", "(_", "literal", "\\u", "column_", "(_", "'*'_", ")_", ")_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u1_", "=_", "Session_", "._", "query_", "(_", "User_", ")_", "._", "get_", "(_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q_", "=_", "Session_", "._", "query_", "(_", "Address_", ")_", "._", "filter_", "(_", "Address_", "._", "user_", "\\u\\u\\uNL\\u\\u\\u_", "==_", "u1_", ")_", "._", "order", "\\u", "by_", "(_", "desc_", "(_", "Address_", "._", "email_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q2_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "q_", ",_", "-_", "1_", ")_", ",_", "users_", "._", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "q2_", "._", "all_", "(_", ")_", ",_", "[_", "Address_", "(_", "email_", "=_", "'", "ed", "@", "wood", ".", "com", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Address_", "(_", "email_", "=_", "'", "ed", "@", "lal", "a", ".", "com", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Address_", "(_", "email_", "=_", "'", "ed", "@", "bett", "ybo", "op", ".", "com", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "non", "\\u", "broken", "\\u", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "query", "\\u", "two_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "q_", "=_", "Session_", "._", "query_", "(_", "User_", ")_", "._", "join_", "(_", "User_", "._", "addresses_", ")_", "._", "filter_", "(_", "Address_", "._", "email_", "._", "like_", "(_", "'%", "fre", "d", "%'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q2_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "q_", ",_", "-_", "1_", ")_", ",_", "users_", "._", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "q2_", "._", "all_", "(_", ")_", ",_", "[_", "User_", "(_", "name_", "=_", "'", "fre", "d", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "list_", "(_", "q2_", "._", "values_", "(_", "User_", "._", "id_", ",_", "User_", "._", "name_", ")_", ")_", ",_", "[_", "(_", "9_", ",_", "'", "fre", "d", "'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "non", "\\u", "broken", "\\u", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "orm", "\\u", "join_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sqlalchemy_", "._", "orm_", "._", "util_", "import_", "join_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "j_", "=_", "join_", "(_", "User_", ",_", "Address_", ",_", "User_", "._", "addresses_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "j2_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "j_", ",_", "-_", "1_", ")_", ",_", "users_", "._", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "j2_", "._", "left_", "is_", "j_", "._", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "j2_", "._", "right_", "is_", "j_", "._", "right_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "j2_", "._", "\\u", "target", "\\u", "adapter_", "._", "\\u", "next_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "exclude_", "(_", "'", "sql", "ite", "'_", ",_", "'<='_", ",_", "(_", "3_", ",_", "5_", ",_", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", " ", "compa", "ris", "on", " ", "faili", "ng", " ", "on", " ", "the", " ", "build", "bot", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "aliases_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "u", "7_", ",_", "u", "8_", ",_", "u", "9_", ",_", "u1", "0_", "=_", "Session_", "._", "query_", "(_", "User_", ")_", "._", "order", "\\u", "by_", "(_", "User_", "._", "id_", ")_", "._", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uali", "as_", "=_", "aliased", "_", "(_", "User_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q_", "=_", "Session_", "._", "query_", "(_", "User_", ",_", "uali", "as_", ")_", "._", "join_", "(_", "uali", "as_", ",_", "User_", "._", "id_", "\\u\\u\\uNL\\u\\u\\u_", "<_", "uali", "as_", "._", "id_", ")_", "._", "filter_", "(_", "User_", "._", "id_", "<_", "9_", ")_", "._", "order", "\\u", "by_", "(_", "User_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "uali", "as_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "list_", "(_", "q_", "._", "all_", "(_", ")_", ")_", ",_", "[_", "(_", "u", "7_", ",_", "u", "8_", ")_", ",_", "(_", "u", "7_", ",_", "u", "9_", ")_", ",_", "(_", "u", "7_", ",_", "u1", "0_", ")_", ",_", "(_", "u", "8_", ",_", "u", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u", "8_", ",_", "u1", "0_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "q2_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "q_", ",_", "-_", "1_", ")_", ",_", "users_", "._", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "list_", "(_", "q2_", "._", "all_", "(_", ")_", ")_", ",_", "[_", "(_", "u", "7_", ",_", "u", "8_", ")_", ",_", "(_", "u", "7_", ",_", "u", "9_", ")_", ",_", "(_", "u", "7_", ",_", "u1", "0_", ")_", ",_", "(_", "u", "8_", ",_", "u", "9_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "u", "8_", ",_", "u1", "0_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "testing_", "._", "requires_", "._", "non", "\\u", "broken", "\\u", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "any_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r_", "=_", "User_", "._", "addresses_", "._", "any_", "(_", "Address_", "._", "email_", "==_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ser_", "=_", "serializer_", "._", "dumps_", "(_", "r_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "serializer_", "._", "loads_", "(_", "ser_", ",_", "users_", "._", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "str_", "(_", "r_", ")_", ",_", "str_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Seriali", "ze", "Test_", "(_", "Assert", "s", "Compiled", "SQL_", ",_", "fixtures_", "._", "Map", "ped", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "unicode_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "Meta", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "Table_", "(_", "ue_", "(_", "'\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "'_", ")_", ",_", "m_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Column_", "(_", "ue_", "(_", "'\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\\u", "id", "'_", ")_", ",_", "Integer_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr_", "=_", "select_", "(_", "[_", "t_", "]_", ")_", "._", "where_", "(_", "t_", "._", "c_", "[_", "ue_", "(_", "'\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\\u", "id", "'_", ")_", "]_", "==_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expr", "2_", "=_", "serializer_", "._", "loads_", "(_", "serializer_", "._", "dumps_", "(_", "expr_", ",_", "-_", "1_", ")_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "\\u", "compile_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "expr", "2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ue_", "(_", "'", "SELECT", " ", "\"\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\".", "\"\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\\u", "id", "\"", " ", "FROM", " ", "\"\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\"", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "WHE", "RE", " ", "\"\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\".", "\"\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\\u", "id", "\"", " ", "=", " ", ":\\\\", "u", "6e", "2c", "\\\\", "u", "8a", "6", "6", "\\u", "id", "\\u", "1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dialect_", "=_", "\"", "default", "\"_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
TheSriram/MLT4Trading/Project 3/testlearner.py
[ { "content": "from __future__ import division\nfrom Randomforestlearner import Randomforestlearner\nimport numpy\nimport datetime\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n main()\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_graph_two_plots(x_series,y_series,y1_series,xlabel,ylabel,name_file):\n plt.clf()\n plt.xlabel(xlabel)\n plt.ylabel(ylabel)\n first = plt.plot(x_series,y_series,color='r')\n second = plt.plot(x_series,y1_series,color='b')\n plt.legend([\"Ypredict\",\"Yactual\"])\n plt.savefig(name_file)", "metadata": "root.get_graph_two_plots", "header": "['module', '___EOS___']", "index": 9 }, { "content": "def get_correlation(Y_return,Y_test):\n covariance_matrix = np.corrcoef(Y_return, np.squeeze(np.asarray(Y_test)))\n return covariance_matrix[0, 1]", "metadata": "root.get_correlation", "header": "['module', '___EOS___']", "index": 18 }, { "content": "def get_rmse(Y_return,Y_Test):\n return math.sqrt(np.mean(np.square(Y_return-Y_Test)))", "metadata": "root.get_rmse", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def scatter(Y_return,Y_test,name_file):\n plt.clf()\n fig = plt.figure(figsize=(6, 5))\n graph = fig.add_subplot(1,1,1)\n graph.scatter(Y_return,Y_test)\n graph.set_title(\"predicted Y vs actual Y\")\n graph.set_xlabel=\"Days\"\n graph.set_ylabel=\"Y\"\n fig.savefig(name_file)", "metadata": "root.scatter", "header": "['module', '___EOS___']", "index": 25 }, { "content": "def all_feature_graph(y1,y2,y3,y4,y5,x,xlabel,ylabel,name_file):\n plt.clf()\n plt.xlabel(xlabel)\n plt.ylabel(ylabel)\n first = plt.plot(x,y1)\n second = plt.plot(x,y2)\n third = plt.plot(x,y3)\n fourth = plt.plot(x,y4)\n fifth = plt.plot(x,y5)\n plt.legend([\"mean\",\"stddev\",\"rsi\",\"roc\",\"slope\"])\n plt.savefig(name_file)", "metadata": "root.all_feature_graph", "header": "['module', '___EOS___']", "index": 35 }, { "content": "def read_file(filename):\n required_all=list()\n inf = open(filename)\n for s in reversed(inf.readlines()):\n all_needed = s.split(',')\n required = all_needed[:2]\n if(all_needed[0]!='Date'):\n required_all.append(float(required[1]))\n return required_all", "metadata": "root.read_file", "header": "['module', '___EOS___']", "index": 47 }, { "content": "def get_mean(dataset_21):\n return numpy.mean(dataset_21)", "metadata": "root.get_mean", "header": "['module', '___EOS___']", "index": 57 }, { "content": "def get_stddev(dataset_21):\n return numpy.std(dataset_21)", "metadata": "root.get_stddev", "header": "['module', '___EOS___']", "index": 60 }, { "content": "def get_relative_strength_idx(dataset_21):\n comparer = dataset_21[0]\n gain =0.0\n loss =0.0\n new_dataset= dataset_21[0:]\n for each in new_dataset:\n if each > comparer:\n gain = gain + (each-comparer)\n elif each < comparer:\n loss = loss + (comparer-each)\n if loss ==0.0:\n return 100.0\n elif gain ==0.0:\n return 0.0\n else:\n rs = (gain/len(new_dataset))/(loss/len(new_dataset))\n rsi = float(100 - (100/(1+rs)))\n return rsi", "metadata": "root.get_relative_strength_idx", "header": "['module', '___EOS___']", "index": 63 }, { "content": "def roc(dataset_21):\n latest = dataset_21[len(dataset_21)-1]\n oldest = dataset_21[0]\n ROC = (latest - oldest) / (oldest) * 100 \n return ROC", "metadata": "root.roc", "header": "['module', '___EOS___']", "index": 82 }, { "content": "def slope(dataset_21):\n x = numpy.array([i for i in range(1,22)])\n y = numpy.array([data for data in dataset_21])\n A = numpy.vstack([x, numpy.ones(len(x))]).T\n m, c = numpy.linalg.lstsq(A, y)[0]\n return m", "metadata": "root.slope", "header": "['module', '___EOS___']", "index": 89 }, { "content": "def createX(datesandY):\n totalX =[]\n index = 21\n start = 0\n while index <=len(datesandY)-5:\n dataset_21 = datesandY[start:index]\n totalX.append([get_mean(dataset_21),get_stddev(dataset_21),get_relative_strength_idx(dataset_21),roc(dataset_21),slope(dataset_21),datesandY[index+4]-datesandY[index]])\n start = start+1\n index= index+1\n return numpy.array(totalX)", "metadata": "root.createX", "header": "['module', '___EOS___']", "index": 96 }, { "content": "def main():\n curr_dirr = os.getcwd()\n os.chdir('proj3-data-fixed')\n datesandY = read_file('ML4T-000.csv')\n stack = createX(datesandY)\n # print len(stack)\n for i in range(1,10):\n datesandY = read_file('ML4T-00'+str(i)+'.csv')\n learnedvalues = createX(datesandY)\n stack = numpy.vstack((stack,learnedvalues))\n for i in range(11,100):\n datesandY = read_file('ML4T-0'+str(i)+'.csv')\n learnedvalues = createX(datesandY)\n stack = numpy.vstack((stack,learnedvalues))\n print len(stack)\n testdatesandY = read_file('ML4T-292.csv')\n test = createX(testdatesandY)\n (XTrain,YTrain) = numpy.split(stack,[5],axis=1)\n (XTest,YTest) = numpy.split(test,[5],axis=1)\n # print XTest\n randomforestlearner = Randomforestlearner(k=50)\n randomforestlearner.addEvidence(XTrain,YTrain)\n Y_Return = numpy.multiply(numpy.array(randomforestlearner.query(XTest)),-1)\n Y_Test = np.squeeze(np.asarray(YTest))\n \n start=0\n index=5\n print len(Y_Return)\n print len(Y_Test)\n print len(testdatesandY)\n\n while index<len(testdatesandY)-26:\n Y_Return[start]=Y_Return[start]+testdatesandY[index]\n Y_Test[start]=Y_Test[start]+testdatesandY[index]\n start = start+1\n index=index+1\n os.chdir(curr_dirr)\n get_graph_two_plots(numpy.arange(1,101),Y_Return[:100],Y_Test[:100],\"Days\",\"Y\",\"YpredictvsYactual_292_first100.jpg\")\n last126_test = Y_Test[-126:]\n last126_return = Y_Return[-126:]\n get_graph_two_plots(numpy.arange(1,101),last126_return[:100],last126_test[:100],\"Days\",\"Y\",\"YpredictvsYactual_292_last100.jpg\")\n scatter(Y_Return,Y_Test,\"scatterplot_292.jpg\")\n mean_series = XTest[:,0]\n std_series =XTest[:,1]\n rsi_series = XTest[:,2]\n roc_series = XTest[:,3]\n slope_series = XTest[:,4]\n all_feature_graph(mean_series[:100],std_series[:100],rsi_series[:100],roc_series[:100],slope_series[:100],numpy.arange(1,101),\"Days\",\"Features\",\"Allfeature_292.jpg\")\n print \"Correlation 292 is {0}\".format(get_correlation(Y_Test,Y_Return))\n print \"RMSE 292 is {0}\".format(get_rmse(Y_Test,Y_Return))\n os.chdir('proj3-data-fixed')\n testdatesandY = read_file('ML4T-132.csv')\n test = createX(testdatesandY)\n (XTrain,YTrain) = numpy.split(stack,[5],axis=1)\n (XTest,YTest) = numpy.split(test,[5],axis=1)\n # print XTest\n randomforestlearner = Randomforestlearner(k=50)\n randomforestlearner.addEvidence(XTrain,YTrain)\n Y_Return = numpy.multiply(numpy.array(randomforestlearner.query(XTest)),-1)\n Y_Test = np.squeeze(np.asarray(YTest))\n \n start=0\n index=5\n print len(Y_Return)\n print len(Y_Test)\n print len(testdatesandY)\n\n while index<len(testdatesandY)-26:\n Y_Return[start]=Y_Return[start]+testdatesandY[index]\n Y_Test[start]=Y_Test[start]+testdatesandY[index]\n start = start+1\n index=index+1\n os.chdir(curr_dirr)\n get_graph_two_plots(numpy.arange(1,101),Y_Return[:100],Y_Test[:100],\"Days\",\"Y\",\"YpredictvsYactual_132_first100.jpg\")\n last126_test = Y_Test[-126:]\n last126_return = Y_Return[-126:]\n get_graph_two_plots(numpy.arange(1,101),last126_return[:100],last126_test[:100],\"Days\",\"Y\",\"YpredictvsYactual_132_last100.jpg\")\n scatter(Y_Return,Y_Test,\"scatterplot_132.jpg\")\n mean_series = XTest[:,0]\n std_series =XTest[:,1]\n rsi_series = XTest[:,2]\n roc_series = XTest[:,3]\n slope_series = XTest[:,4]\n all_feature_graph(mean_series[:100],std_series[:100],rsi_series[:100],roc_series[:100],slope_series[:100],numpy.arange(1,101),\"Days\",\"Features\",\"Allfeature_132.jpg\")\n print \"Correlation 132 is {0}\".format(get_correlation(Y_Test,Y_Return))\n print \"RMSE 132 is {0}\".format(get_rmse(Y_Test,Y_Return))", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 106 } ]
[ { "span": "import datetime", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Random", "forest", "learner_", "import_", "Random", "forest", "learner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "graph", "\\u", "two", "\\u", "plots_", "(_", "x", "\\u", "series_", ",_", "y", "\\u", "series_", ",_", "y1", "\\u", "series_", ",_", "xlabel_", ",_", "ylabel_", ",_", "name", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "xlabel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "ylabel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first_", "=_", "plt_", "._", "plot_", "(_", "x", "\\u", "series_", ",_", "y", "\\u", "series_", ",_", "color_", "=_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second_", "=_", "plt_", "._", "plot_", "(_", "x", "\\u", "series_", ",_", "y1", "\\u", "series_", ",_", "color_", "=_", "'", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "legend_", "(_", "[_", "\"", "Yp", "red", "ict", "\"_", ",_", "\"", "Ya", "ctu", "al", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "name", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "correlation_", "(_", "Y", "\\u", "return_", ",_", "Y", "\\u", "test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "covariance", "\\u", "matrix_", "=_", "np_", "._", "corr", "coef_", "(_", "Y", "\\u", "return_", ",_", "np_", "._", "squeeze_", "(_", "np_", "._", "asarray_", "(_", "Y", "\\u", "test_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "covariance", "\\u", "matrix_", "[_", "0_", ",_", "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_", "get", "\\u", "rmse", "_", "(_", "Y", "\\u", "return_", ",_", "Y", "\\u", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "math_", "._", "sqrt_", "(_", "np_", "._", "mean_", "(_", "np_", "._", "square_", "(_", "Y", "\\u", "return_", "-_", "Y", "\\u", "Test_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scatter_", "(_", "Y", "\\u", "return_", ",_", "Y", "\\u", "test_", ",_", "name", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "=_", "fig_", "._", "add", "\\u", "subplot_", "(_", "1_", ",_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "scatter_", "(_", "Y", "\\u", "return_", ",_", "Y", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "set\\u", "title_", "(_", "\"", "predi", "cte", "d", " ", "Y", " ", "vs", " ", "actual", " ", "Y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "set\\u", "xlabel_", "=_", "\"", "Day", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "set\\u", "ylabel_", "=_", "\"", "Y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "._", "savefig_", "(_", "name", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "all", "\\u", "feature", "\\u", "graph_", "(_", "y1_", ",_", "y2_", ",_", "y3_", ",_", "y", "4_", ",_", "y", "5_", ",_", "x_", ",_", "xlabel_", ",_", "ylabel_", ",_", "name", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "clf_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "xlabel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "ylabel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first_", "=_", "plt_", "._", "plot_", "(_", "x_", ",_", "y1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second_", "=_", "plt_", "._", "plot_", "(_", "x_", ",_", "y2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "third_", "=_", "plt_", "._", "plot_", "(_", "x_", ",_", "y3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fourth", "_", "=_", "plt_", "._", "plot_", "(_", "x_", ",_", "y", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fift", "h_", "=_", "plt_", "._", "plot_", "(_", "x_", ",_", "y", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "legend_", "(_", "[_", "\"", "mean", "\"_", ",_", "\"", "stddev", "\"_", ",_", "\"", "rsi", "\"_", ",_", "\"", "roc", "\"_", ",_", "\"", "slope", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "savefig_", "(_", "name", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "\\u", "file_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "require", "d\\u", "all_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inf_", "=_", "open_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "s_", "in_", "reversed_", "(_", "inf_", "._", "readlines_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "needed_", "=_", "s_", "._", "split_", "(_", "','_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "required_", "=_", "all", "\\u", "needed_", "[_", ":_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "all", "\\u", "needed_", "[_", "0_", "]_", "!=_", "'", "Date", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "require", "d\\u", "all_", "._", "append_", "(_", "float_", "(_", "required_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "require", "d\\u", "all_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "mean_", "(_", "dataset", "\\u", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "mean_", "(_", "dataset", "\\u", "21_", ")_", "\\u\\u\\uNEWLINE\\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", "stddev_", "(_", "dataset", "\\u", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "numpy_", "._", "std_", "(_", "dataset", "\\u", "21_", ")_", "\\u\\u\\uNEWLINE\\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", "relative", "\\u", "streng", "th", "\\u", "idx_", "(_", "dataset", "\\u", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compare", "r_", "=_", "dataset", "\\u", "21_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gain_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loss_", "=_", "0.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "dataset_", "=_", "dataset", "\\u", "21_", "[_", "0_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "each_", "in_", "new", "\\u", "dataset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "each_", ">_", "compare", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "gain_", "=_", "gain_", "+_", "(_", "each_", "-_", "compare", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "each_", "<_", "compare", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "loss_", "=_", "loss_", "+_", "(_", "compare", "r_", "-_", "each_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "loss_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "100.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "gain_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.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 ", " _", "rs_", "=_", "(_", "gain_", "/_", "len_", "(_", "new", "\\u", "dataset_", ")_", ")_", "/_", "(_", "loss_", "/_", "len_", "(_", "new", "\\u", "dataset_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rsi", "_", "=_", "float_", "(_", "100_", "-_", "(_", "100_", "/_", "(_", "1_", "+_", "rs_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rsi", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "roc_", "(_", "dataset", "\\u", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "latest_", "=_", "dataset", "\\u", "21_", "[_", "len_", "(_", "dataset", "\\u", "21_", ")_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "oldest", "_", "=_", "dataset", "\\u", "21_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ROC", "_", "=_", "(_", "latest_", "-_", "oldest", "_", ")_", "/_", "(_", "oldest", "_", ")_", "*_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ROC", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slope_", "(_", "dataset", "\\u", "21_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "numpy_", "._", "array_", "(_", "[_", "i_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "22_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "numpy_", "._", "array_", "(_", "[_", "data_", "for_", "data_", "in_", "dataset", "\\u", "21_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "A_", "=_", "numpy_", "._", "vstack_", "(_", "[_", "x_", ",_", "numpy_", "._", "ones_", "(_", "len_", "(_", "x_", ")_", ")_", "]_", ")_", "._", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", ",_", "c_", "=_", "numpy_", "._", "linalg_", "._", "lst", "sq_", "(_", "A_", ",_", "y_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "m_", "\\u\\u\\uNEWLINE\\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", "X_", "(_", "dates", "and", "Y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "X_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "21_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index_", "<=_", "len_", "(_", "dates", "and", "Y_", ")_", "-_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dataset", "\\u", "21_", "=_", "dates", "and", "Y_", "[_", "start_", ":_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "X_", "._", "append_", "(_", "[_", "get", "\\u", "mean_", "(_", "dataset", "\\u", "21_", ")_", ",_", "get", "\\u", "stddev_", "(_", "dataset", "\\u", "21_", ")_", ",_", "get", "\\u", "relative", "\\u", "streng", "th", "\\u", "idx_", "(_", "dataset", "\\u", "21_", ")_", ",_", "roc_", "(_", "dataset", "\\u", "21_", ")_", ",_", "slope_", "(_", "dataset", "\\u", "21_", ")_", ",_", "dates", "and", "Y_", "[_", "index_", "+_", "4_", "]_", "-_", "dates", "and", "Y_", "[_", "index_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "index_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "numpy_", "._", "array_", "(_", "total", "X_", ")_", "\\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_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "curr", "\\u", "dir", "r_", "=_", "os_", "._", "getcwd_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "'", "proj", "3", "-", "data", "-", "fixed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dates", "and", "Y_", "=_", "read", "\\u", "file_", "(_", "'", "ML", "4", "T", "-0", "00", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "=_", "create", "X_", "(_", "dates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "len", "(", "stack", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "10_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dates", "and", "Y_", "=_", "read", "\\u", "file_", "(_", "'", "ML", "4", "T", "-0", "0", "'_", "+_", "str_", "(_", "i_", ")_", "+_", "'.", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learned", "values_", "=_", "create", "X_", "(_", "dates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "=_", "numpy_", "._", "vstack_", "(_", "(_", "stack_", ",_", "learned", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "11_", ",_", "100_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dates", "and", "Y_", "=_", "read", "\\u", "file_", "(_", "'", "ML", "4", "T", "-0", "'_", "+_", "str_", "(_", "i_", ")_", "+_", "'.", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learned", "values_", "=_", "create", "X_", "(_", "dates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "=_", "numpy_", "._", "vstack_", "(_", "(_", "stack_", ",_", "learned", "values_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "len_", "(_", "stack_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testd", "ates", "and", "Y_", "=_", "read", "\\u", "file_", "(_", "'", "ML", "4", "T", "-", "292", ".", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "create", "X_", "(_", "testd", "ates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "XT", "rain_", ",_", "YT", "rain_", ")_", "=_", "numpy_", "._", "split_", "(_", "stack_", ",_", "[_", "5_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "XT", "est_", ",_", "YT", "est_", ")_", "=_", "numpy_", "._", "split_", "(_", "test_", ",_", "[_", "5_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "XT", "est_", "\\u\\u\\uNL\\u\\u\\u_", "random", "forest", "learner_", "=_", "Random", "forest", "learner_", "(_", "k_", "=_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "forest", "learner_", "._", "add", "Evi", "denc", "e_", "(_", "XT", "rain_", ",_", "YT", "rain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Return_", "=_", "numpy_", "._", "multiply_", "(_", "numpy_", "._", "array_", "(_", "random", "forest", "learner_", "._", "query_", "(_", "XT", "est_", ")_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Test_", "=_", "np_", "._", "squeeze_", "(_", "np_", "._", "asarray_", "(_", "YT", "est_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "Y", "\\u", "Return_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "Y", "\\u", "Test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "testd", "ates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "index_", "<_", "len_", "(_", "testd", "ates", "and", "Y_", ")_", "-_", "26_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Y", "\\u", "Return_", "[_", "start_", "]_", "=_", "Y", "\\u", "Return_", "[_", "start_", "]_", "+_", "testd", "ates", "and", "Y_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Test_", "[_", "start_", "]_", "=_", "Y", "\\u", "Test_", "[_", "start_", "]_", "+_", "testd", "ates", "and", "Y_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "index_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "curr", "\\u", "dir", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "graph", "\\u", "two", "\\u", "plots_", "(_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "Y", "\\u", "Return_", "[_", ":_", "100_", "]_", ",_", "Y", "\\u", "Test_", "[_", ":_", "100_", "]_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Y", "\"_", ",_", "\"", "Yp", "red", "ict", "vs", "Ya", "ctu", "al", "\\u", "292", "\\u", "first", "100", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "126", "\\u", "test_", "=_", "Y", "\\u", "Test_", "[_", "-_", "126_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "126", "\\u", "return_", "=_", "Y", "\\u", "Return_", "[_", "-_", "126_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "graph", "\\u", "two", "\\u", "plots_", "(_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "last", "126", "\\u", "return_", "[_", ":_", "100_", "]_", ",_", "last", "126", "\\u", "test_", "[_", ":_", "100_", "]_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Y", "\"_", ",_", "\"", "Yp", "red", "ict", "vs", "Ya", "ctu", "al", "\\u", "292", "\\u", "last", "100", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scatter_", "(_", "Y", "\\u", "Return_", ",_", "Y", "\\u", "Test_", ",_", "\"", "scatter", "plot", "\\u", "292", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rsi", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roc", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slope", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "feature", "\\u", "graph_", "(_", "mean", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "std", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "rsi", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "roc", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "slope", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Feature", "s", "\"_", ",_", "\"", "All", "feature", "\\u", "292", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Correla", "tion", " ", "292", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "get", "\\u", "correlation_", "(_", "Y", "\\u", "Test_", ",_", "Y", "\\u", "Return_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "RMS", "E", " ", "292", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "get", "\\u", "rmse", "_", "(_", "Y", "\\u", "Test_", ",_", "Y", "\\u", "Return_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "chdir_", "(_", "'", "proj", "3", "-", "data", "-", "fixed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "testd", "ates", "and", "Y_", "=_", "read", "\\u", "file_", "(_", "'", "ML", "4", "T", "-1", "32.", "csv", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "test_", "=_", "create", "X_", "(_", "testd", "ates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "XT", "rain_", ",_", "YT", "rain_", ")_", "=_", "numpy_", "._", "split_", "(_", "stack_", ",_", "[_", "5_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "XT", "est_", ",_", "YT", "est_", ")_", "=_", "numpy_", "._", "split_", "(_", "test_", ",_", "[_", "5_", "]_", ",_", "axis_", "=_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "XT", "est_", "\\u\\u\\uNL\\u\\u\\u_", "random", "forest", "learner_", "=_", "Random", "forest", "learner_", "(_", "k_", "=_", "50_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "forest", "learner_", "._", "add", "Evi", "denc", "e_", "(_", "XT", "rain_", ",_", "YT", "rain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Return_", "=_", "numpy_", "._", "multiply_", "(_", "numpy_", "._", "array_", "(_", "random", "forest", "learner_", "._", "query_", "(_", "XT", "est_", ")_", ")_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Test_", "=_", "np_", "._", "squeeze_", "(_", "np_", "._", "asarray_", "(_", "YT", "est_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "Y", "\\u", "Return_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "Y", "\\u", "Test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "len_", "(_", "testd", "ates", "and", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "index_", "<_", "len_", "(_", "testd", "ates", "and", "Y_", ")_", "-_", "26_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Y", "\\u", "Return_", "[_", "start_", "]_", "=_", "Y", "\\u", "Return_", "[_", "start_", "]_", "+_", "testd", "ates", "and", "Y_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Y", "\\u", "Test_", "[_", "start_", "]_", "=_", "Y", "\\u", "Test_", "[_", "start_", "]_", "+_", "testd", "ates", "and", "Y_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "start_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index_", "=_", "index_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "os_", "._", "chdir_", "(_", "curr", "\\u", "dir", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "graph", "\\u", "two", "\\u", "plots_", "(_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "Y", "\\u", "Return_", "[_", ":_", "100_", "]_", ",_", "Y", "\\u", "Test_", "[_", ":_", "100_", "]_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Y", "\"_", ",_", "\"", "Yp", "red", "ict", "vs", "Ya", "ctu", "al", "\\u", "132", "\\u", "first", "100", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "126", "\\u", "test_", "=_", "Y", "\\u", "Test_", "[_", "-_", "126_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "126", "\\u", "return_", "=_", "Y", "\\u", "Return_", "[_", "-_", "126_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "graph", "\\u", "two", "\\u", "plots_", "(_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "last", "126", "\\u", "return_", "[_", ":_", "100_", "]_", ",_", "last", "126", "\\u", "test_", "[_", ":_", "100_", "]_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Y", "\"_", ",_", "\"", "Yp", "red", "ict", "vs", "Ya", "ctu", "al", "\\u", "132", "\\u", "last", "100", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scatter_", "(_", "Y", "\\u", "Return_", ",_", "Y", "\\u", "Test_", ",_", "\"", "scatter", "plot", "\\u", "132", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mean", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rsi", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "roc", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "slope", "\\u", "series_", "=_", "XT", "est_", "[_", ":_", ",_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "feature", "\\u", "graph_", "(_", "mean", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "std", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "rsi", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "roc", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "slope", "\\u", "series_", "[_", ":_", "100_", "]_", ",_", "numpy_", "._", "arange_", "(_", "1_", ",_", "101_", ")_", ",_", "\"", "Day", "s", "\"_", ",_", "\"", "Feature", "s", "\"_", ",_", "\"", "All", "feature", "\\u", "132", ".", "jp", "g", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Correla", "tion", " ", "132", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "get", "\\u", "correlation_", "(_", "Y", "\\u", "Test_", ",_", "Y", "\\u", "Return_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "RMS", "E", " ", "132", " ", "is", " ", "{", "0", "}\"_", "._", "format_", "(_", "get", "\\u", "rmse", "_", "(_", "Y", "\\u", "Test_", ",_", "Y", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
xen/flask-project-template/manage.py
[ { "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom flask import json\n\nfrom flask.ext.script import Manager\nfrom flask.ext.migrate import MigrateCommand\n\nfrom project import create_app\nfrom project.extensions import db\n\nfrom sqlalchemy.exc import OperationalError\nfrom sqlalchemy.ext.serializer import dumps, loads\n\nmanager = Manager(create_app)\n\n# Add Flask-Migrate commands under `db` prefix, for example:\n# $ python manage.py db init\n# $ python manage.py db migrate\nmanager.add_command('db', MigrateCommand)\n\n\n\n\n\n\n\n\n\n\nmanager.add_option('-c', '--config', dest=\"config\", required=False,\n help=\"config file\")\n\nif __name__ == \"__main__\":\n manager.run()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@manager.command\ndef init():\n \"\"\"Run in local machine.\"\"\"\n syncdb()", "metadata": "root.init", "header": "['module', '___EOS___']", "index": 22 }, { "content": "@manager.command\ndef syncdb():\n \"\"\"Init/reset database.\"\"\"\n db.drop_all()\n db.create_all()", "metadata": "root.syncdb", "header": "['module', '___EOS___']", "index": 28 }, { "content": "@manager.option('-s', '--source', dest='source',\n default='data/serialized_dump.txt',\n required=False, help='Restore fixture from dump')\ndef restore(source='data/serialized_dump.txt'):\n print(\"Start importing data\")\n with open(source, 'rb') as f:\n data = json.loads(f.readline())\n for model_data in data:\n try:\n restored = loads(model_data, db.metadata, db.session)\n except AttributeError as e:\n print('Table does not exist: {}'.format(e))\n continue\n if restored:\n print('Importing {} table...'.format(restored[0].__table__.name))\n for item in restored:\n db.session.merge(item)\n\n db.session.commit()\n\n print('Done')", "metadata": "root.restore", "header": "['module', '___EOS___']", "index": 35 }, { "content": "@manager.option('-d', '--destination', dest='destination', default=None, required=True, help='Output file')\ndef dump(destination):\n dump_models = [] # List of models you want to dump\n serialized = list()\n for model in dump_models:\n print('Dumping {}'.format(model))\n serialized.append(unicode(dumps(db.session.query(model).all()), errors='ignore'))\n with open(destination, 'w') as f:\n f.writelines(json.dumps(serialized))\n print('Done.')", "metadata": "root.dump", "header": "['module', '___EOS___']", "index": 58 } ]
[ { "span": "from sqlalchemy.exc import OperationalError", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 43 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "script_", "import_", "Manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "._", "ext_", "._", "migrate_", "import_", "Migrat", "e", "Command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "project_", "import_", "create", "\\u", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "project_", "._", "extensions_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "sqlalchemy_", "._", "exc_", "import_", "Opera", "tion", "al", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sqlalchemy_", "._", "ext_", "._", "serializer_", "import_", "dumps_", ",_", "loads_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "manager_", "=_", "Manager_", "(_", "create", "\\u", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "Fla", "sk", "-", "Migrat", "e", " ", "command", "s", " ", "under", " ", "`", "db", "`", " ", "prefix", ",", " ", "for", " ", "example", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", " ", "python", " ", "manage", ".", "py", " ", "db", " ", "init_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "$", " ", "python", " ", "manage", ".", "py", " ", "db", " ", "migrate_", "\\u\\u\\uNL\\u\\u\\u_", "manager_", "._", "add", "\\u", "command_", "(_", "'", "db", "'_", ",_", "Migrat", "e", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "manager_", "._", "add", "\\u", "option_", "(_", "'-", "c", "'_", ",_", "'--", "config", "'_", ",_", "dest_", "=_", "\"", "config", "\"_", ",_", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "config", " ", "file", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "manager_", "._", "run_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "manager_", "._", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "init_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Run", " ", "in", " ", "local", " ", "machine", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sync", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "manager_", "._", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "sync", "db_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ini", "t", "/", "reset", " ", "databa", "se", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "drop", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "manager_", "._", "option_", "(_", "'-", "s", "'_", ",_", "'--", "source", "'_", ",_", "dest_", "=_", "'", "source", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default_", "=_", "'", "data", "/", "serialize", "d\\u", "dump", ".", "txt", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "required_", "=_", "False_", ",_", "help_", "=_", "'", "Restor", "e", " ", "fixture", " ", "from", " ", "dump", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "restore_", "(_", "source_", "=_", "'", "data", "/", "serialize", "d\\u", "dump", ".", "txt", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Start", " ", "import", "ing", " ", "data", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "source_", ",_", "'", "rb", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "json_", "._", "loads_", "(_", "f_", "._", "readline_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "model", "\\u", "data_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "restore", "d_", "=_", "loads_", "(_", "model", "\\u", "data_", ",_", "db_", "._", "metadata_", ",_", "db_", "._", "session_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Table", " ", "doe", "s", " ", "not", " ", "exist", ":", " ", "{}'_", "._", "format_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "restore", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Import", "ing", " ", "{}", " ", "table", "...'_", "._", "format_", "(_", "restore", "d_", "[_", "0_", "]_", "._", "\\u\\u", "table\\u\\u_", "._", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "item_", "in_", "restore", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "session_", "._", "merge_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Don", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "manager_", "._", "option_", "(_", "'-", "d", "'_", ",_", "'--", "destinat", "ion", "'_", ",_", "dest_", "=_", "'", "destinat", "ion", "'_", ",_", "default_", "=_", "None_", ",_", "required_", "=_", "True_", ",_", "help_", "=_", "'", "Output", " ", "file", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dump_", "(_", "destination_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dump", "\\u", "models_", "=_", "[_", "]_", "#", " ", "List", " ", "of", " ", "model", "s", " ", "you", " ", "want", " ", "to", " ", "dump_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialized_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "model_", "in_", "dump", "\\u", "models_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "'", "Dump", "ing", " ", "{}'_", "._", "format_", "(_", "model_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "serialized_", "._", "append_", "(_", "unicode_", "(_", "dumps_", "(_", "db_", "._", "session_", "._", "query_", "(_", "model_", ")_", "._", "all_", "(_", ")_", ")_", ",_", "errors_", "=_", "'", "ignore", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "destination_", ",_", "'", "w", "'_", ")_", "as_", "f_", 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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 ]
Testing equality to None
CollabQ/CollabQ/common/appengine_utilities/cache.py
[ { "content": " def _validate_key(self, key):\n \"\"\"\n Internal method for key validation. This can be used by a superclass\n to introduce more checks on key names.\n \n Args:\n key: Key name to check\n\n Returns True is key is valid, otherwise raises KeyError.\n \"\"\"\n if key == None:\n raise KeyError\n return True", "metadata": "root.Cache._validate_key", "header": "['class', 'Cache', '(', 'object', ')', ':', '___EOS___']", "index": 109 }, { "content": " def _validate_value(self, value):\n \"\"\"\n Internal method for value validation. This can be used by a superclass\n to introduce more checks on key names.\n\n Args:\n value: value to check\n\n Returns True is value is valid, otherwise raises ValueError.\n \"\"\"\n if value == None:\n raise ValueError\n return True", "metadata": "root.Cache._validate_value", "header": "['class', 'Cache', '(', 'object', ')', ':', '___EOS___']", "index": 123 }, { "content": " def _validate_timeout(self, timeout):\n \"\"\"\n Internal method to validate timeouts. If no timeout\n is passed, then the default_timeout is used.\n\n Args:\n timeout: datetime.datetime format\n\n Returns the timeout\n \"\"\"\n if timeout == None:\n timeout = datetime.datetime.now() +\\\n datetime.timedelta(seconds=self.default_timeout)\n if type(timeout) == type(1):\n timeout = datetime.datetime.now() + \\\n datetime.timedelta(seconds = timeout)\n if type(timeout) != datetime.datetime:\n raise TypeError\n if timeout < datetime.datetime.now():\n raise ValueError\n\n return timeout", "metadata": "root.Cache._validate_timeout", "header": "['class', 'Cache', '(', 'object', ')', ':', '___EOS___']", "index": 137 } ]
[ { "span": "key == None:", "start_line": 119, "start_column": 11, "end_line": 119, "end_column": 22 }, { "span": "value == None:", "start_line": 133, "start_column": 11, "end_line": 133, "end_column": 24 }, { "span": "timeout == None:", "start_line": 147, "start_column": 11, "end_line": 147, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Cache_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "key_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Intern", "al", " ", "method", " ", "for", " ", "key", " ", "validation", ".", " ", "Thi", "s", " ", "can", " ", "be", " ", "used", " ", "by", " ", "a", " ", "superclass", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "introduce", " ", "more", " ", "checks", " ", "on", " ", "key", " ", "names", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "key", ":", " ", "Key", " ", "name", " ", "to", " ", "check", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Tru", "e", " ", "is", " ", "key", " ", "is", " ", "valid", ",", " ", "other", "wis", "e", " ", "raise", "s", " ", "Key", "Error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "value_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Intern", "al", " ", "method", " ", "for", " ", "value", " ", "validation", ".", " ", "Thi", "s", " ", "can", " ", "be", " ", "used", " ", "by", " ", "a", " ", "superclass", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "introduce", " ", "more", " ", "checks", " ", "on", " ", "key", " ", "names", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "value", ":", " ", "value", " ", "to", " ", "check", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Tru", "e", " ", "is", " ", "value", " ", "is", " ", "valid", ",", " ", "other", "wis", "e", " ", "raise", "s", " ", "Value", "Error", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Cache_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "validat", "e\\u", "timeout_", "(_", "self_", ",_", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Intern", "al", " ", "method", " ", "to", " ", "validat", "e", " ", "timeouts", ".", " ", "If", " ", "no", " ", "timeo", "ut", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "pass", "ed", ",", " ", "then", " ", "the", " ", "default", "\\u", "timeo", "ut", " ", "is", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "timeo", "ut", ":", " ", "datetime", ".", "datetime", " ", "format", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "timeo", "ut", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "self_", "._", "default", "\\u", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "timeout_", ")_", "==_", "type_", "(_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", "+_", "datetime_", "._", "timedelta_", "(_", "seconds_", "=_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "timeout_", ")_", "!=_", "datetime_", "._", "datetime_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timeout_", "<_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
lingthio/Flask-User/example_apps/user_profile_app.py
[ { "content": "def create_app(test_config=None): # For automated tests\n # Setup Flask and read config from ConfigClass defined above\n app = Flask(__name__)\n app.config.from_object(__name__+'.ConfigClass')\n\n # Load local_settings.py if file exists # For automated tests\n try: app.config.from_object('local_settings')\n except: pass\n\n # Load optional test_config # For automated tests\n if test_config:\n app.config.update(test_config)\n\n # Initialize Flask extensions\n mail = Mail(app) # Initialize Flask-Mail\n db = SQLAlchemy(app) # Initialize Flask-SQLAlchemy\n\n # Define User model. Make sure to add flask.ext.user UserMixin!!\n class User(db.Model, UserMixin):\n id = db.Column(db.Integer, primary_key=True)\n user_profile_id = db.Column(db.Integer(), db.ForeignKey('user_profile.id', ondelete='CASCADE'))\n\n # User authentication information\n username = db.Column(db.String(50), nullable=False, unique=True)\n password = db.Column(db.String(255), nullable=False, server_default='')\n reset_password_token = db.Column(db.String(100), nullable=False, server_default='')\n active = db.Column('is_active', db.Boolean(), nullable=False, server_default='0')\n\n # User email information\n email = db.Column(db.String(255), nullable=False, unique=True)\n confirmed_at = db.Column(db.DateTime())\n\n # Relationships\n user_profile = db.relationship('UserProfile', uselist=False, foreign_keys=[user_profile_id])\n\n class UserProfile(db.Model):\n id = db.Column(db.Integer, primary_key=True)\n\n # User information\n first_name = db.Column(db.String(50), nullable=False, default='')\n last_name = db.Column(db.String(50), nullable=False, default='')\n\n # Relationships\n roles = db.relationship('Role', secondary='user_roles',\n backref=db.backref('users', lazy='dynamic'))\n\n # Define Role model\n class Role(db.Model):\n id = db.Column(db.Integer(), primary_key=True)\n name = db.Column(db.String(50), unique=True)\n\n # Define UserRoles model\n class UserRoles(db.Model):\n id = db.Column(db.Integer(), primary_key=True)\n user_profile_id = db.Column(db.Integer(), db.ForeignKey('user_profile.id', ondelete='CASCADE'))\n role_id = db.Column(db.Integer(), db.ForeignKey('role.id', ondelete='CASCADE'))\n\n # Reset all the database tables\n db.create_all()\n\n # Setup Flask-User\n db_adapter = SQLAlchemyAdapter(db, User, UserProfileClass=UserProfile)\n user_manager = UserManager(db_adapter, app)\n\n # Create 'user007' user with 'secret' and 'agent' roles\n if not User.query.filter(User.username=='user007').first():\n user_profile1 = UserProfile(first_name='James', last_name='Bond')\n db.session.add(user_profile1)\n user1 = User(user_profile=user_profile1, username='user007',\n email='[email protected]', password=user_manager.hash_password('Password1'),\n active=True)\n db.session.add(user1)\n user_profile1.roles.append(Role(name='secret'))\n user_profile1.roles.append(Role(name='agent'))\n db.session.commit()\n\n # The Home page is accessible to anyone\n @app.route('/')\n def home_page():\n return render_template_string(\"\"\"\n {% extends \"base.html\" %}\n {% block content %}\n <h2>Home page</h2>\n <p>This page can be accessed by anyone.</p><br/>\n <p><a href={{ url_for('home_page') }}>Home page</a> (anyone)</p>\n <p><a href={{ url_for('members_page') }}>Members page</a> (login required)</p>\n <p><a href={{ url_for('special_page') }}>Special page</a> (login with username 'user007' and password 'Password1')</p>\n {% endblock %}\n \"\"\")\n\n # The Members page is only accessible to authenticated users\n @app.route('/members')\n @login_required # Use of @login_required decorator\n def members_page():\n return render_template_string(\"\"\"\n {% extends \"base.html\" %}\n {% block content %}\n <h2>Members page</h2>\n <p>This page can only be accessed by authenticated users.</p><br/>\n <p><a href={{ url_for('home_page') }}>Home page</a> (anyone)</p>\n <p><a href={{ url_for('members_page') }}>Members page</a> (login required)</p>\n <p><a href={{ url_for('special_page') }}>Special page</a> (login with username 'user007' and password 'Password1')</p>\n {% endblock %}\n \"\"\")\n\n # The Special page requires a user with 'special' and 'sauce' roles or with 'special' and 'agent' roles.\n @app.route('/special')\n @roles_required('secret', ['sauce', 'agent']) # Use of @roles_required decorator\n def special_page():\n return render_template_string(\"\"\"\n {% extends \"base.html\" %}\n {% block content %}\n <h2>Special Page</h2>\n <p>This page can only be accessed by user007.</p><br/>\n <p><a href={{ url_for('home_page') }}>Home page</a> (anyone)</p>\n <p><a href={{ url_for('members_page') }}>Members page</a> (login required)</p>\n <p><a href={{ url_for('special_page') }}>Special page</a> (login with username 'user007' and password 'Password1')</p>\n {% endblock %}\n \"\"\")\n\n return app", "metadata": "root.create_app", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "mail ", "start_line": 42, "start_column": 4, "end_line": 42, "end_column": 8 }, { "span": "UserRoles(", "start_line": 80, "start_column": 10, "end_line": 80, "end_column": 19 } ]
[]
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_", "create", "\\u", "app_", "(_", "test\\u", "config_", "=_", "None_", ")_", ":_", "#", " ", "For", " ", "automat", "ed", " ", "tests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", "up", " ", "Fla", "sk", " ", "and", " ", "read", " ", "config", " ", "from", " ", "Config", "Class", " ", "defin", "ed", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "Flask_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "config_", "._", "from", "\\u", "object_", "(_", "\\u\\u", "name\\u\\u_", "+_", "'.", "Config", "Class", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "local", "\\u", "settings", ".", "py", " ", "if", " ", "file", " ", "exist", "s", " ", " ", " ", " ", " ", "#", " ", "For", " ", "automat", "ed", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "app_", "._", "config_", "._", "from", "\\u", "object_", "(_", "'", "local", "\\u", "settings", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Load", " ", "option", "al", " ", "test\\u", "config", " ", " ", " ", "#", " ", "For", " ", "automat", "ed", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "test\\u", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "._", "config_", "._", "update_", "(_", "test\\u", "config_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "Fla", "sk", " ", "extensions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "mail_", "=_", "Mail_", "(_", "app_", ")_", "#", " ", "Initializ", "e", " ", "Fla", "sk", "-", "Mail_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "SQL", "Alchemy_", "(_", "app_", ")_", "#", " ", "Initializ", "e", " ", "Fla", "sk", "-", "SQL", "Alchemy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "User", " ", "model", ".", " ", "Make", " ", "sure", " ", "to", " ", "add", " ", "fla", "sk", ".", "ext", ".", "user", " ", "User", "Mix", "in", "!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "User_", "(_", "db_", "._", "Model_", ",_", "User", "Mixin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "profile", "\\u", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", "(_", ")_", ",_", "db_", "._", "Fore", "ign", "Key_", "(_", "'", "user", "\\u", "profile", ".", "id", "'_", ",_", "ondelete_", "=_", "'", "CAS", "CA", "DE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "authenticat", "ion", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "username_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "50_", ")_", ",_", "nullable_", "=_", "False_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "255_", ")_", ",_", "nullable_", "=_", "False_", ",_", "server", "\\u", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reset", "\\u", "password", "\\u", "token_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "100_", ")_", ",_", "nullable_", "=_", "False_", ",_", "server", "\\u", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "active_", "=_", "db_", "._", "Column_", "(_", "'", "is", "\\u", "active", "'_", ",_", "db_", "._", "Boolean_", "(_", ")_", ",_", "nullable_", "=_", "False_", ",_", "server", "\\u", "default_", "=_", "'", "0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "email", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "255_", ")_", ",_", "nullable_", "=_", "False_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "confirm", "ed", "\\u", "at_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Date", "Time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Relationship", "s_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "profile_", "=_", "db_", "._", "relationship_", "(_", "'", "User", "Profil", "e", "'_", ",_", "usel", "ist_", "=_", "False_", ",_", "foreign", "\\u", "keys_", "=_", "[_", "user", "\\u", "profile", "\\u", "id_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "User", "Profile_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "User", " ", "information_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "name_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "50_", ")_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "name_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "50_", ")_", ",_", "nullable_", "=_", "False_", ",_", "default_", "=_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Relationship", "s_", "\\u\\u\\uNL\\u\\u\\u_", "roles_", "=_", "db_", "._", "relationship_", "(_", "'", "Ro", "le", "'_", ",_", "secondary_", "=_", "'", "user", "\\u", "role", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "backref_", "=_", "db_", "._", "backref_", "(_", "'", "users", "'_", ",_", "lazy_", "=_", "'", "dynami", "c", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "Ro", "le", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Role_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "String_", "(_", "50_", ")_", ",_", "unique_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "User", "Ro", "les", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "User", "Roles_", "(_", "db_", "._", "Model_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", "(_", ")_", ",_", "primary", "\\u", "key_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "profile", "\\u", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", "(_", ")_", ",_", "db_", "._", "Fore", "ign", "Key_", "(_", "'", "user", "\\u", "profile", ".", "id", "'_", ",_", "ondelete_", "=_", "'", "CAS", "CA", "DE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role", "\\u", "id_", "=_", "db_", "._", "Column_", "(_", "db_", "._", "Integer_", "(_", ")_", ",_", "db_", "._", "Fore", "ign", "Key_", "(_", "'", "role", ".", "id", "'_", ",_", "ondelete_", "=_", "'", "CAS", "CA", "DE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reset", " ", "all", " ", "the", " ", "databa", "se", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "._", "create", "\\u", "all_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", "up", " ", "Fla", "sk", "-", "User_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "adapter_", "=_", "SQL", "Al", "chem", "y", "Adapter_", "(_", "db_", ",_", "User_", ",_", "User", "Profil", "e", "Class_", "=_", "User", "Profile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "manager_", "=_", "User", "Manager_", "(_", "db", "\\u", "adapter_", ",_", "app_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "'", "user", "007", "'", " ", "user", " ", "with", " ", "'", "secret", "'", " ", "and", " ", "'", "agent", "'", " ", "roles_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "User_", "._", "query_", "._", "filter_", "(_", "User_", "._", "username_", "==_", "'", "user", "007", "'_", ")_", "._", "first_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user", "\\u", "profile", "1_", "=_", "User", "Profile_", "(_", "first", "\\u", "name_", "=_", "'", "Jam", "es", "'_", ",_", "last", "\\u", "name_", "=_", "'", "Bond", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "add_", "(_", "user", "\\u", "profile", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user1_", "=_", "User_", "(_", "user", "\\u", "profile_", "=_", "user", "\\u", "profile", "1_", ",_", "username_", "=_", "'", "user", "007", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "email_", "=_", "'", "user", "007", "@", "example", ".", "com", "'_", ",_", "password_", "=_", "user", "\\u", "manager_", "._", "hash", "\\u", "password_", "(_", "'", "Passw", "ord", "1", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "active_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "add_", "(_", "user1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "profile", "1_", "._", "roles_", "._", "append_", "(_", "Role_", "(_", "name_", "=_", "'", "secret", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "profile", "1_", "._", "roles_", "._", "append_", "(_", "Role_", "(_", "name_", "=_", "'", "agent", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Home", " ", "page", " ", "is", " ", "accessible", " ", "to", " ", "any", "one_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "home", "\\u", "page_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "template", "\\u", "string_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "extend", "s", " ", "\"", "base", ".", "html", "\"", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "block", " ", "content", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "<", "h2", ">", "Home", " ", "page", "</", "h2", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", ">", "Thi", "s", " ", "page", " ", "can", " ", "be", " ", "accesse", "d", " ", "by", " ", "any", "one", ".", "</", "p", "><", "br", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "home", "\\u", "page", "')", " ", "}}", ">", "Home", " ", "page", "</", "a", ">", " ", "(", "any", "one", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "member", "s", "\\u", "page", "')", " ", "}}", ">", "Mem", "bers", " ", "page", "</", "a", ">", " ", "(", "login", " ", "require", "d", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "special", "\\u", "page", "')", " ", "}}", ">", "Special", " ", "page", "</", "a", ">", " ", "(", "login", " ", "with", " ", "user", "name", " ", "'", "user", "007", "'", " ", "and", " ", "password", " ", "'", "Passw", "ord", "1", "')", "</", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "end", "block", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Mem", "bers", " ", "page", " ", "is", " ", "only", " ", "accessible", " ", "to", " ", "authenticat", "ed", " ", "users_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "member", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "login", "\\u", "required_", "#", " ", "Us", "e", " ", "of", " ", "@", "login", "\\u", "require", "d", " ", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "member", "s", "\\u", "page_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "template", "\\u", "string_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "extend", "s", " ", "\"", "base", ".", "html", "\"", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "block", " ", "content", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "<", "h2", ">", "Mem", "bers", " ", "page", "</", "h2", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", ">", "Thi", "s", " ", "page", " ", "can", " ", "only", " ", "be", " ", "accesse", "d", " ", "by", " ", "authenticat", "ed", " ", "users", ".", "</", "p", "><", "br", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "home", "\\u", "page", "')", " ", "}}", ">", "Home", " ", "page", "</", "a", ">", " ", "(", "any", "one", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "member", "s", "\\u", "page", "')", " ", "}}", ">", "Mem", "bers", " ", "page", "</", "a", ">", " ", "(", "login", " ", "require", "d", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "special", "\\u", "page", "')", " ", "}}", ">", "Special", " ", "page", "</", "a", ">", " ", "(", "login", " ", "with", " ", "user", "name", " ", "'", "user", "007", "'", " ", "and", " ", "password", " ", "'", "Passw", "ord", "1", "')", "</", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "end", "block", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Special", " ", "page", " ", "require", "s", " ", "a", " ", "user", " ", "with", " ", "'", "special", "'", " ", "and", " ", "'", "sau", "ce", "'", " ", "role", "s", " ", "or", " ", "with", " ", "'", "special", "'", " ", "and", " ", "'", "agent", "'", " ", "role", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "app_", "._", "route_", "(_", "'/", "special", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "role", "s", "\\u", "required_", "(_", "'", "secret", "'_", ",_", "[_", "'", "sau", "ce", "'_", ",_", "'", "agent", "'_", "]_", ")_", "#", " ", "Us", "e", " ", "of", " ", "@", "role", "s", "\\u", "require", "d", " ", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "special", "\\u", "page_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "template", "\\u", "string_", "(_", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "extend", "s", " ", "\"", "base", ".", "html", "\"", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "{%", " ", "block", " ", "content", " ", "%}", "\\", "10", ";", " ", " ", " ", " ", "<", "h2", ">", "Special", " ", "Page", "</", "h2", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", ">", "Thi", "s", " ", "page", " ", "can", " ", "only", " ", "be", " ", "accesse", "d", " ", "by", " ", "user", "007", ".", "</", "p", "><", "br", "/>", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "home", "\\u", "page", "')", " ", "}}", ">", "Home", " ", "page", "</", "a", ">", " ", "(", "any", "one", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "member", "s", "\\u", "page", "')", " ", "}}", ">", "Mem", "bers", " ", "page", "</", "a", ">", " ", "(", "login", " ", "require", "d", ")<", "/", "p", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "p", "><", "a", " ", "href", "={", "{", " ", "url", "\\u", "for", "('", "special", "\\u", "page", "')", " ", "}}", ">", "Special", " ", "page", "</", "a", ">", " ", "(", "login", " ", "with", " ", "user", "name", " ", "'", "user", "007", "'", " ", "and", " ", "password", " ", "'", "Passw", "ord", "1", "')", "</", "p", ">", "\\", "10", ";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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 ]
Imprecise assert
dchaplinsky/unshred-tag/tests/tagging.py
[ { "content": " def test_index_not_logged(self):\n res = self.client.get(url_for(\"index\"))\n\n self.assert200(res)\n body = res.get_data(as_text=True)\n self.assertTrue(\"warm-welcome\" in body)\n self.assertTrue(url_for(\"social.auth\", backend=\"facebook\") in body)\n self.assertTrue(url_for(\"social.auth\", backend=\"twitter\") in body)\n self.assertTrue(\n url_for(\"social.auth\", backend=\"google-oauth2\") in body)\n self.assertTrue(\n url_for(\"social.auth\", backend=\"vk-oauth2\") in body)", "metadata": "root.TaggingTest.test_index_not_logged", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 13 }, { "content": " def test_index_logged(self):\n self.create_user_and_login(\"user\")\n\n res = self.client.get(url_for(\"index\"))\n\n self.assert200(res)\n body = res.get_data(as_text=True)\n\n self.assertFalse(\"warm-welcome\" in body)\n self.assertFalse(url_for(\"social.auth\", backend=\"facebook\") in body)\n self.assertFalse(url_for(\"social.auth\", backend=\"twitter\") in body)\n self.assertFalse(\n url_for(\"social.auth\", backend=\"google-oauth2\") in body)\n self.assertFalse(\n url_for(\"social.auth\", backend=\"vk-oauth2\") in body)\n\n for tag in Tags.objects(is_base=True):\n self.assertTrue(tag.title.lower() in body.lower())\n self.assertTrue(tag.category.lower() in body.lower())\n if tag.hotkey:\n self.assertTrue(tag.hotkey in body.lower())", "metadata": "root.TaggingTest.test_index_logged", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_no_more_tasks(self):\n self.create_user_and_login(\"user\")\n\n res = self.client.get(url_for(\"next\"))\n\n self.assert200(res)\n body = res.get_data(as_text=True)\n\n self.assertFalse(\"shred_id\" in body)\n self.assertFalse(url_for(\"next\") in body)", "metadata": "root.TaggingTest.test_no_more_tasks", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 48 }, { "content": " def test_has_some_tasks(self):\n self.create_user_and_login(\"user\")\n\n self.client.post(url_for(\"fixtures.create_shreds\"))\n\n res = self.client.get(url_for(\"next\"))\n self.assert200(res)\n body = res.get_data(as_text=True)\n\n self.assertTrue(\"item_id\" in body)\n self.assertTrue(url_for(\"next\") in body)\n\n for tag in Tags.objects(is_base=True):\n self.assertTrue(\n tag.title.capitalize().encode('unicode-escape') in body)", "metadata": "root.TaggingTest.test_has_some_tasks", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 59 }, { "content": " def test_user_tags_in_task(self):\n self.create_user_and_login(\"user\")\n\n self.client.post(url_for(\"fixtures.create_shreds\"))\n\n user = User.objects.get(username=\"user\")\n admin = User.objects.get(username=\"admin\")\n user_tag = \"foobar\"\n another_user_tag = \"barfoo\"\n\n Tags.objects.create(title=user_tag, is_base=False,\n created_by=user)\n Tags.objects.create(title=another_user_tag, is_base=False,\n created_by=admin)\n\n user.tags = [user_tag]\n admin.tags = [another_user_tag]\n user.save()\n admin.save()\n\n res = self.client.get(url_for(\"next\"))\n self.assert200(res)\n body = res.get_data(as_text=True)\n\n self.assertTrue(\n user_tag.capitalize().encode('unicode-escape') in body)\n pos = body.index(user_tag.capitalize().encode('unicode-escape'))\n\n self.assertFalse(\n another_user_tag.capitalize().encode('unicode-escape') in body)\n\n for tag in Tags.objects(is_base=True):\n tag = tag.title.capitalize().encode('unicode-escape')\n self.assertTrue(tag in body)\n\n self.assertTrue(body.index(tag) < pos)", "metadata": "root.TaggingTest.test_user_tags_in_task", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_tags_ordering_in_task(self):\n self.create_user_and_login(\"user\")\n self.client.post(url_for(\"fixtures.create_shreds\"))\n\n first_tag = Tags.objects[0]\n new_first_tag = Tags.objects[1]\n\n new_first_tag.usages = 100\n new_first_tag.save()\n\n res = self.client.get(url_for(\"next\"))\n self.assert200(res)\n body = res.get_data(as_text=True)\n\n self.assertTrue(\n body.index(first_tag.title.capitalize().encode('unicode-escape')) >\n body.index(\n new_first_tag.title.capitalize().encode('unicode-escape'))\n )", "metadata": "root.TaggingTest.test_tags_ordering_in_task", "header": "['class', 'TaggingTest', '(', 'BasicTestCase', ')', ':', '___EOS___']", "index": 112 } ]
[ { "span": "self.assertTrue(\"warm-welcome\" in body)", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 47 }, { "span": "self.assertTrue(url_for(\"social.auth\", backend=\"facebook\") in body)", "start_line": 19, "start_column": 8, "end_line": 19, "end_column": 75 }, { "span": "self.assertTrue(url_for(\"social.auth\", backend=\"twitter\") in body)", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 74 }, { "span": "self.assertTrue(\n url_for(\"social.auth\", backend=\"google-oauth2\") in body)", "start_line": 21, "start_column": 8, "end_line": 22, "end_column": 68 }, { "span": "self.assertTrue(\n url_for(\"social.auth\", backend=\"vk-oauth2\") in body)", "start_line": 23, "start_column": 8, "end_line": 24, "end_column": 64 }, { "span": "self.assertFalse(\"warm-welcome\" in body)", "start_line": 34, "start_column": 8, "end_line": 34, "end_column": 48 }, { "span": "self.assertFalse(url_for(\"social.auth\", backend=\"facebook\") in body)", "start_line": 35, "start_column": 8, "end_line": 35, "end_column": 76 }, { "span": "self.assertFalse(url_for(\"social.auth\", backend=\"twitter\") in body)", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 75 }, { "span": "self.assertFalse(\n url_for(\"social.auth\", backend=\"google-oauth2\") in body)", "start_line": 37, "start_column": 8, "end_line": 38, "end_column": 68 }, { "span": "self.assertFalse(\n url_for(\"social.auth\", backend=\"vk-oauth2\") in body)", "start_line": 39, "start_column": 8, "end_line": 40, "end_column": 64 }, { "span": "self.assertTrue(tag.title.lower() in body.lower())", "start_line": 43, "start_column": 12, "end_line": 43, "end_column": 62 }, { "span": "self.assertTrue(tag.category.lower() in body.lower())", "start_line": 44, "start_column": 12, "end_line": 44, "end_column": 65 }, { "span": "self.assertTrue(tag.hotkey in body.lower())", "start_line": 46, "start_column": 16, "end_line": 46, "end_column": 59 }, { "span": "self.assertFalse(\"shred_id\" in body)", "start_line": 56, "start_column": 8, "end_line": 56, "end_column": 44 }, { "span": "self.assertFalse(url_for(\"next\") in body)", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 49 }, { "span": "self.assertTrue(\"item_id\" in body)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 42 }, { "span": "self.assertTrue(url_for(\"next\") in body)", "start_line": 69, "start_column": 8, "end_line": 69, "end_column": 48 }, { "span": "self.assertTrue(\n tag.title.capitalize().encode('unicode-escape') in body)", "start_line": 72, "start_column": 12, "end_line": 73, "end_column": 72 }, { "span": "self.assertTrue(\n user_tag.capitalize().encode('unicode-escape') in body)", "start_line": 99, "start_column": 8, "end_line": 100, "end_column": 67 }, { "span": "self.assertFalse(\n another_user_tag.capitalize().encode('unicode-escape') in body)", "start_line": 103, "start_column": 8, "end_line": 104, "end_column": 75 }, { "span": "self.assertTrue(tag in body)", "start_line": 108, "start_column": 12, "end_line": 108, "end_column": 40 }, { "span": "self.assertTrue(body.index(tag) < pos)", "start_line": 110, "start_column": 12, "end_line": 110, "end_column": 50 }, { "span": "self.assertTrue(\n body.index(first_tag.title.capitalize().encode('unicode-escape')) >\n body.index(\n new_first_tag.title.capitalize().encode('unicode-escape'))\n )", "start_line": 126, "start_column": 8, "end_line": 130, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "index", "\\u", "not", "\\u", "logged", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "index", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "warm", "-", "welcome", "\"_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "facebook", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "twit", "ter", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "google", "-", "oauth2", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "vk", "-", "oauth2", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "index", "\\u", "logged", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "user", "\\u", "and", "\\u", "login_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "index", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "warm", "-", "welcome", "\"_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "facebook", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "twit", "ter", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "google", "-", "oauth2", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "url", "\\u", "for_", "(_", "\"", "social", ".", "auth", "\"_", ",_", "backend_", "=_", "\"", "vk", "-", "oauth2", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "tag_", "in_", "Tags_", "._", "objects_", "(_", "is", "\\u", "base_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "tag_", "._", "title_", "._", "lower_", "(_", ")_", "in_", "body_", "._", "lower_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tag_", "._", "category_", "._", "lower_", "(_", ")_", "in_", "body_", "._", "lower_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "tag_", "._", "hotkey", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "tag_", "._", "hotkey", "_", "in_", "body_", "._", "lower_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "more", "\\u", "tasks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "user", "\\u", "and", "\\u", "login_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\"", "shr", "ed", "\\u", "id", "\"_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "has", "\\u", "some", "\\u", "tasks_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "user", "\\u", "and", "\\u", "login_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "url", "\\u", "for_", "(_", "\"", "fixture", "s", ".", "create", "\\u", "shr", "eds", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "item", "\\u", "id", "\"_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "tag_", "in_", "Tags_", "._", "objects_", "(_", "is", "\\u", "base_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "tag_", "._", "title_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "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", "user", "\\u", "tags", "\\u", "in", "\\u", "task_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "user", "\\u", "and", "\\u", "login_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "url", "\\u", "for_", "(_", "\"", "fixture", "s", ".", "create", "\\u", "shr", "eds", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin_", "=_", "User_", "._", "objects_", "._", "get_", "(_", "username_", "=_", "\"", "admin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "tag_", "=_", "\"", "fooba", "r", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "anot", "her", "\\u", "user", "\\u", "tag_", "=_", "\"", "bar", "foo", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "Tags_", "._", "objects_", "._", "create_", "(_", "title_", "=_", "user", "\\u", "tag_", ",_", "is", "\\u", "base_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "created", "\\u", "by_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Tags_", "._", "objects_", "._", "create_", "(_", "title_", "=_", "anot", "her", "\\u", "user", "\\u", "tag_", ",_", "is", "\\u", "base_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "created", "\\u", "by_", "=_", "admin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "._", "tags_", "=_", "[_", "user", "\\u", "tag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin_", "._", "tags_", "=_", "[_", "anot", "her", "\\u", "user", "\\u", "tag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "admin_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "user", "\\u", "tag_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "body_", "._", "index_", "(_", "user", "\\u", "tag_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "anot", "her", "\\u", "user", "\\u", "tag_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "tag_", "in_", "Tags_", "._", "objects_", "(_", "is", "\\u", "base_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag_", "=_", "tag_", "._", "title_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "tag_", "in_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "body_", "._", "index_", "(_", "tag_", ")_", "<_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Tagg", "ing", "Test_", "(_", "Basic", "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", "tags", "\\u", "orderi", "ng", "\\u", "in", "\\u", "task_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "create", "\\u", "user", "\\u", "and", "\\u", "login_", "(_", "\"", "user", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "._", "post_", "(_", "url", "\\u", "for_", "(_", "\"", "fixture", "s", ".", "create", "\\u", "shr", "eds", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "tag_", "=_", "Tags_", "._", "objects_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "first", "\\u", "tag_", "=_", "Tags_", "._", "objects_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "first", "\\u", "tag_", "._", "usages_", "=_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "first", "\\u", "tag_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "client_", "._", "get_", "(_", "url", "\\u", "for_", "(_", "\"", "next", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "200_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "res_", "._", "get", "\\u", "data_", "(_", "as", "\\u", "text_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "body_", "._", "index_", "(_", "first", "\\u", "tag_", "._", "title_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", ")_", ">_", "\\u\\u\\uNL\\u\\u\\u_", "body_", "._", "index_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "first", "\\u", "tag_", "._", "title_", "._", "capitalize_", "(_", ")_", "._", "encode_", "(_", "'", "unicode", "-", "escape", "'_", ")_", ")_", "\\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, 0, 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,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unused import
ilastik/ilastik-0.5/ilastik/modules/connected_components/gui/__init__.py
[ { "content": "import connectedComponentsRibbon\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import connectedComponentsRibbon", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 32 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "connect", "ed", "Compo", "nent", "s", "Rib", "bon", "_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1 ]
Except block handles 'BaseException'
tienfuc/gdcmdtools/gdcmdtools/put.py
[ { "content": " def if_folder_writable(self):\n try:\n permissions = self.service.permissions().list(fileId=self.folder_id).execute()\n valid_roles = [\"writer\", \"owner\"]\n logger.debug(pprint.pformat(permissions))\n for p in permissions[\"items\"]:\n email = p.get(\"emailAddress\", None).lower()\n role = p.get(\"role\", None).lower()\n\n logger.debug(\"email: %s, role: %s\" % (email, role))\n\n if(email == self.auth_user) and (role in valid_roles):\n return True\n except:\n return False\n\n return False", "metadata": "root.GDPut.if_folder_writable", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 92 }, { "content": " def gas_pack(self):\n map_type_ext = {\"server_js\": \"js\", \"html\": \"html\"}\n json_packed = {}\n try:\n with open(self.source_file, \"rb\") as fr1:\n jsons = json.loads(fr1.read())\n\n path = os.path.split(self.source_file)[0]\n for j in jsons[\"files\"]:\n file_name = os.path.join(path, \"%s.%s\" % (\n j[\"name\"], map_type_ext[j[\"type\"]]))\n with open(file_name, \"rb\") as fr2:\n file_content = fr2.read()\n\n j[\"source\"] = file_content\n\n new_json = \"%s.packed\" % self.source_file\n with open(new_json, \"wb+\") as fw:\n fw.write(json.dumps(jsons, indent=4))\n except:\n return False\n else:\n return True", "metadata": "root.GDPut.gas_pack", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 160 }, { "content": " def check_csv(self):\n self.csv_delimiter = ','\n with open(self.source_file, 'rb') as csv_file:\n try:\n dialect = csv.Sniffer().sniff(csv_file.readline())\n if dialect.delimiter == self.csv_delimiter:\n return True\n except:\n logger.error(\"Failed at calling csv.Sniffer().sniff)\")\n\n return False", "metadata": "root.GDPut.check_csv", "header": "['class', 'GDPut', ':', '___EOS___']", "index": 194 } ]
[ { "span": "except:", "start_line": 105, "start_column": 8, "end_line": 105, "end_column": 15 }, { "span": "except:", "start_line": 179, "start_column": 8, "end_line": 179, "end_column": 15 }, { "span": "except:", "start_line": 201, "start_column": 12, "end_line": 201, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "if", "\\u", "folder", "\\u", "writable_", "(_", "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 ", " _", "permissions_", "=_", "self_", "._", "service_", "._", "permissions_", "(_", ")_", "._", "list_", "(_", "file", "Id_", "=_", "self_", "._", "folder", "\\u", "id_", ")_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "valid", "\\u", "roles_", "=_", "[_", "\"", "writer", "\"_", ",_", "\"", "owner", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "debug_", "(_", "pprint_", "._", "pformat_", "(_", "permissions_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "permissions_", "[_", "\"", "items", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "email_", "=_", "p_", "._", "get_", "(_", "\"", "email", "Address", "\"_", ",_", "None_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "role_", "=_", "p_", "._", "get_", "(_", "\"", "role", "\"_", ",_", "None_", ")_", "._", "lower_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "._", "debug_", "(_", "\"", "email", ":", " ", "%", "s", ",", " ", "role", ":", " ", "%", "s", "\"_", "%_", "(_", "email_", ",_", "role_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "email_", "==_", "self_", "._", "auth", "\\u", "user_", ")_", "and_", "(_", "role_", "in_", "valid", "\\u", "roles_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\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_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gas", "\\u", "pack_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map", "\\u", "type", "\\u", "ext_", "=_", "{_", "\"", "server", "\\u", "js", "\"_", ":_", "\"", "js", "\"_", ",_", "\"", "html", "\"_", ":_", "\"", "html", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "json", "\\u", "packed_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "self_", "._", "source", "\\u", "file_", ",_", "\"", "rb", "\"_", ")_", "as_", "fr", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsons", "_", "=_", "json_", "._", "loads_", "(_", "fr", "1_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "path_", "=_", "os_", "._", "path_", "._", "split_", "(_", "self_", "._", "source", "\\u", "file_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "jsons", "_", "[_", "\"", "files", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "file", "\\u", "name_", "=_", "os_", "._", "path_", "._", "join_", "(_", "path_", ",_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "j_", "[_", "\"", "name", "\"_", "]_", ",_", "map", "\\u", "type", "\\u", "ext_", "[_", "j_", "[_", "\"", "type", "\"_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "file", "\\u", "name_", ",_", "\"", "rb", "\"_", ")_", "as_", "fr", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "file", "\\u", "content_", "=_", "fr", "2_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "[_", "\"", "source", "\"_", "]_", "=_", "file", "\\u", "content_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "json_", "=_", "\"%", "s", ".", "pack", "ed", "\"_", "%_", "self_", "._", "source", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "new", "\\u", "json_", ",_", "\"", "wb", "+\"_", ")_", "as_", "fw_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fw_", "._", "write_", "(_", "json_", "._", "dumps_", "(_", "jsons", "_", ",_", "indent_", "=_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "GD", "Put", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "\\u", "csv_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "csv", "\\u", "delimiter_", "=_", "','_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "self_", "._", "source", "\\u", "file_", ",_", "'", "rb", "'_", ")_", "as_", "csv", "\\u", "file_", ":_", "\\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 ", " _", "dialect_", "=_", "csv_", "._", "Sni", "ffer", "_", "(_", ")_", "._", "sniff", "_", "(_", "csv", "\\u", "file_", "._", "readline_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dialect_", "._", "delimiter_", "==_", "self_", "._", "csv", "\\u", "delimiter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "error_", "(_", "\"", "Fail", "ed", " ", "at", " ", "calling", " ", "csv", ".", "Sni", "ffer", "()", ".", "sniff", ")\"_", ")_", "\\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_" ]
[ 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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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, 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 ]
Unused import
mrknow/filmkodi/plugin.video.specto/resources/lib/sources/rainierland_mv.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,urlparse, json\n\nfrom resources.lib.libraries import cleantitle\nfrom resources.lib.libraries import client2\nfrom resources.lib.libraries import client\nfrom resources.lib.libraries import control\nfrom resources.lib import resolvers\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class source:\n\n\n\n\n\n\n\n\n\n", "metadata": "root.source", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def __init__(self):\n self.base_link = 'http://rainierland.com'\n self.search_link = '/?s=%s'", "metadata": "root.source.__init__", "header": "['class', 'source', ':', '___EOS___']", "index": 32 }, { "content": " def get_movie(self, imdb, title, year):\n try:\n query = self.search_link % urllib.quote(title)\n query = urlparse.urljoin(self.base_link, query)\n #control.log(\"rainierland-0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % query)\n result = client2.http_get(query)\n title = cleantitle.movie(title)\n years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]\n r = client.parseDOM(result, 'div', attrs = {'class': 'thumb'})\n #control.log(\"rainierland-1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n\n r = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a', ret='title')) for i in r]\n #control.log(\"rainierland-2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n\n r = [(i[0][0], i[1][-1]) for i in r if len(i[0]) > 0 and len(i[1]) > 0]\n #control.log(\"rainierland-3 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n\n r = [(re.sub('http.+?//.+?/','', i[0]), i[1]) for i in r]\n #control.log(\"rainierland-4 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n\n r = [('/'.join(i[0].split('/')[:2]), i[1]) for i in r]\n r = [x for y,x in enumerate(r) if x not in r[:y]]\n r = [i for i in r if title == cleantitle.movie(i[1])]\n u = [i[0] for i in r][0]\n\n url = urlparse.urljoin(self.base_link, u)\n url = urlparse.urlparse(url).path\n url = client.replaceHTMLCodes(url)\n url = url.encode('utf-8')\n #control.log(\"rainierland url @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % url)\n\n return url\n except:\n return", "metadata": "root.source.get_movie", "header": "['class', 'source', ':', '___EOS___']", "index": 37 }, { "content": " def get_show(self, imdb, tvdb, tvshowtitle, year):\n try:\n url = '%s (%s)' % (tvshowtitle, year)\n url = client.replaceHTMLCodes(url)\n url = url.encode('utf-8')\n return url\n except:\n return", "metadata": "root.source.get_show", "header": "['class', 'source', ':', '___EOS___']", "index": 73 }, { "content": " def get_episode(self, url, imdb, tvdb, title, date, season, episode):\n try:\n tvshowtitle, year = re.compile('(.+?) [(](\\d{4})[)]$').findall(url)[0]\n\n query = self.search_link % urllib.quote(tvshowtitle)\n query = urlparse.urljoin(self.base_link, query)\n\n result = client.source(query)\n\n tvshowtitle = cleantitle.tv(tvshowtitle)\n season = '%01d' % int(season)\n episode = '%01d' % int(episode)\n years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]\n\n result = client.parseDOM(result, 'div', attrs = {'class': 'ml-item'})\n result = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'h2'), re.compile('class *= *[\\'|\\\"]jt-info[\\'|\\\"]>(\\d{4})<').findall(i)) for i in result]\n result = [(i[0][0], i[1][0], i[2][0]) for i in result if len(i[0]) > 0 and len(i[1]) > 0 and len(i[2]) > 0]\n result = [(i[0], re.compile('(.+?) - Season (\\d*)$').findall(i[1]), i[2]) for i in result]\n result = [(i[0], i[1][0][0], i[1][0][1], i[2]) for i in result if len(i[1]) > 0]\n result = [i for i in result if tvshowtitle == cleantitle.tv(i[1])]\n result = [i for i in result if season == i[2]]\n result = [(i[0], i[1], str(int(i[3]) - int(i[2]) + 1)) for i in result]\n result = [i[0] for i in result if any(x in i[2] for x in years)][0]\n\n result += '?S%02dE%02d' % (int(season), int(episode))\n\n try: url = re.compile('//.+?(/.+)').findall(result)[0]\n except: url = result\n url = client.replaceHTMLCodes(url)\n url = url.encode('utf-8')\n return url\n except:\n return", "metadata": "root.source.get_episode", "header": "['class', 'source', ':', '___EOS___']", "index": 83 }, { "content": " def get_sources(self, url, hosthdDict, hostDict, locDict):\n sources = []\n #control.log(\"rainierland-sources-0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ \")\n\n try:\n r = urlparse.urljoin(self.base_link, url)\n\n result = client2.http_get(r)\n #control.log(\"rainierland-sources-1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % result)\n r = client.parseDOM(result, 'div', attrs = {'class': 'screen fluid-width-video-wrapper'})[0]\n #control.log(\"rainierland-sources-2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n r = re.compile('src=\"(.*?)\"').findall(r)\n #control.log(\"rainierland-sources-3 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r)\n if len(r) > 0:\n t = urlparse.urljoin(self.base_link, r[0])\n r2 = client2.http_get(t)\n #control.log(\"rainierland-sources-4 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r2)\n r3 = re.compile('<source src=\"(.*?)\"').findall(r2)\n for i in r3:\n try:\n sources.append({'source': 'gvideo', 'quality': client.googletag(i)[0]['quality'], 'provider': 'Rainierland', 'url': i})\n except:\n pass\n #control.log(\"rainierland-sources-5 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r3)\n r4 = client.parseDOM(r2, 'a', ret='href')\n #control.log(\"rainierland-sources-5 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ %s\" % r4)\n for i in r4:\n try:\n url = resolvers.request(i)\n sources.append({'source': 'openload', 'quality': 'HD', 'provider': 'Rainierland', 'url': url})\n except:\n pass\n\n return sources\n\n except:\n return sources", "metadata": "root.source.get_sources", "header": "['class', 'source', ':', '___EOS___']", "index": 118 }, { "content": " def resolve(self, url):\n try:\n if 'requiressl=yes' in url: url = url.replace('http://', 'https://')\n else: url = url.replace('https://', 'http://')\n return url\n except:\n pass", "metadata": "root.source.resolve", "header": "['class', 'source', ':', '___EOS___']", "index": 157 } ]
[ { "span": "import re,urllib,urlparse, json", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 31 }, { "span": "from resources.lib.libraries import control", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 43 } ]
[]
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_", ",_", "urlparse_", ",_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "resources_", "._", "lib_", "._", "libraries_", "import_", "clean", "title_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resources_", "._", "lib_", "._", "libraries_", "import_", "client", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resources_", "._", "lib_", "._", "libraries_", "import_", "client_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resources_", "._", "lib_", "._", "libraries_", "import_", "control_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "resources_", "._", "lib_", "import_", "resolver", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "source_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "base", "\\u", "link_", "=_", "'", "http", "://", "rain", "ier", "land", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "search", "\\u", "link_", "=_", "'/", "?", "s", "=", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "movie_", "(_", "self_", ",_", "imdb_", ",_", "title_", ",_", "year_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "self_", "._", "search", "\\u", "link_", "%_", "urllib_", "._", "quote_", "(_", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "urlparse_", "._", "urljoin_", "(_", "self_", "._", "base", "\\u", "link_", ",_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-0", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "query", ")_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client", "2_", "._", "http", "\\u", "get_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "title_", "=_", "clean", "title_", "._", "movie_", "(_", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "years_", "=_", "[_", "'%", "s", "'_", "%_", "str_", "(_", "year_", ")_", ",_", "'%", "s", "'_", "%_", "str_", "(_", "int_", "(_", "year_", ")_", "+_", "1_", ")_", ",_", "'%", "s", "'_", "%_", "str_", "(_", "int_", "(_", "year_", ")_", "-_", "1_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "div", "'_", ",_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "thumb", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-1", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "[_", "(_", "client_", "._", "parse", "DOM_", "(_", "i_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", ",_", "client_", "._", "parse", "DOM_", "(_", "i_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "title", "'_", ")_", ")_", "for_", "i_", "in_", "r_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "2", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "[_", "(_", "i_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "-_", "1_", "]_", ")_", "for_", "i_", "in_", "r_", "if_", "len_", "(_", "i_", "[_", "0_", "]_", ")_", ">_", "0_", "and_", "len_", "(_", "i_", "[_", "1_", "]_", ")_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "3", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "[_", "(_", "re_", "._", "sub_", "(_", "'", "http", ".+?", "//", ".+?", "/'_", ",_", "''_", ",_", "i_", "[_", "0_", "]_", ")_", ",_", "i_", "[_", "1_", "]_", ")_", "for_", "i_", "in_", "r_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "4", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "[_", "(_", "'/'_", "._", "join_", "(_", "i_", "[_", "0_", "]_", "._", "split_", "(_", "'/'_", ")_", "[_", ":_", "2_", "]_", ")_", ",_", "i_", "[_", "1_", "]_", ")_", "for_", "i_", "in_", "r_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "[_", "x_", "for_", "y_", ",_", "x_", "in_", "enumerate_", "(_", "r_", ")_", "if_", "x_", "not_", "in_", "r_", "[_", ":_", "y_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r_", "=_", "[_", "i_", "for_", "i_", "in_", "r_", "if_", "title_", "==_", "clean", "title_", "._", "movie_", "(_", "i_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u_", "=_", "[_", "i_", "[_", "0_", "]_", "for_", "i_", "in_", "r_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "urlparse_", "._", "urljoin_", "(_", "self_", "._", "base", "\\u", "link_", ",_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "replace", "HTM", "LC", "odes_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "url_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", " ", "url", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "url", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\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", "show_", "(_", "self_", ",_", "imdb_", ",_", "tvdb", "_", ",_", "tvshow", "title_", ",_", "year_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'%", "s", " ", "(%", "s", ")'_", "%_", "(_", "tvshow", "title_", ",_", "year_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "replace", "HTM", "LC", "odes_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "url_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\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", "episode_", "(_", "self_", ",_", "url_", ",_", "imdb_", ",_", "tvdb", "_", ",_", "title_", ",_", "date_", ",_", "season_", ",_", "episode_", ")_", ":_", "\\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 ", " _", "tvshow", "title_", ",_", "year_", "=_", "re_", "._", "compile_", "(_", "'(", ".+?)", " ", "[(", "](", "\\\\", "d", "{", "4", "})", "[", ")]", "$'_", ")_", "._", "findall_", "(_", "url_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "self_", "._", "search", "\\u", "link_", "%_", "urllib_", "._", "quote_", "(_", "tvshow", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "urlparse_", "._", "urljoin_", "(_", "self_", "._", "base", "\\u", "link_", ",_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "source_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tvshow", "title_", "=_", "clean", "title_", "._", "tv_", "(_", "tvshow", "title_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "season_", "=_", "'%", "01", "d", "'_", "%_", "int_", "(_", "season_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "episode_", "=_", "'%", "01", "d", "'_", "%_", "int_", "(_", "episode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "years_", "=_", "[_", "'%", "s", "'_", "%_", "str_", "(_", "year_", ")_", ",_", "'%", "s", "'_", "%_", "str_", "(_", "int_", "(_", "year_", ")_", "+_", "1_", ")_", ",_", "'%", "s", "'_", "%_", "str_", "(_", "int_", "(_", "year_", ")_", "-_", "1_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "div", "'_", ",_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "ml", "-", "item", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "(_", "client_", "._", "parse", "DOM_", "(_", "i_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", ",_", "client_", "._", "parse", "DOM_", "(_", "i_", ",_", "'", "h2", "'_", ")_", ",_", "re_", "._", "compile_", "(_", "'", "class", " ", "*=", " ", "*[", "\\\\'", "|\\\\", "\"]", "jt", "-", "info", "[\\\\'", "|\\\\", "\"]", ">(", "\\\\", "d", "{", "4", "})", "<'_", ")_", "._", "findall_", "(_", "i_", ")_", ")_", "for_", "i_", "in_", "result_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "(_", "i_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "i_", "[_", "2_", "]_", "[_", "0_", "]_", ")_", "for_", "i_", "in_", "result_", "if_", "len_", "(_", "i_", "[_", "0_", "]_", ")_", ">_", "0_", "and_", "len_", "(_", "i_", "[_", "1_", "]_", ")_", ">_", "0_", "and_", "len_", "(_", "i_", "[_", "2_", "]_", ")_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "(_", "i_", "[_", "0_", "]_", ",_", "re_", "._", "compile_", "(_", "'(", ".+?)", " ", "-", " ", "Season", " ", "(\\\\", "d", "*)", "$'_", ")_", "._", "findall_", "(_", "i_", "[_", "1_", "]_", ")_", ",_", "i_", "[_", "2_", "]_", ")_", "for_", "i_", "in_", "result_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ",_", "i_", "[_", "2_", "]_", ")_", "for_", "i_", "in_", "result_", "if_", "len_", "(_", "i_", "[_", "1_", "]_", ")_", ">_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "i_", "for_", "i_", "in_", "result_", "if_", "tvshow", "title_", "==_", "clean", "title_", "._", "tv_", "(_", "i_", "[_", "1_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "i_", "for_", "i_", "in_", "result_", "if_", "season_", "==_", "i_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "(_", "i_", "[_", "0_", "]_", ",_", "i_", "[_", "1_", "]_", ",_", "str_", "(_", "int_", "(_", "i_", "[_", "3_", "]_", ")_", "-_", "int_", "(_", "i_", "[_", "2_", "]_", ")_", "+_", "1_", ")_", ")_", "for_", "i_", "in_", "result_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "[_", "i_", "[_", "0_", "]_", "for_", "i_", "in_", "result_", "if_", "any_", "(_", "x_", "in_", "i_", "[_", "2_", "]_", "for_", "x_", "in_", "years_", ")_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "+=_", "'?", "S", "%", "02", "d", "E", "%", "02", "d", "'_", "%_", "(_", "int_", "(_", "season_", ")_", ",_", "int_", "(_", "episode_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "url_", "=_", "re_", "._", "compile_", "(_", "'//", ".+?", "(/", ".+)", "'_", ")_", "._", "findall_", "(_", "result_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "url_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "replace", "HTM", "LC", "odes_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "url_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\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", "sources_", "(_", "self_", ",_", "url_", ",_", "host", "hd", "Dict_", ",_", "host", "Dict_", ",_", "loc", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sources_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-0", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "\")", "_", "\\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 ", " _", "r_", "=_", "urlparse_", "._", "urljoin_", "(_", "self_", "._", "base", "\\u", "link_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client", "2_", "._", "http", "\\u", "get_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-1", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "result", ")_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "div", "'_", ",_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "screen", " ", "fluid", "-", "widt", "h", "-", "video", "-", "wrapp", "er", "'_", "}_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-", "2", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "re_", "._", "compile_", "(_", "'", "src", "=\"(", ".*?)", "\"'_", ")_", "._", "findall_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-", "3", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "r_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "urlparse_", "._", "urljoin_", "(_", "self_", "._", "base", "\\u", "link_", ",_", "r_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r2_", "=_", "client", "2_", "._", "http", "\\u", "get_", "(_", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-", "4", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "r3_", "=_", "re_", "._", "compile_", "(_", "'<", "source", " ", "src", "=\"(", ".*?)", "\"'_", ")_", "._", "findall_", "(_", "r2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "r3_", ":_", "\\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 ", " ", " _", "sources_", "._", "append_", "(_", "{_", "'", "source", "'_", ":_", "'", "gv", "ideo", "'_", ",_", "'", "quali", "ty", "'_", ":_", "client_", "._", "google", "tag_", "(_", "i_", ")_", "[_", "0_", "]_", "[_", "'", "quali", "ty", "'_", "]_", ",_", "'", "provide", "r", "'_", ":_", "'", "Rain", "ier", "land", "'_", ",_", "'", "url", "'_", ":_", "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 ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-", "5", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r3", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r4", "_", "=_", "client_", "._", "parse", "DOM_", "(_", "r2_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "control", ".", "log", "(\"", "rain", "ier", "land", "-", "source", "s", "-", "5", " ", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", "@@@@", " ", "%", "s", "\"", " ", "%", " ", "r4", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "r4", "_", ":_", "\\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 ", " ", " _", "url_", "=_", "resolver", "s_", "._", "request_", "(_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sources_", "._", "append_", "(_", "{_", "'", "source", "'_", ":_", "'", "openl", "oad", "'_", ",_", "'", "quali", "ty", "'_", ":_", "'", "HD", "'_", ",_", "'", "provide", "r", "'_", ":_", "'", "Rain", "ier", "land", "'_", ",_", "'", "url", "'_", ":_", "url_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sources_", "\\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 ", " _", "return_", "sources_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "source_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "resolve_", "(_", "self_", ",_", "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 ", " _", "if_", "'", "require", "ssl", "=", "ye", "s", "'_", "in_", "url_", ":_", "url_", "=_", "url_", "._", "replace_", "(_", "'", "http", "://'_", ",_", "'", "https", "://'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "url_", "=_", "url_", "._", "replace_", "(_", "'", "https", "://'_", ",_", "'", "http", "://'_", ")_", "\\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_", "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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
charles-vdulac/django-roa/examples/django_roa_server/__init__.py
[ { "content": "import emitters\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import emitters", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "emitte", "rs_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 1, 1 ]
Except block handles 'BaseException'
OrbitzWorldwide/droned/droned/lib/droned/responders/core.py
[ { "content": "@responder(pattern=\"^!(?P<source>.+)\", form=\"!<code>\", help=\"Execute some python code\")\ndef python(conversation, source):\n from droned.entity import namespace\n source = source.strip()\n try:\n code = compile(source, '<jabber>', 'eval')\n except:\n try:\n code = compile(source, '<jabber>', 'single')\n except:\n msg = \"I couldn't compile your code.\\n%s\" % traceback.format_exc()\n conversation.say(msg, useHTML=False)\n return\n try:\n result = eval(code, namespace)\n except:\n result = traceback.format_exc()\n conversation.say(str(result), useHTML=False)", "metadata": "root.python", "header": "['module', '___EOS___']", "index": 53 }, { "content": "@responder(pattern=\"^@(?P<command>.+)\", context_key='server', form=\"@<command>\", help=\"Run a droned command on the current server\")\[email protected]\ndef droneblast(conversation, command):\n server = conversation.context.get('server')\n response = None\n d = None\n try:\n if not isinstance(server, Server):\n conversation.say('On what <b>server</b>?')\n raise AssertionError('incomplete converation context')\n\n options = {}\n if 'timeout' in conversation.context:\n options['timeout'] = conversation.context['timeout']\n\n try:\n conversation.say(\"Running droned command...\")\n d = server.manager.run(command, **options)\n deferreds = conversation.context.get('deferreds', [])\n deferreds.append(d)\n conversation.context.update({'deferreds': deferreds})\n wfd = defer.waitForDeferred(d)\n yield wfd\n result = wfd.getResult()\n except:\n failure = Failure()\n if failure.check(DroneCommandFailed):\n rc = failure.value.resultContext\n conversation.say(rc.get('description') or str(rc), useHTML=False)\n else:\n conversation.say(failure.getTraceback(), useHTML=False)\n else:\n if isinstance(result, dict):\n output = result.values()[0].get('description', str(result))\n else:\n output = str(result)\n deferreds = conversation.context.get('deferreds', [])\n try: deferreds.remove(d)\n except: pass\n conversation.context.update({'deferreds': deferreds})\n conversation.say(\"Command completed\\n%s\" % output, useHTML=False)\n except AssertionError: pass\n except:\n result = Failure()\n yield result", "metadata": "root.droneblast", "header": "['module', '___EOS___']", "index": 73 }, { "content": "@responder(pattern=\"^set (?P<var>\\S+) (?P<value>.+)\", form=\"set <var> <value>\", help=\"Define a context variable\")\ndef _set(conversation, var, value):\n try:\n value = float(value)\n except:\n try:\n value = int(value)\n except: pass\n conversation.context[var] = value\n conversation.say(\"Ok.\")", "metadata": "root._set", "header": "['module', '___EOS___']", "index": 120 }, { "content": "@responder(pattern=\"^failed( (?P<num>\\d+))?$\", form='failed [num]',\n help=\"Display one or all failed tasks droned just performed for you\")\ndef failed(conversation, num):\n failures = conversation.context.get('failures',[])\n\n droned_results = [f.value.resultContext for f in failures if f.check(DroneCommandFailed)]\n other_failures = [f for f in failures if not f.check(DroneCommandFailed)]\n\n if num: # Detailed error report\n droned_errors = [str(rc) for rc in droned_results]\n other_errors = [f.getTraceback() for f in other_failures]\n errors = droned_errors + other_errors\n\n num = int(num)\n try:\n conversation.say('\\n' + errors[num], useHTML=False)\n except:\n conversation.say('No failure #%d' % num)\n elif failures: # Error summary listing\n droned_errors = ['%(server)s: %(description)s' % rc for rc in droned_results]\n other_errors = [str(f) for f in other_failures]\n errors = droned_errors + other_errors\n\n listing = '\\n' + '\\n'.join(\"#%d %s\" % i for i in enumerate(errors))\n conversation.say(listing, useHTML=False)\n else:\n conversation.say(\"I have not failed to do anything for you recently.\")", "metadata": "root.failed", "header": "['module', '___EOS___']", "index": 163 }, { "content": "@responder(pattern='^auth request$', form='auth request', auth_required=False,\n help='Request authorization from environment administrator')\[email protected]\ndef auth_request(conversation):\n result = None\n try:\n if conversation.authorized:\n conversation.say(\"You are already authorized to use this droned.\")\n raise AssertionError('Already authorized to use this droned')\n\n conversation.say(\"Ok, I will pass your request along to the environment administrator. I will let you know what they decide.\")\n deputy = Conversation(jabber_config.DEPUTY)\n try:\n question = \"%s has requested authorization, do you wish to <b>grant</b> or <b>deny</b> this request?\" % conversation.buddy\n answers = ('grant','deny')\n d = deputy.ask(question, answers)\n wfd = defer.waitForDeferred(d)\n yield wfd\n answer = wfd.getResult()\n except AlreadyAskingQuestion:\n err = \"Sorry, the environment administrator is busy dealing with something else right now. \"\n err += \"You should wait and try again later, or if it is urgent contact them directly. \"\n err += \"The environment administrator is %s\" % jabber_config.DEPUTY\n conversation.say(err)\n raise AssertionError('Administrator is busy')\n\n if answer == 'grant':\n conversation.grantAuthorization()\n deputy.say(\"%s has been granted authorization.\" % conversation.buddy)\n else:\n err = \"Your request for authorization has been denied. If you wish to discuss this further you \"\n err += \"should contact the environment administrator directly. \"\n err += \"The environment administrator is %s\" % jabber_config.DEPUTY\n conversation.say(err)\n deputy.say(\"%s has been denied authorization.\" % conversation.buddy)\n except AssertionError: pass\n except:\n result = Failure()\n yield result", "metadata": "root.auth_request", "header": "['module', '___EOS___']", "index": 201 } ]
[ { "span": "except:", "start_line": 59, "start_column": 4, "end_line": 59, "end_column": 11 }, { "span": "except:", "start_line": 62, "start_column": 8, "end_line": 62, "end_column": 15 }, { "span": "except:", "start_line": 68, "start_column": 4, "end_line": 68, "end_column": 11 }, { "span": "except:", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 15 }, { "span": "except: ", "start_line": 111, "start_column": 12, "end_line": 111, "end_column": 19 }, { "span": "except:", "start_line": 115, "start_column": 4, "end_line": 115, "end_column": 11 }, { "span": "except:", "start_line": 124, "start_column": 4, "end_line": 124, "end_column": 11 }, { "span": "except: ", "start_line": 127, "start_column": 8, "end_line": 127, "end_column": 15 }, { "span": "except:", "start_line": 179, "start_column": 8, "end_line": 179, "end_column": 15 }, { "span": "except:", "start_line": 237, "start_column": 4, "end_line": 237, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "responder", "_", "(_", "pattern_", "=_", "\"", "^", "!(", "?", "P", "<", "source", ">.+)", "\"_", ",_", "form_", "=_", "\"!", "<", "code", ">\"_", ",_", "help_", "=_", "\"", "Execut", "e", " ", "some", " ", "python", " ", "code", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "python_", "(_", "conversation_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "drone", "d_", "._", "entity_", "import_", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "source_", "=_", "source_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code_", "=_", "compile_", "(_", "source_", ",_", "'<", "jab", "ber", ">'_", ",_", "'", "eval", "'_", ")_", "\\u\\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 ", " _", "code_", "=_", "compile_", "(_", "source_", ",_", "'<", "jab", "ber", ">'_", ",_", "'", "single", "'_", ")_", "\\u\\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_", "=_", "\"", "I", " ", "coul", "dn", "'", "t", " ", "compile", " ", "your", " ", "code", ".\\\\", "n", "%", "s", "\"_", "%_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "msg_", ",_", "use", "HTML_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "eval_", "(_", "code_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conversation_", "._", "say_", "(_", "str_", "(_", "result_", ")_", ",_", "use", "HTML_", "=_", "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_", "@_", "responder", "_", "(_", "pattern_", "=_", "\"", "^", "@(", "?", "P", "<", "command", ">.+)", "\"_", ",_", "context", "\\u", "key_", "=_", "'", "server", "'_", ",_", "form_", "=_", "\"@", "<", "command", ">\"_", ",_", "help_", "=_", "\"", "Run", " ", "a", " ", "drone", "d", " ", "command", " ", "on", " ", "the", " ", "current", " ", "server", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "defer_", "._", "defer", "red", "Generator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "drone", "blast", "_", "(_", "conversation_", ",_", "command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "=_", "conversation_", "._", "context_", "._", "get_", "(_", "'", "server", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "server_", ",_", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conversation_", "._", "say_", "(_", "'", "On", " ", "what", " ", "<", "b", ">", "server", "</", "b", ">", "?'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Assert", "ion", "Error_", "(_", "'", "incomplete", " ", "conve", "ration", " ", "context", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "timeo", "ut", "'_", "in_", "conversation_", "._", "context_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "[_", "'", "timeo", "ut", "'_", "]_", "=_", "conversation_", "._", "context_", "[_", "'", "timeo", "ut", "'_", "]_", "\\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 ", " _", "conversation_", "._", "say_", "(_", "\"", "Run", "ning", " ", "drone", "d", " ", "command", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "server_", "._", "manager_", "._", "run_", "(_", "command_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "reds", "_", "=_", "conversation_", "._", "context_", "._", "get_", "(_", "'", "defer", "reds", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defer", "reds", "_", "._", "append_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "context_", "._", "update_", "(_", "{_", "'", "defer", "reds", "'_", ":_", "defer", "reds", "_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wf", "d_", "=_", "defer_", "._", "wait", "For", "Deferred_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "wf", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "wf", "d_", "._", "get", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "failure_", "=_", "Failure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "failure_", "._", "check_", "(_", "Dro", "ne", "Command", "Failed_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rc_", "=_", "failure_", "._", "value_", "._", "result", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "rc_", "._", "get_", "(_", "'", "description", "'_", ")_", "or_", "str_", "(_", "rc_", ")_", ",_", "use", "HTML_", "=_", "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 ", " _", "conversation_", "._", "say_", "(_", "failure_", "._", "get", "Trace", "back_", "(_", ")_", ",_", "use", "HTML_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "result_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "result_", "._", "values_", "(_", ")_", "[_", "0_", "]_", "._", "get_", "(_", "'", "description", "'_", ",_", "str_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output_", "=_", "str_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defer", "reds", "_", "=_", "conversation_", "._", "context_", "._", "get_", "(_", "'", "defer", "reds", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "defer", "reds", "_", "._", "remove_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "context_", "._", "update_", "(_", "{_", "'", "defer", "reds", "'_", ":_", "defer", "reds", "_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "\"", "Command", " ", "complete", "d", "\\\\", "n", "%", "s", "\"_", "%_", "output_", ",_", "use", "HTML_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "Failure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "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_", "@_", "responder", "_", "(_", "pattern_", "=_", "\"", "^", "set", " ", "(?", "P", "<", "var", ">\\\\", "S", "+)", " ", "(?", "P", "<", "value", ">.+)", "\"_", ",_", "form_", "=_", "\"", "set", " ", "<", "var", ">", " ", "<", "value", ">\"_", ",_", "help_", "=_", "\"", "Define", " ", "a", " ", "context", " ", "variab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "set_", "(_", "conversation_", ",_", "var_", ",_", "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_", "=_", "float_", "(_", "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 ", " _", "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_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conversation_", "._", "context_", "[_", "var_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "\"", "Ok", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "responder", "_", "(_", "pattern_", "=_", "\"", "^", "fail", "ed", "(", " ", "(?", "P", "<", "num", ">\\\\", "d", "+))", "?$", "\"_", ",_", "form_", "=_", "'", "fail", "ed", " ", "[", "num", "]'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "Display", " ", "one", " ", "or", " ", "all", " ", "fail", "ed", " ", "task", "s", " ", "drone", "d", " ", "just", " ", "perform", "ed", " ", "for", " ", "you", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "failed_", "(_", "conversation_", ",_", "num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "failures_", "=_", "conversation_", "._", "context_", "._", "get_", "(_", "'", "fail", "ure", "s", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drone", "d\\u", "results_", "=_", "[_", "f_", "._", "value_", "._", "result", "Context_", "for_", "f_", "in_", "failures_", "if_", "f_", "._", "check_", "(_", "Dro", "ne", "Command", "Failed_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "failures_", "=_", "[_", "f_", "for_", "f_", "in_", "failures_", "if_", "not_", "f_", "._", "check_", "(_", "Dro", "ne", "Command", "Failed_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "num_", ":_", "#", " ", "Det", "ail", "ed", " ", "error", " ", "report_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drone", "d\\u", "errors_", "=_", "[_", "str_", "(_", "rc_", ")_", "for_", "rc_", "in_", "drone", "d\\u", "results_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "errors_", "=_", "[_", "f_", "._", "get", "Trace", "back_", "(_", ")_", "for_", "f_", "in_", "other", "\\u", "failures_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "=_", "drone", "d\\u", "errors_", "+_", "other", "\\u", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num_", "=_", "int_", "(_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conversation_", "._", "say_", "(_", "'\\\\", "n", "'_", "+_", "errors_", "[_", "num_", "]_", ",_", "use", "HTML_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conversation_", "._", "say_", "(_", "'", "No", " ", "fail", "ure", " ", "#", "%", "d", "'_", "%_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "failures_", ":_", "#", " ", "Error", " ", "summar", "y", " ", "listing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "drone", "d\\u", "errors_", "=_", "[_", "'%", "(", "server", ")", "s", ":", " ", "%", "(", "description", ")", "s", "'_", "%_", "rc_", "for_", "rc_", "in_", "drone", "d\\u", "results_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "errors_", "=_", "[_", "str_", "(_", "f_", ")_", "for_", "f_", "in_", "other", "\\u", "failures_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "=_", "drone", "d\\u", "errors_", "+_", "other", "\\u", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "listing_", "=_", "'\\\\", "n", "'_", "+_", "'\\\\", "n", "'_", "._", "join_", "(_", "\"#", "%", "d", " ", "%", "s", "\"_", "%_", "i_", "for_", "i_", "in_", "enumerate_", "(_", "errors_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "listing_", ",_", "use", "HTML_", "=_", "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 ", " _", "conversation_", "._", "say_", "(_", "\"", "I", " ", "have", " ", "not", " ", "fail", "ed", " ", "to", " ", "do", " ", "anyt", "hing", " ", "for", " ", "you", " ", "recent", "ly", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "responder", "_", "(_", "pattern_", "=_", "'", "^", "auth", " ", "request", "$'_", ",_", "form_", "=_", "'", "auth", " ", "request", "'_", ",_", "auth", "\\u", "required_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "'", "Request", " ", "authoriz", "ation", " ", "from", " ", "environ", "ment", " ", "administrat", "or", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "defer_", "._", "defer", "red", "Generator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "auth", "\\u", "request_", "(_", "conversation_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "conversation_", "._", "authorized_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conversation_", "._", "say_", "(_", "\"", "You", " ", "are", " ", "alr", "ead", "y", " ", "authoriz", "ed", " ", "to", " ", "use", " ", "this", " ", "drone", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Assert", "ion", "Error_", "(_", "'", "Al", "read", "y", " ", "authoriz", "ed", " ", "to", " ", "use", " ", "this", " ", "drone", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conversation_", "._", "say_", "(_", "\"", "Ok", ",", " ", "I", " ", "will", " ", "pass", " ", "your", " ", "request", " ", "along", " ", "to", " ", "the", " ", "environ", "ment", " ", "administrat", "or", ".", " ", "I", " ", "will", " ", "let", " ", "you", " ", "know", " ", "what", " ", "the", "y", " ", "decide", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dep", "ut", "y_", "=_", "Conversation", "_", "(_", "jab", "ber", "\\u", "config_", "._", "DEP", "UT", "Y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "question_", "=_", "\"%", "s", " ", "has", " ", "request", "ed", " ", "authoriz", "ation", ",", " ", "do", " ", "you", " ", "wish", " ", "to", " ", "<", "b", ">", "grant", "</", "b", ">", " ", "or", " ", "<", "b", ">", "deny", "</", "b", ">", " ", "this", " ", "request", "?\"_", "%_", "conversation_", "._", "buddy", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "answers_", "=_", "(_", "'", "grant", "'_", ",_", "'", "deny", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d_", "=_", "dep", "ut", "y_", "._", "ask_", "(_", "question_", ",_", "answers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wf", "d_", "=_", "defer_", "._", "wait", "For", "Deferred_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "wf", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "answer_", "=_", "wf", "d_", "._", "get", "Result_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Al", "read", "y", "As", "king", "Question_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "\"", "So", "rr", "y", ",", " ", "the", " ", "environ", "ment", " ", "administrat", "or", " ", "is", " ", "bus", "y", " ", "deal", "ing", " ", "with", " ", "somet", "hing", " ", "else", " ", "right", " ", "now", ".", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "+=_", "\"", "You", " ", "shou", "ld", " ", "wait", " ", "and", " ", "try", " ", "again", " ", "late", "r", ",", " ", "or", " ", "if", " ", "it", " ", "is", " ", "urgen", "t", " ", "contact", " ", "them", " ", "direct", "ly", ".", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "+=_", "\"", "The", " ", "environ", "ment", " ", "administrat", "or", " ", "is", " ", "%", "s", "\"_", "%_", "jab", "ber", "\\u", "config_", "._", "DEP", "UT", "Y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Assert", "ion", "Error_", "(_", "'", "Administra", "tor", " ", "is", " ", "bus", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "answer_", "==_", "'", "grant", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conversation_", "._", "grant", "Authorization_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dep", "ut", "y_", "._", "say_", "(_", "\"%", "s", " ", "has", " ", "bee", "n", " ", "grant", "ed", " ", "authoriz", "ation", ".\"_", "%_", "conversation_", "._", "buddy", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "\"", "You", "r", " ", "request", " ", "for", " ", "authoriz", "ation", " ", "has", " ", "bee", "n", " ", "deni", "ed", ".", " ", "If", " ", "you", " ", "wish", " ", "to", " ", "discuss", " ", "this", " ", "fur", "ther", " ", "you", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "+=_", "\"", "shou", "ld", " ", "contact", " ", "the", " ", "environ", "ment", " ", "administrat", "or", " ", "direct", "ly", ".", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "err_", "+=_", "\"", "The", " ", "environ", "ment", " ", "administrat", "or", " ", "is", " ", "%", "s", "\"_", "%_", "jab", "ber", "\\u", "config_", "._", "DEP", "UT", "Y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conversation_", "._", "say_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dep", "ut", "y_", "._", "say_", "(_", "\"%", "s", " ", "has", " ", "bee", "n", " ", "deni", "ed", " ", "authoriz", "ation", ".\"_", "%_", "conversation_", "._", "buddy", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Assert", "ion", "Error_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "Failure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "result_", "\\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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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, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
AppScale/appscale/AppServer/lib/django-1.5/django/core/handlers/base.py
[ { "content": " def get_response(self, request):\n \"Returns an HttpResponse object for the given HttpRequest\"\n try:\n # Setup default url resolver for this thread, this code is outside\n # the try/except so we don't get a spurious \"unbound local\n # variable\" exception in the event an exception is raised before\n # resolver is set\n urlconf = settings.ROOT_URLCONF\n urlresolvers.set_urlconf(urlconf)\n resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)\n try:\n response = None\n # Apply request middleware\n for middleware_method in self._request_middleware:\n response = middleware_method(request)\n if response:\n break\n\n if response is None:\n if hasattr(request, 'urlconf'):\n # Reset url resolver with a custom urlconf.\n urlconf = request.urlconf\n urlresolvers.set_urlconf(urlconf)\n resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)\n\n resolver_match = resolver.resolve(request.path_info)\n callback, callback_args, callback_kwargs = resolver_match\n request.resolver_match = resolver_match\n\n # Apply view middleware\n for middleware_method in self._view_middleware:\n response = middleware_method(request, callback, callback_args, callback_kwargs)\n if response:\n break\n\n if response is None:\n try:\n response = callback(request, *callback_args, **callback_kwargs)\n except Exception as e:\n # If the view raised an exception, run it through exception\n # middleware, and if the exception middleware returns a\n # response, use that. Otherwise, reraise the exception.\n for middleware_method in self._exception_middleware:\n response = middleware_method(request, e)\n if response:\n break\n if response is None:\n raise\n\n # Complain if the view returned None (a common error).\n if response is None:\n if isinstance(callback, types.FunctionType): # FBV\n view_name = callback.__name__\n else: # CBV\n view_name = callback.__class__.__name__ + '.__call__'\n raise ValueError(\"The view %s.%s didn't return an HttpResponse object.\" % (callback.__module__, view_name))\n\n # If the response supports deferred rendering, apply template\n # response middleware and the render the response\n if hasattr(response, 'render') and callable(response.render):\n for middleware_method in self._template_response_middleware:\n response = middleware_method(request, response)\n response = response.render()\n\n except http.Http404 as e:\n logger.warning('Not Found: %s', request.path,\n extra={\n 'status_code': 404,\n 'request': request\n })\n if settings.DEBUG:\n response = debug.technical_404_response(request, e)\n else:\n try:\n callback, param_dict = resolver.resolve404()\n response = callback(request, **param_dict)\n except:\n signals.got_request_exception.send(sender=self.__class__, request=request)\n response = self.handle_uncaught_exception(request, resolver, sys.exc_info())\n except exceptions.PermissionDenied:\n logger.warning(\n 'Forbidden (Permission denied): %s', request.path,\n extra={\n 'status_code': 403,\n 'request': request\n })\n try:\n callback, param_dict = resolver.resolve403()\n response = callback(request, **param_dict)\n except:\n signals.got_request_exception.send(\n sender=self.__class__, request=request)\n response = self.handle_uncaught_exception(request,\n resolver, sys.exc_info())\n except SystemExit:\n # Allow sys.exit() to actually exit. See tickets #1023 and #4701\n raise\n except: # Handle everything else, including SuspiciousOperation, etc.\n # Get the exception info now, in case another exception is thrown later.\n signals.got_request_exception.send(sender=self.__class__, request=request)\n response = self.handle_uncaught_exception(request, resolver, sys.exc_info())\n finally:\n # Reset URLconf for this thread on the way out for complete\n # isolation of request.urlconf\n urlresolvers.set_urlconf(None)\n\n try:\n # Apply response middleware, regardless of the response\n for middleware_method in self._response_middleware:\n response = middleware_method(request, response)\n response = self.apply_response_fixes(request, response)\n except: # Any exception should be gathered and handled\n signals.got_request_exception.send(sender=self.__class__, request=request)\n response = self.handle_uncaught_exception(request, resolver, sys.exc_info())\n\n return response", "metadata": "root.BaseHandler.get_response", "header": "['class', 'BaseHandler', '(', 'object', ')', ':', '___NEWLINE___', '# Changes that are always applied to a response (in this order).', '___NL___', '___EOS___']", "index": 77 } ]
[ { "span": "except:", "start_line": 153, "start_column": 20, "end_line": 153, "end_column": 27 }, { "span": "except:", "start_line": 166, "start_column": 16, "end_line": 166, "end_column": 23 }, { "span": "except: ", "start_line": 174, "start_column": 12, "end_line": 174, "end_column": 19 }, { "span": "except: ", "start_line": 188, "start_column": 8, "end_line": 188, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Base", "Handler_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Change", "s", " ", "tha", "t", " ", "are", " ", "alw", "ay", "s", " ", "applied", " ", "to", " ", "a", " ", "response", " ", "(", "in", " ", "this", " ", "order", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "response_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "an", " ", "Http", "Respons", "e", " ", "object", " ", "for", " ", "the", " ", "give", "n", " ", "Http", "Request", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", "up", " ", "default", " ", "url", " ", "resolver", " ", "for", " ", "this", " ", "thread", ",", " ", "this", " ", "code", " ", "is", " ", "outsi", "de_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "try", "/", "except", " ", "so", " ", "we", " ", "don", "'", "t", " ", "get", " ", "a", " ", "spu", "rio", "us", " ", "\"", "unbound", " ", "local_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "variab", "le", "\"", " ", "exception", " ", "in", " ", "the", " ", "event", " ", "an", " ", "exception", " ", "is", " ", "raise", "d", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolver", " ", "is", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url", "conf_", "=_", "settings_", "._", "ROO", "T", "\\u", "URLCONF_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urlresolvers_", "._", "set\\u", "url", "conf_", "(_", "url", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resolver_", "=_", "urlresolvers_", "._", "Rege", "x", "URL", "Resolver_", "(_", "r", "'", "^", "/'_", ",_", "url", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Apply", " ", "request", " ", "middleware_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "middle", "ware", "\\u", "method_", "in_", "self_", "._", "\\u", "request", "\\u", "middleware_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "response_", "=_", "middle", "ware", "\\u", "method_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "hasattr_", "(_", "request_", ",_", "'", "url", "conf", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reset", " ", "url", " ", "resolver", " ", "with", " ", "a", " ", "custom", " ", "url", "conf", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "url", "conf_", "=_", "request_", "._", "url", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "urlresolvers_", "._", "set\\u", "url", "conf_", "(_", "url", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resolver_", "=_", "urlresolvers_", "._", "Rege", "x", "URL", "Resolver_", "(_", "r", "'", "^", "/'_", ",_", "url", "conf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resolver", "\\u", "match_", "=_", "resolver_", "._", "resolve_", "(_", "request_", "._", "path", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "callback_", ",_", "callback", "\\u", "args_", ",_", "callback", "\\u", "kwargs_", "=_", "resolver", "\\u", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "._", "resolver", "\\u", "match_", "=_", "resolver", "\\u", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "view", " ", "middleware_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "middle", "ware", "\\u", "method_", "in_", "self_", "._", "\\u", "view", "\\u", "middleware_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "response_", "=_", "middle", "ware", "\\u", "method_", "(_", "request_", ",_", "callback_", ",_", "callback", "\\u", "args_", ",_", "callback", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "response_", "=_", "callback_", "(_", "request_", ",_", "*_", "callback", "\\u", "args_", ",_", "**_", "callback", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "view", " ", "raise", "d", " ", "an", " ", "exception", ",", " ", "run", " ", "it", " ", "through", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "middle", "ware", ",", " ", "and", " ", "if", " ", "the", " ", "exception", " ", "middle", "ware", " ", "return", "s", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "response", ",", " ", "use", " ", "tha", "t", ".", " ", "Ot", "her", "wis", "e", ",", " ", "reraise", " ", "the", " ", "exception", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "middle", "ware", "\\u", "method_", "in_", "self_", "._", "\\u", "exception", "\\u", "middleware_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "response_", "=_", "middle", "ware", "\\u", "method_", "(_", "request_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "response_", ":_", "\\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_", "if_", "response_", "is_", "None_", ":_", "\\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_", "#", " ", "Comp", "lain", " ", "if", " ", "the", " ", "view", " ", "return", "ed", " ", "Non", "e", " ", "(", "a", " ", "common", " ", "error", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "callback_", ",_", "types_", "._", "Function", "Type_", ")_", ":_", "#", " ", "FB", "V_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "view", "\\u", "name_", "=_", "callback_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "CB", "V_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "view", "\\u", "name_", "=_", "callback_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", "+_", "'.", "\\u\\u", "call", "\\u\\u'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "The", " ", "view", " ", "%", "s", ".", "%", "s", " ", "did", "n", "'", "t", " ", "return", " ", "an", " ", "Http", "Respons", "e", " ", "object", ".\"_", "%_", "(_", "callback_", "._", "\\u\\u", "module\\u\\u_", ",_", "view", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "response", " ", "support", "s", " ", "defer", "red", " ", "render", "ing", ",", " ", "appl", "y", " ", "template_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "response", " ", "middle", "ware", " ", "and", " ", "the", " ", "render", " ", "the", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "response_", ",_", "'", "render", "'_", ")_", "and_", "callable_", "(_", "response_", "._", "render_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "middle", "ware", "\\u", "method_", "in_", "self_", "._", "\\u", "template", "\\u", "response", "\\u", "middleware_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "response_", "=_", "middle", "ware", "\\u", "method_", "(_", "request_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "response_", "._", "render_", "(_", ")_", "\\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_", "http_", "._", "Http404_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "'", "Not", " ", "Foun", "d", ":", " ", "%", "s", "'_", ",_", "request_", "._", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "\\u", "code", "'_", ":_", "404_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "request", "'_", ":_", "request_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "._", "DEBUG_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "response_", "=_", "debug_", "._", "technical", "\\u", "404", "\\u", "response_", "(_", "request_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "callback_", ",_", "param", "\\u", "dict_", "=_", "resolver_", "._", "resolve", "404_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "callback_", "(_", "request_", ",_", "**_", "param", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "signals_", "._", "got", "\\u", "request", "\\u", "exception_", "._", "send_", "(_", "sender_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "request_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "handle", "\\u", "unca", "ugh", "t", "\\u", "exception_", "(_", "request_", ",_", "resolver_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", ")_", "\\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_", "exceptions_", "._", "Permi", "ssion", "Denied_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "For", "bid", "den", " ", "(", "Permi", "ssion", " ", "deni", "ed", "):", " ", "%", "s", "'_", ",_", "request_", "._", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extra_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "status", "\\u", "code", "'_", ":_", "403_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "request", "'_", ":_", "request_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "callback_", ",_", "param", "\\u", "dict_", "=_", "resolver_", "._", "resolve", "403_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "callback_", "(_", "request_", ",_", "**_", "param", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "signals_", "._", "got", "\\u", "request", "\\u", "exception_", "._", "send_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "sender_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "request_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "handle", "\\u", "unca", "ugh", "t", "\\u", "exception_", "(_", "request_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "resolver_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "System", "Exit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", " ", "sys", ".", "exit", "()", " ", "to", " ", "actual", "ly", " ", "exit", ".", " ", "See", " ", "tick", "ets", " ", "#", "1023", " ", "and", " ", "#", "470", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "Handle", " ", "every", "thing", " ", "else", ",", " ", "inclu", "ding", " ", "Sus", "picio", "us", "Opera", "tion", ",", " ", "etc", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "exception", " ", "info", " ", "now", ",", " ", "in", " ", "case", " ", "anot", "her", " ", "exception", " ", "is", " ", "throw", "n", " ", "late", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signals_", "._", "got", "\\u", "request", "\\u", "exception_", "._", "send_", "(_", "sender_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "request_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "handle", "\\u", "unca", "ugh", "t", "\\u", "exception_", "(_", "request_", ",_", "resolver_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", ")_", "\\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_", "#", " ", "Reset", " ", "URL", "conf", " ", "for", " ", "this", " ", "thread", " ", "on", " ", "the", " ", "way", " ", "out", " ", "for", " ", "complete_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "isolation", " ", "of", " ", "request", ".", "url", "conf_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "urlresolvers_", "._", "set\\u", "url", "conf_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Apply", " ", "response", " ", "middle", "ware", ",", " ", "rega", "rd", "less", " ", "of", " ", "the", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "middle", "ware", "\\u", "method_", "in_", "self_", "._", "\\u", "response", "\\u", "middleware_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "middle", "ware", "\\u", "method_", "(_", "request_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "self_", "._", "appl", "y", "\\u", "response", "\\u", "fixes", "_", "(_", "request_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "Any", " ", "exception", " ", "shou", "ld", " ", "be", " ", "gather", "ed", " ", "and", " ", "handled_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signals_", "._", "got", "\\u", "request", "\\u", "exception_", "._", "send_", "(_", "sender_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", ",_", "request_", "=_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "handle", "\\u", "unca", "ugh", "t", "\\u", "exception_", "(_", "request_", ",_", "res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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, 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 ]
Unused import
django/django-dev-dashboard/dashboard/migrations/0005_add_period_field.py
[ { "content": "# encoding: utf-8\nimport datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n 'contenttypes.contenttype': {\n 'Meta': {'ordering': \"('name',)\", 'unique_together': \"(('app_label', 'model'),)\", 'object_name': 'ContentType', 'db_table': \"'django_content_type'\"},\n 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n 'dashboard.datum': {\n 'Meta': {'ordering': \"['-timestamp']\", 'object_name': 'Datum'},\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'+'\", 'to': \"orm['contenttypes.ContentType']\"}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'measurement': ('django.db.models.fields.BigIntegerField', [], {}),\n 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\n 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})\n },\n 'dashboard.rssfeedmetric': {\n 'Meta': {'object_name': 'RSSFeedMetric'},\n 'feed_url': ('django.db.models.fields.URLField', [], {'max_length': '1000'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'link_url': ('django.db.models.fields.URLField', [], {'max_length': '1000'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\n 'period': ('django.db.models.fields.CharField', [], {'default': \"'instant'\", 'max_length': '15'}),\n 'show_on_dashboard': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'show_sparkline': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})\n },\n 'dashboard.tracticketmetric': {\n 'Meta': {'object_name': 'TracTicketMetric'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '300'}),\n 'period': ('django.db.models.fields.CharField', [], {'default': \"'instant'\", 'max_length': '15'}),\n 'query': ('django.db.models.fields.TextField', [], {}),\n 'show_on_dashboard': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'show_sparkline': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})\n }\n }\n\n complete_apps = ['dashboard']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def forwards(self, orm):\n \n # Adding field 'RSSFeedMetric.period'\n db.add_column('dashboard_rssfeedmetric', 'period', self.gf('django.db.models.fields.CharField')(default='instant', max_length=15), keep_default=False)\n\n # Adding field 'TracTicketMetric.period'\n db.add_column('dashboard_tracticketmetric', 'period', self.gf('django.db.models.fields.CharField')(default='instant', max_length=15), keep_default=False)", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 8 }, { "content": " def backwards(self, orm):\n \n # Deleting field 'RSSFeedMetric.period'\n db.delete_column('dashboard_rssfeedmetric', 'period')\n\n # Deleting field 'TracTicketMetric.period'\n db.delete_column('dashboard_tracticketmetric', 'period')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 17 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "db_", "import_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "south_", "._", "v2_", "import_", "Schema", "Migration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "contenttype", "s", ".", "contenttype", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "'", "name", "',)\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "app", "\\u", "label", "',", " ", "'", "model", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Conten", "t", "Type", "'_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "django", "\\u", "content", "\\u", "type", "'\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "app", "\\u", "label", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "model", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "100", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dash", "board", ".", "dat", "um", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "timestamp", "']\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Dat", "um", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "+'\"", "_", ",_", "'", "to", "'_", ":_", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "measure", "ment", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Big", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "timestamp", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "datetime", ".", "datetime", ".", "now", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dash", "board", ".", "rs", "sf", "eed", "metric", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "RSS", "Feed", "Met", "ric", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "feed", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "link", "\\u", "url", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "URL", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1000", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "300", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "instant", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "15", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "show", "\\u", "on", "\\u", "dash", "board", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "show", "\\u", "spark", "line", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dash", "board", ".", "tract", "ick", "et", "metric", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Trac", "Ticke", "t", "Met", "ric", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "300", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "period", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "instant", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "15", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "query", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "show", "\\u", "on", "\\u", "dash", "board", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "show", "\\u", "spark", "line", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "slug", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "complete", "\\u", "apps_", "=_", "[_", "'", "dash", "board", "'_", "]_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "forwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "RSS", "Feed", "Met", "ric", ".", "period", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "add", "\\u", "column_", "(_", "'", "dash", "board", "\\u", "rs", "sf", "eed", "metric", "'_", ",_", "'", "period", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "default_", "=_", "'", "instant", "'_", ",_", "max", "\\u", "length_", "=_", "15_", ")_", ",_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", "ing", " ", "field", " ", "'", "Trac", "Ticke", "t", "Met", "ric", ".", "period", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "add", "\\u", "column_", "(_", "'", "dash", "board", "\\u", "tract", "ick", "et", "metric", "'_", ",_", "'", "period", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "default_", "=_", "'", "instant", "'_", ",_", "max", "\\u", "length_", "=_", "15_", ")_", ",_", "keep", "\\u", "default_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Migration_", "(_", "Schema", "Migration_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "backwards_", "(_", "self_", ",_", "orm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "RSS", "Feed", "Met", "ric", ".", "period", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "column_", "(_", "'", "dash", "board", "\\u", "rs", "sf", "eed", "metric", "'_", ",_", "'", "period", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Del", "eti", "ng", " ", "field", " ", "'", "Trac", "Ticke", "t", "Met", "ric", ".", "period", "'_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "._", "delete", "\\u", "column_", "(_", "'", "dash", "board", "\\u", "tract", "ick", "et", "metric", "'_", ",_", "'", "period", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
mayan-edms/mayan-edms/mayan/apps/django_gpg/tests/test_classes.py
[ { "content": " def test_main(self):\n # No private or public keys in the keyring\n self.assertEqual(Key.get_all(self.gpg, secret=True), [])\n self.assertEqual(Key.get_all(self.gpg), [])\n\n # Test querying the keyservers\n self.assertTrue(\n TEST_KEY_ID in [\n key_stub.key_id for key_stub in self.gpg.query(TEST_UIDS)\n ]\n )\n\n # Receive a public key from the keyserver\n self.gpg.receive_key(key_id=TEST_KEY_ID[-8:])\n\n # Check that the received key is indeed in the keyring\n self.assertTrue(\n TEST_KEY_ID[-16:] in [\n key_stub.key_id for key_stub in Key.get_all(self.gpg)\n ]\n )", "metadata": "root.DjangoGPGTestCase.test_main", "header": "['class', 'DjangoGPGTestCase', '(', 'TestCase', ')', ':', '___EOS___']", "index": 24 } ]
[ { "span": "self.assertTrue(\n TEST_KEY_ID in [\n key_stub.key_id for key_stub in self.gpg.query(TEST_UIDS)\n ]\n )", "start_line": 30, "start_column": 8, "end_line": 34, "end_column": 9 }, { "span": "self.assertTrue(\n TEST_KEY_ID[-16:] in [\n key_stub.key_id for key_stub in Key.get_all(self.gpg)\n ]\n )", "start_line": 40, "start_column": 8, "end_line": 44, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Dj", "ang", "o", "GPG", "Test", "Case_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "main_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "private", " ", "or", " ", "public", " ", "keys", " ", "in", " ", "the", " ", "keyring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "Key_", "._", "get", "\\u", "all_", "(_", "self_", "._", "gpg", "_", ",_", "secret_", "=_", "True_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Key_", "._", "get", "\\u", "all_", "(_", "self_", "._", "gpg", "_", ")_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Test", " ", "query", "ing", " ", "the", " ", "keyse", "rver", "s_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "TEST", "\\u", "KEY", "\\u", "ID_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "stub_", "._", "key", "\\u", "id_", "for_", "key", "\\u", "stub_", "in_", "self_", "._", "gpg", "_", "._", "query_", "(_", "TEST", "\\u", "UI", "DS_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Receive", " ", "a", " ", "public", " ", "key", " ", "from", " ", "the", " ", "keyse", "rver_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "gpg", "_", "._", "receive", "\\u", "key_", "(_", "key", "\\u", "id_", "=_", "TEST", "\\u", "KEY", "\\u", "ID_", "[_", "-_", "8_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "tha", "t", " ", "the", " ", "receive", "d", " ", "key", " ", "is", " ", "inde", "ed", " ", "in", " ", "the", " ", "keyring_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "TEST", "\\u", "KEY", "\\u", "ID_", "[_", "-_", "16_", ":_", "]_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "stub_", "._", "key", "\\u", "id_", "for_", "key", "\\u", "stub_", "in_", "Key_", "._", "get", "\\u", "all_", "(_", "self_", "._", "gpg", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
azoft-dev-team/imagrium/env/Lib/test/test_MimeWriter.py
[ { "content": " def test(self):\n buf = StringIO.StringIO()\n\n # Toplevel headers\n\n toplevel = MimeWriter(buf)\n toplevel.addheader(\"From\", \"[email protected]\")\n toplevel.addheader(\"Date\", \"Mon Feb 12 17:21:48 EST 1996\")\n toplevel.addheader(\"To\", \"[email protected]\")\n toplevel.addheader(\"MIME-Version\", \"1.0\")\n\n # Toplevel body parts\n\n f = toplevel.startmultipartbody(\"knowbot\", \"801spam999\",\n [(\"version\", \"0.1\")], prefix=0)\n f.write(\"This is a multi-part message in MIME format.\\n\")\n\n # First toplevel body part: metadata\n\n md = toplevel.nextpart()\n md.startmultipartbody(\"knowbot-metadata\", \"802spam999\")\n\n # Metadata part 1\n\n md1 = md.nextpart()\n md1.addheader(\"KP-Metadata-Type\", \"simple\")\n md1.addheader(\"KP-Access\", \"read-only\")\n m = MimeWriter(md1.startbody(\"message/rfc822\"))\n for key, value in SIMPLE_METADATA:\n m.addheader(\"KPMD-\" + key, value)\n m.flushheaders()\n del md1\n\n # Metadata part 2\n\n md2 = md.nextpart()\n for key, value in COMPLEX_METADATA:\n md2.addheader(\"KP-\" + key, value)\n f = md2.startbody(\"text/isl\")\n f.write(SELLER)\n del md2\n\n # Metadata part 3\n\n md3 = md.nextpart()\n f = md3.startbody(\"message/external-body\",\n [(\"access-type\", \"URL\"),\n (\"URL\", \"hdl://cnri.kss/generic-knowbot\")])\n m = MimeWriter(f)\n for key, value in EXTERNAL_METADATA:\n md3.addheader(\"KP-\" + key, value)\n md3.startbody(\"text/isl\")\n # Phantom body doesn't need to be written\n\n md.lastpart()\n\n # Second toplevel body part: code\n\n code = toplevel.nextpart()\n code.startmultipartbody(\"knowbot-code\", \"803spam999\")\n\n # Code: buyer program source\n\n buyer = code.nextpart()\n buyer.addheader(\"KP-Module-Name\", \"BuyerKP\")\n f = buyer.startbody(\"text/plain\")\n f.write(BUYER)\n\n code.lastpart()\n\n # Third toplevel body part: state\n\n state = toplevel.nextpart()\n state.addheader(\"KP-Main-Module\", \"main\")\n state.startmultipartbody(\"knowbot-state\", \"804spam999\")\n\n # State: a bunch of assignments\n\n st = state.nextpart()\n st.addheader(\"KP-Module-Name\", \"main\")\n f = st.startbody(\"text/plain\")\n f.write(STATE)\n\n state.lastpart()\n\n # End toplevel body parts\n\n toplevel.lastpart()\n\n self.assertEqual(buf.getvalue(), OUTPUT)", "metadata": "root.MimewriterTest.test", "header": "['class', 'MimewriterTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 196 } ]
[ { "span": "m ", "start_line": 244, "start_column": 8, "end_line": 244, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Mim", "ew", "riter", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "buf_", "=_", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Top", "level", " ", "headers_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "toplevel_", "=_", "Mim", "e", "Writer_", "(_", "buf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toplevel_", "._", "add", "header_", "(_", "\"", "Fro", "m", "\"_", ",_", "\"", "bwa", "rsa", "w", "@", "cn", "ri", ".", "resto", "n", ".", "va", ".", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toplevel_", "._", "add", "header_", "(_", "\"", "Date", "\"_", ",_", "\"", "Mon", " ", "Fe", "b", " ", "1", "2", " ", "1", "7", ":", "21", ":", "4", "8", " ", "EST", " ", "1996", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toplevel_", "._", "add", "header_", "(_", "\"", "To", "\"_", ",_", "\"", "ks", "s", "-", "submit", "@", "cn", "ri", ".", "resto", "n", ".", "va", ".", "us", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "toplevel_", "._", "add", "header_", "(_", "\"", "MIME", "-", "Version", "\"_", ",_", "\"", "1.0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Top", "level", " ", "body", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "=_", "toplevel_", "._", "start", "multip", "art", "body_", "(_", "\"", "know", "bot", "\"_", ",_", "\"", "801", "spam", "999", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\"", "version", "\"_", ",_", "\"", "0.", "1", "\"_", ")_", "]_", ",_", "prefix_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "\"", "Thi", "s", " ", "is", " ", "a", " ", "multi", "-", "part", " ", "message", " ", "in", " ", "MIME", " ", "format", ".\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "toplevel", " ", "body", " ", "part", ":", " ", "metadata_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "=_", "toplevel_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md_", "._", "start", "multip", "art", "body_", "(_", "\"", "know", "bot", "-", "metadata", "\"_", ",_", "\"", "802", "spam", "999", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Meta", "data", " ", "part", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md", "1_", "=_", "md_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md", "1_", "._", "add", "header_", "(_", "\"", "KP", "-", "Meta", "data", "-", "Type", "\"_", ",_", "\"", "simple", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md", "1_", "._", "add", "header_", "(_", "\"", "KP", "-", "Access", "\"_", ",_", "\"", "read", "-", "only", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Mim", "e", "Writer_", "(_", "md", "1_", "._", "start", "body_", "(_", "\"", "message", "/", "rfc", "822", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "SIMPLE", "\\u", "METADATA_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "._", "add", "header_", "(_", "\"", "KP", "MD", "-\"_", "+_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "._", "flush", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "md", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Meta", "data", " ", "part", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md", "2_", "=_", "md_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "COMPL", "EX", "\\u", "METADATA_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md", "2_", "._", "add", "header_", "(_", "\"", "KP", "-\"_", "+_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "f_", "=_", "md", "2_", "._", "start", "body_", "(_", "\"", "text", "/", "isl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "SEL", "LER", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "md", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Meta", "data", " ", "part", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md", "3_", "=_", "md_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "md", "3_", "._", "start", "body_", "(_", "\"", "message", "/", "external", "-", "body", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "(_", "\"", "access", "-", "type", "\"_", ",_", "\"", "URL", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "URL", "\"_", ",_", "\"", "hdl", "://", "cn", "ri", ".", "ks", "s", "/", "gener", "ic", "-", "know", "bot", "\"_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Mim", "e", "Writer_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "EXTERNAL", "\\u", "METADATA_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "md", "3_", "._", "add", "header_", "(_", "\"", "KP", "-\"_", "+_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "md", "3_", "._", "start", "body_", "(_", "\"", "text", "/", "isl", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pha", "nto", "m", " ", "body", " ", "doe", "sn", "'", "t", " ", "need", " ", "to", " ", "be", " ", "written_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "md_", "._", "lastp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Second", " ", "toplevel", " ", "body", " ", "part", ":", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "toplevel_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "._", "start", "multip", "art", "body_", "(_", "\"", "know", "bot", "-", "code", "\"_", ",_", "\"", "803", "spam", "999", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Code", ":", " ", "buyer", " ", "program", " ", "source_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "buyer", "_", "=_", "code_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buyer", "_", "._", "add", "header_", "(_", "\"", "KP", "-", "Modul", "e-", "Name", "\"_", ",_", "\"", "Bu", "yer", "KP", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "buyer", "_", "._", "start", "body_", "(_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "BU", "YE", "R_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "code_", "._", "lastp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "rd", " ", "toplevel", " ", "body", " ", "part", ":", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "=_", "toplevel_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "add", "header_", "(_", "\"", "KP", "-", "Main", "-", "Modul", "e", "\"_", ",_", "\"", "main", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "._", "start", "multip", "art", "body_", "(_", "\"", "know", "bot", "-", "state", "\"_", ",_", "\"", "804", "spam", "999", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "State", ":", " ", "a", " ", "bunch", " ", "of", " ", "assignments_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "st_", "=_", "state_", "._", "nextp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "st_", "._", "add", "header_", "(_", "\"", "KP", "-", "Modul", "e-", "Name", "\"_", ",_", "\"", "main", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "st_", "._", "start", "body_", "(_", "\"", "text", "/", "plain", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "write_", "(_", "STATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "state_", "._", "lastp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "End", " ", "toplevel", " ", "body", " ", "parts_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "toplevel_", "._", "lastp", "art_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "buf_", "._", "getvalue_", "(_", ")_", ",_", "OUTPUT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Module is imported more than once
CGATOxford/cgat/obsolete/pipeline_rnaseq_brawand.py
[ { "content": "################################################################################\n#\n# MRC FGU Computational Genomics Group\n#\n# $Id: pipeline_rnaseq_geneset.py 2900 2012-03-38 14:38:00Z david $\n#\n# Copyright (C) 2012 David Sims\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU 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, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#################################################################################\n\"\"\"\n========================\nRNAseq Geneset Pipeline\n========================\n\n:Author: David Sims \n:Release: $Id: pipeline_rnaseq_genesst.py 2900 2012-03-28 14:38:00Z david $\n:Date: |today|\n:Tags: Python\n\nThe RNAseq geneset pipeline parses multiple GTF files derived from RNAseq experiments in different tissues and produces a consensus geneset\n\nUsage\n=====\n\nSee :ref:`PipelineSettingUp` and :ref:`PipelineRunning` on general information how to use CGAT pipelines.\n\nConfiguration\n-------------\n\nThe pipeline requires a configured :file:`pipeline.ini` file. \n\nConfiguration files follow the ini format (see the python\n`ConfigParser <http://docs.python.org/library/configparser.html>` documentation).\nThe configuration file is organized by section and the variables are documented within \nthe file. In order to get a local configuration file in the current directory, type::\n\n python <codedir>/pipeline_rnaseq_genest.py config\n\nThe sphinxreport report requires a :file:`conf.py` and :file:`sphinxreport.ini` file \n(see :ref:`PipelineDocumenation`). To start with, use the files supplied with the\n:ref:`Example` data.\n\n\nInput\n-----\n\nInput are GTF-formatted files. \n\nRequirements\n------------\n\nThe pipeline requires the information from the following pipelines:\n\n:doc:`pipeline_annotations`\n\nset the configuration variables:\n :py:data:`annotations_database` \n :py:data:`annotations_dir`\n\nOn top of the default CGAT setup, the pipeline requires the following software to be in the \npath:\n\n+--------------------+-------------------+------------------------------------------------+\n|*Program* |*Version* |*Purpose* |\n+--------------------+-------------------+------------------------------------------------+\n|BEDTools | |interval comparison |\n+--------------------+-------------------+------------------------------------------------+\n\n\nPipline Output\n==============\n\nThe results of the computation are all stored in an sqlite relational\ndatabase :file:`csvdb`.\n\n\nCode\n====\n\n\"\"\"\nimport sys\nimport tempfile\nimport optparse\nimport shutil\nimport itertools\nimport csv\nimport math\nimport random\nimport re\nimport glob\nimport os\nimport shutil\nimport collections\nimport gzip\nimport sqlite3\nimport pysam\nimport CGAT.IndexedFasta as IndexedFasta\nimport CGAT.IndexedGenome as IndexedGenome\nimport CGAT.FastaIterator as FastaIterator\nimport CGAT.Genomics as Genomics\nimport CGAT.IOTools as IOTools\nimport CGAT.MAST as MAST\nimport CGAT.GTF as GTF\nimport CGAT.GFF as GFF\nimport CGAT.Bed as Bed\nimport cStringIO\nimport numpy\nimport CGAT.Masker as Masker\nimport fileinput\nimport CGAT.Experiment as E\nimport logging as L\nfrom ruffus import *\n\nUSECLUSTER = True\n\n###################################################\n###################################################\n###################################################\n## Pipeline configuration\n###################################################\nimport CGAT.Pipeline as P\nP.getParameters( [\"pipeline.ini\", ] )\nPARAMS = P.PARAMS\n#PARAMS_ANNOTATIONS = P.peekParameters( PARAMS[\"geneset_dir\"],\"pipeline_annotations.py\" )\n\n###################################################\n################################################### \n###################################################\n## Parse transcripts from GTF file\n \n###################################################\n \n###################################################\n\n###################################################\n \n###################################################\n \n###################################################\n\n###################################################\n \n###################################################\n################################################### \n###################################################\n## Non-coding\n \n###################################################\n \n###################################################\n \n###################################################\n\n###################################################\n###################################################\n###################################################\n## Load transcript_info table to database\n\n###################################################\n\n###################################################\n \n###################################################\n \n###################################################\n###################################################\n###################################################\n## create input files for CAPseq interval annotation pipeline\n\n###################################################\n\n###################################################\n\n###################################################\n\n###################################################\n\n###################################################\n\n############################################################\n############################################################\n############################################################\n## TRANSCRIPTION START SITES\n\n###################################################\n \n###################################################\n \n###################################################\n \n###################################################\n \n###################################################\n\n############################################################\n############################################################\n############################################################\n## Copy relevant files from Ensembl build\n\n############################################################\n \n############################################################\n \n############################################################\n############################################################\n############################################################\n\n \n\n \n\n\n\n\n\nif __name__== \"__main__\":\n sys.exit( P.main(sys.argv) )\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import shutil", "start_line": 104, "start_column": 0, "end_line": 104, "end_column": 13 } ]
[ { "span": "import shutil", "start_line": 96, "start_column": 0, "end_line": 96, "end_column": 13 } ]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MR", "C", " ", "FG", "U", " ", "Computation", "al", " ", "Geno", "mic", "s", " ", "Group_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "$", "Id", ":", " ", "pipeline", "\\u", "rna", "seq", "\\u", "gene", "set", ".", "py", " ", "290", "0", " ", "2012", "-0", "3", "-", "3", "8", " ", "14", ":", "3", "8", ":", "00", "Z", " ", "davi", "d", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Copy", "right", " ", "(", "C", ")", " ", "2012", " ", "Dav", "id", " ", "Sim", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "modif", "y", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "as", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "of", " ", "the", " ", "License", ",", " ", "or", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "9", " ", "Temp", "le", " ", "Place", " ", "-", " ", "Suit", "e", " ", "330", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "1", "-1", "307", ",", " ", "USA", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "==============", "=========", "=", "\\", "10", ";", "RNA", "seq", " ", "Genes", "et", " ", "Pipe", "line", "\\", "10", ";", "==============", "=========", "=", "\\", "10", ";", "\\", "10", ";", ":", "Author", ":", " ", "Dav", "id", " ", "Sim", "s", " ", "\\", "10", ";", ":", "Release", ":", " ", "$", "Id", ":", " ", "pipeline", "\\u", "rna", "seq", "\\u", "gene", "sst", ".", "py", " ", "290", "0", " ", "2012", "-0", "3", "-", "2", "8", " ", "14", ":", "3", "8", ":", "00", "Z", " ", "davi", "d", " ", "$", "\\", "10", ";", ":", "Date", ":", " ", "|", "toda", "y", "|", "\\", "10", ";", ":", "Ta", "gs", ":", " ", "Pyth", "on", "\\", "10", ";", "\\", "10", ";", "The", " ", "RNA", "seq", " ", "gene", "set", " ", "pipeline", " ", "parse", "s", " ", "multiple", " ", "GT", "F", " ", "files", " ", "derive", "d", " ", "from", " ", "RNA", "seq", " ", "experiment", "s", " ", "in", " ", "different", " ", "tissue", "s", " ", "and", " ", "produce", "s", " ", "a", " ", "consensus", " ", "gene", "set", "\\", "10", ";", "\\", "10", ";", "Us", "age", "\\", "10", ";", "=====", "\\", "10", ";", "\\", "10", ";", "See", " ", ":", "ref", ":`", "Pipe", "line", "Sett", "ing", "Up", "`", " ", "and", " ", ":", "ref", ":`", "Pipe", "line", "Run", "ning", "`", " ", "on", " ", "genera", "l", " ", "informati", "on", " ", "how", " ", "to", " ", "use", " ", "CGA", "T", " ", "pipeline", "s", ".", "\\", "10", ";", "\\", "10", ";", "Configura", "tion", "\\", "10", ";", "-------------", "\\", "10", ";", "\\", "10", ";", "The", " ", "pipeline", " ", "require", "s", " ", "a", " ", "configur", "ed", " ", ":", "file", ":`", "pipeline", ".", "ini", "`", " ", "file", ".", " ", "\\", "10", ";", "\\", "10", ";", "Configura", "tion", " ", "files", " ", "follow", " ", "the", " ", "ini", " ", "format", " ", "(", "see", " ", "the", " ", "python", "\\", "10", ";", "`", "Config", "Parser", " ", "<", "http", "://", "docs", ".", "python", ".", "org", "/", "librar", "y", "/", "config", "parser", ".", "html", ">`", " ", "documentation", ").", "\\", "10", ";", "The", " ", "configura", "tion", " ", "file", " ", "is", " ", "organize", "d", " ", "by", " ", "section", " ", "and", " ", "the", " ", "variab", "les", " ", "are", " ", "documente", "d", " ", "within", " ", "\\", "10", ";", "the", " ", "file", ".", " ", "In", " ", "order", " ", "to", " ", "get", " ", "a", " ", "local", " ", "configura", "tion", " ", "file", " ", "in", " ", "the", " ", "current", " ", "director", "y", ",", " ", "type", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "python", " ", "<", "code", "dir", ">/", "pipeline", "\\u", "rna", "seq", "\\u", "gene", "st", ".", "py", " ", "config", "\\", "10", ";", "\\", "10", ";", "The", " ", "sphinx", "report", " ", "report", " ", "require", "s", " ", "a", " ", ":", "file", ":`", "conf", ".", "py", "`", " ", "and", " ", ":", "file", ":`", "sphinx", "report", ".", "ini", "`", " ", "file", " ", "\\", "10", ";", "(", "see", " ", ":", "ref", ":`", "Pipe", "line", "Doc", "ume", "nati", "on", "`)", ".", " ", "To", " ", "start", " ", "with", ",", " ", "use", " ", "the", " ", "files", " ", "supplie", "d", " ", "with", " ", "the", "\\", "10", ";", ":", "ref", ":`", "Exam", "ple", "`", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Inp", "ut", "\\", "10", ";", "-----", "\\", "10", ";", "\\", "10", ";", "Inp", "ut", " ", "are", " ", "GT", "F", "-", "format", "ted", " ", "files", ".", " ", "\\", "10", ";", "\\", "10", ";", "Requirements", "\\", "10", ";", "------------", "\\", "10", ";", "\\", "10", ";", "The", " ", "pipeline", " ", "require", "s", " ", "the", " ", "informati", "on", " ", "from", " ", "the", " ", "follow", "ing", " ", "pipeline", "s", ":", "\\", "10", ";", "\\", "10", ";", ":", "doc", ":`", "pipeline", "\\u", "annot", "ation", "s", "`", "\\", "10", ";", "\\", "10", ";", "set", " ", "the", " ", "configura", "tion", " ", "variab", "les", ":", "\\", "10", ";", " ", " ", " ", ":", "py", ":", "data", ":`", "annotations\\u", "databa", "se", "`", " ", "\\", "10", ";", " ", " ", " ", ":", "py", ":", "data", ":`", "annotations\\u", "dir", "`", "\\", "10", ";", "\\", "10", ";", "On", " ", "top", " ", "of", " ", "the", " ", "default", " ", "CGA", "T", " ", "setup", ",", " ", "the", " ", "pipeline", " ", "require", "s", " ", "the", " ", "follow", "ing", " ", "software", " ", "to", " ", "be", " ", "in", " ", "the", " ", "\\", "10", ";", "path", ":", "\\", "10", ";", "\\", "10", ";", "+----------", "----------", "+----------", "---------", "+----------", "--------------", "--------------", "----------", "+", "\\", "10", ";", "|", "*", "Program", "*", " ", " ", " ", "|", "*", "Version", "*", " ", " ", "|", "*", "Pur", "pose", "*", " ", " ", " ", "|", "\\", "10", ";", "+----------", "----------", "+----------", "---------", "+----------", "--------------", "--------------", "----------", "+", "\\", "10", ";", "|", "BED", "Tool", "s", " ", " ", " ", " ", "|", " ", "|", "interval", " ", "compa", "ris", "on", " ", " ", " ", "|", "\\", "10", ";", "+----------", "----------", "+----------", "---------", "+----------", "--------------", "--------------", "----------", "+", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Pi", "plin", "e", " ", "Output", "\\", "10", ";", "==============", "\\", "10", ";", "\\", "10", ";", "The", " ", "results", " ", "of", " ", "the", " ", "computation", " ", "are", " ", "all", " ", "store", "d", " ", "in", " ", "an", " ", "sql", "ite", " ", "relation", "al", "\\", "10", ";", "databa", "se", " ", ":", "file", ":`", "csv", "db", "`.", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Code", "\\", "10", ";", "====", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "optparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "itertools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "csv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sqlite3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pysam", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Indexe", "d", "Fast", "a_", "as_", "Indexe", "d", "Fast", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Indexe", "d", "Genome", "_", "as_", "Indexe", "d", "Genome", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Fast", "a", "Iterator_", "as_", "Fast", "a", "Iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Geno", "mic", "s_", "as_", "Geno", "mic", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "IO", "Tools_", "as_", "IO", "Tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "MAS", "T_", "as_", "MAS", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "GT", "F_", "as_", "GT", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "GF", "F_", "as_", "GF", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Bed", "_", "as_", "Bed", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "c", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Mask", "er_", "as_", "Mask", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "fileinput_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Experiment_", "as_", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "as_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ru", "ff", "us_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "USE", "CLUSTER", "_", "=_", "True_", "\\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_", "##", " ", "Pipe", "line", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "CGA", "T_", "._", "Pipeline_", "as_", "P_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "P_", "._", "get", "Parameters_", "(_", "[_", "\"", "pipeline", ".", "ini", "\"_", ",_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PARAMS_", "=_", "P_", "._", "PARAMS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "PARAM", "S", "\\u", "ANNOTAT", "IONS", " ", "=", " ", "P", ".", "peek", "Parameter", "s", "(", " ", "PARAM", "S", "[\"", "gene", "set\\u", "dir", "\"]", ",\"", "pipeline", "\\u", "annot", "ation", "s", ".", "py", "\"", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Pars", "e", " ", "transcripts", " ", "from", " ", "GT", "F", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\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_", "##", " ", "Non", "-", "coding_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\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_", "##", " ", "Load", " ", "transcri", "pt", "\\u", "info", " ", "table", " ", "to", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\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_", "##", " ", "create", " ", "input", " ", "files", " ", "for", " ", "CAP", "seq", " ", "interval", " ", "annot", "ation", " ", "pipeline_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\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_", "##", " ", "TRANS", "CRI", "PTION", " ", "START", " ", "SITE", "S_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Copy", " ", "rele", "van", "t", " ", "files", " ", "from", " ", "Ens", "embl", " ", "build_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "#####", "_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
plotly/plotly.py/plotly/widgets/__init__.py
[ { "content": "from __future__ import absolute_import\n\nfrom plotly.widgets.graph_widget import GraphWidget\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from plotly.widgets.graph_widget import GraphWidget", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 51 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "plotly", "_", "._", "widgets_", "._", "graph", "\\u", "widget_", "import_", "Graph", "Widget_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
Variable defined multiple times
benoitc/gaffer/test/test_keys.py
[ { "content": "def test_sqlite_backend():\n conf = test_config()\n loop = pyuv.Loop.default_loop()\n\n with SqliteKeyBackend(loop, conf) as h:\n h.set_key(\"test\", {\"permission\": {}})\n\n with pytest.raises(KeyConflict):\n h.set_key(\"test\", {\"permission\": {}})\n\n assert h.has_key(\"test\") == True\n\n key = h.get_key(\"test\")\n assert key == {\"key\": \"test\", \"permission\": {}}\n\n key = h.delete_key(\"test\")\n with pytest.raises(KeyNotFound):\n key = h.get_key(\"test\")\n\n h.set_key(\"test\", {\"permission\": {}})\n h.set_key(\"test1\", {\"permission\": {}}, \"test\")\n\n assert h.has_key(\"test1\") == True\n assert h.all_subkeys(\"test\") == [{\"key\": \"test1\", \"permission\": {}}]\n assert len(h.all_keys()) == 2\n assert h.all_keys() == [\"test\", \"test1\"]\n assert h.all_keys(include_key=True) == [{\"key\": \"test\",\n \"permission\": {}}, {\"key\": \"test1\", \"permission\": {}}]", "metadata": "root.test_sqlite_backend", "header": "['module', '___EOS___']", "index": 15 }, { "content": "def test_key_manager():\n conf = test_config()\n loop = pyuv.Loop.default_loop()\n\n with KeyManager(loop, conf) as h:\n h.set_key(\"test\", {\"permission\": {}})\n\n with pytest.raises(KeyConflict):\n h.set_key(\"test\", {\"permission\": {}})\n\n assert h.has_key(\"test\") == True\n\n key = h.get_key(\"test\")\n assert key == {\"key\": \"test\", \"permission\": {}}\n assert len(h._cache) == 1\n assert \"test\" in h._cache\n assert len(h._entries) == 1\n assert list(h._entries) == [\"test\"]\n\n\n key = h.delete_key(\"test\")\n with pytest.raises(KeyNotFound):\n key = h.get_key(\"test\")\n\n h.set_key(\"test\", {\"permission\": {}})\n h.set_key(\"test1\", {\"permission\": {}}, \"test\")\n\n assert h.has_key(\"test1\") == True\n assert h.all_subkeys(\"test\") == [{\"key\": \"test1\", \"permission\": {}}]\n assert len(h.all_keys()) == 2\n assert h.all_keys() == [\"test\", \"test1\"]\n assert h.all_keys(include_key=True) == [{\"key\": \"test\",\n \"permission\": {}}, {\"key\": \"test1\", \"permission\": {}}]\n\n h.get_key(\"test\")\n h.get_key(\"test1\")\n assert len(h._cache) == 2\n assert \"test\" in h._cache\n assert \"test1\" in h._cache\n assert len(h._entries) == 2\n assert list(h._entries) == [\"test\", \"test1\"]\n\n # make sure keys are deleted from the cache\n h.delete_key(\"test\")\n assert len(h._cache) == 0\n assert len(h._entries) == 0\n\n with pytest.raises(KeyNotFound):\n key = h.get_key(\"test\")\n\n with pytest.raises(KeyNotFound):\n key = h.get_key(\"test1\")", "metadata": "root.test_key_manager", "header": "['module', '___EOS___']", "index": 44 } ]
[ { "span": "key ", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 11 }, { "span": "key ", "start_line": 64, "start_column": 8, "end_line": 64, "end_column": 11 }, { "span": "key ", "start_line": 66, "start_column": 12, "end_line": 66, "end_column": 15 }, { "span": "key ", "start_line": 92, "start_column": 12, "end_line": 92, "end_column": 15 } ]
[ { "span": "key ", "start_line": 32, "start_column": 12, "end_line": 32, "end_column": 15 }, { "span": "key ", "start_line": 95, "start_column": 12, "end_line": 95, "end_column": 15 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sql", "ite", "\\u", "backend_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "=_", "test\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loop_", "=_", "pyu", "v_", "._", "Loop_", "._", "default", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "Sqlite", "Key", "Backend_", "(_", "loop_", ",_", "conf_", ")_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Conflict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "h_", "._", "has", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "key_", "==_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "h_", "._", "delete", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Not", "Found_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "1", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ",_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "h_", "._", "has", "\\u", "key_", "(_", "\"", "test", "1", "\"_", ")_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "subkey", "s_", "(_", "\"", "test", "\"_", ")_", "==_", "[_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "1", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "all", "\\u", "keys_", "(_", ")_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "keys_", "(_", ")_", "==_", "[_", "\"", "test", "\"_", ",_", "\"", "test", "1", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "keys_", "(_", "include", "\\u", "key_", "=_", "True_", ")_", "==_", "[_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ",_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "1", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "key", "\\u", "manager_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf_", "=_", "test\\u", "config_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "loop_", "=_", "pyu", "v_", "._", "Loop_", "._", "default", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "Key", "Manager_", "(_", "loop_", ",_", "conf_", ")_", "as_", "h_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Conflict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "h_", "._", "has", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "key_", "==_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "cache_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "test", "\"_", "in_", "h_", "._", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "entries_", ")_", "==_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "list_", "(_", "h_", "._", "\\u", "entries_", ")_", "==_", "[_", "\"", "test", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "h_", "._", "delete", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Not", "Found_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "set\\u", "key_", "(_", "\"", "test", "1", "\"_", ",_", "{_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ",_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "h_", "._", "has", "\\u", "key_", "(_", "\"", "test", "1", "\"_", ")_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "subkey", "s_", "(_", "\"", "test", "\"_", ")_", "==_", "[_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "1", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "all", "\\u", "keys_", "(_", ")_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "keys_", "(_", ")_", "==_", "[_", "\"", "test", "\"_", ",_", "\"", "test", "1", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "h_", "._", "all", "\\u", "keys_", "(_", "include", "\\u", "key_", "=_", "True_", ")_", "==_", "[_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", ",_", "{_", "\"", "key", "\"_", ":_", "\"", "test", "1", "\"_", ",_", "\"", "permissi", "on", "\"_", ":_", "{_", "}_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "cache_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "test", "\"_", "in_", "h_", "._", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "\"", "test", "1", "\"_", "in_", "h_", "._", "\\u", "cache_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "entries_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "list_", "(_", "h_", "._", "\\u", "entries_", ")_", "==_", "[_", "\"", "test", "\"_", ",_", "\"", "test", "1", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "keys", " ", "are", " ", "delete", "d", " ", "from", " ", "the", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "h_", "._", "delete", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "cache_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "h_", "._", "\\u", "entries_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Not", "Found_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Key", "Not", "Found_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "h_", "._", "get", "\\u", "key_", "(_", "\"", "test", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" 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py
[ { "content": "__author__ = 'abdul'\n\n\n\nimport server\n\nfrom mongoctl.utils import resolve_path\nfrom mongoctl.mongoctl_logging import log_verbose, log_debug, log_exception, \\\n log_warning\n\nfrom bson.son import SON\nfrom mongoctl.errors import MongoctlException\nfrom replicaset_cluster import ReplicaSetCluster, get_member_repl_lag\nfrom sharded_cluster import ShardedCluster\n###############################################################################\n# CONSTANTS\n###############################################################################\n\n# This is mongodb's default dbpath\nDEFAULT_DBPATH='/data/db'\n\nLOCK_FILE_NAME = \"mongod.lock\"\n\n###############################################################################\n# MongodServer Class\n###############################################################################\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MongodServer(server.Server):\n\n ###########################################################################\n # Constructor\n ###########################################################################\n\n ###########################################################################\n # Properties\n ###########################################################################\n\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\n\n ###########################################################################\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.MongodServer", "header": "['module', '___EOS___']", "index": 27 }, { "content": " def __init__(self, server_doc):\n super(MongodServer, self).__init__(server_doc)", "metadata": "root.MongodServer.__init__", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 32 }, { "content": " def get_db_path(self):\n dbpath = self.get_cmd_option(\"dbpath\")\n if not dbpath:\n dbpath = super(MongodServer, self).get_server_home()\n if not dbpath:\n dbpath = DEFAULT_DBPATH\n\n return resolve_path(dbpath)", "metadata": "root.MongodServer.get_db_path", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 39 }, { "content": " def get_server_home(self):\n \"\"\"\n Override!\n :return:\n \"\"\"\n home_dir = super(MongodServer, self).get_server_home()\n if not home_dir:\n home_dir = self.get_db_path()\n\n return home_dir", "metadata": "root.MongodServer.get_server_home", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 49 }, { "content": " def export_cmd_options(self, options_override=None, standalone=False):\n \"\"\"\n Override!\n :return:\n \"\"\"\n cmd_options = super(MongodServer, self).export_cmd_options(\n options_override=options_override)\n\n # reset some props to exporting vals\n cmd_options['dbpath'] = self.get_db_path()\n\n if 'repairpath' in cmd_options:\n cmd_options['repairpath'] = resolve_path(cmd_options['repairpath'])\n\n # Add ReplicaSet args if a cluster is configured\n\n repl_cluster = self.get_replicaset_cluster()\n if repl_cluster is not None:\n if \"replSet\" not in cmd_options:\n cmd_options[\"replSet\"] = repl_cluster.id\n\n # apply standalone if specified\n if standalone:\n if \"replSet\" in cmd_options:\n del cmd_options[\"replSet\"]\n if \"keyFile\" in cmd_options:\n del cmd_options[\"keyFile\"]\n\n # add configsvr as needed\n if self.is_config_server():\n cmd_options[\"configsvr\"] = True\n\n # add shardsvr as needed\n if self.is_shard_server():\n cmd_options[\"shardsvr\"] = True\n\n return cmd_options", "metadata": "root.MongodServer.export_cmd_options", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 61 }, { "content": " def get_seed_users(self):\n \"\"\"\n Override!\n :return:\n \"\"\"\n seed_users = super(MongodServer, self).get_seed_users()\n # exempt database users for config servers\n if seed_users and self.is_config_server():\n for dbname in seed_users.keys():\n if dbname not in [\"admin\", \"local\", \"config\"]:\n del seed_users[dbname]\n\n return seed_users", "metadata": "root.MongodServer.get_seed_users", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 100 }, { "content": " def get_lock_file_path(self):\n return self.get_default_file_path(LOCK_FILE_NAME)", "metadata": "root.MongodServer.get_lock_file_path", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 115 }, { "content": " def is_master(self):\n return self.get_cmd_option(\"master\")", "metadata": "root.MongodServer.is_master", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 120 }, { "content": " def is_slave(self):\n return self.get_cmd_option(\"slave\")", "metadata": "root.MongodServer.is_slave", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 124 }, { "content": " def set_auth(self,auth):\n self.set_cmd_option(\"auth\", auth)", "metadata": "root.MongodServer.set_auth", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 128 }, { "content": " def is_administrable(self):\n return not self.is_arbiter_server() and self.can_function()", "metadata": "root.MongodServer.is_administrable", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 133 }, { "content": " def get_status(self, admin=False):\n\n # get status for super\n status = super(MongodServer, self).get_status(admin=admin)\n\n if \"error\" not in status and admin:\n rs_summary = self.get_rs_status_summary()\n if rs_summary:\n status[\"selfReplicaSetStatusSummary\"] = rs_summary\n\n return status", "metadata": "root.MongodServer.get_status", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 137 }, { "content": " def get_rs_status_summary(self):\n if self.is_replicaset_member():\n member_rs_status = self.get_member_rs_status()\n if member_rs_status:\n return {\n \"name\": member_rs_status['name'],\n \"stateStr\": member_rs_status['stateStr']\n }", "metadata": "root.MongodServer.get_rs_status_summary", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 150 }, { "content": " def is_cluster_connection_member(self):\n return not self.is_arbiter_server()", "metadata": "root.MongodServer.is_cluster_connection_member", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 160 }, { "content": " def is_arbiter_server(self):\n cluster = self.get_cluster()\n return (isinstance(cluster, ReplicaSetCluster) and\n cluster.get_member_for(self).is_arbiter())", "metadata": "root.MongodServer.is_arbiter_server", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 164 }, { "content": " def is_replicaset_member(self):\n cluster = self.get_cluster()\n return isinstance(cluster, ReplicaSetCluster)", "metadata": "root.MongodServer.is_replicaset_member", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 170 }, { "content": " def get_replicaset_cluster(self):\n cluster = self.get_cluster()\n if isinstance(cluster, ReplicaSetCluster):\n return cluster", "metadata": "root.MongodServer.get_replicaset_cluster", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 175 }, { "content": " def is_config_server(self):\n cluster = self.get_cluster()\n\n return ((isinstance(cluster, ShardedCluster) and\n cluster.has_config_server(self)) or\n self.get_cmd_option(\"configsvr\"))", "metadata": "root.MongodServer.is_config_server", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 181 }, { "content": " def is_shard_server(self):\n cluster = self.get_cluster()\n if isinstance(cluster, ShardedCluster):\n return cluster.has_shard(self)\n elif isinstance(cluster, ReplicaSetCluster):\n return cluster.is_shard_member()", "metadata": "root.MongodServer.is_shard_server", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 189 }, { "content": " def command_needs_auth(self, dbname, cmd):\n # isMaster command does not need auth\n if \"isMaster\" in cmd or \"ismaster\" in cmd:\n return False\n if 'shutdown' in cmd and self.is_arbiter_server():\n return False\n\n # otherwise use default behavior\n return super(MongodServer, self).command_needs_auth(dbname, cmd)", "metadata": "root.MongodServer.command_needs_auth", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 197 }, { "content": " def get_mongo_uri_template(self, db=None):\n if not db:\n if self.is_auth():\n db = \"/[dbname]\"\n else:\n db = \"\"\n else:\n db = \"/\" + db\n\n creds = \"[dbuser]:[dbpass]@\" if self.is_auth() else \"\"\n return \"mongodb://%s%s%s\" % (creds, self.get_address_display(), db)", "metadata": "root.MongodServer.get_mongo_uri_template", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 208 }, { "content": " def get_rs_status(self):\n try:\n rs_status_cmd = SON([('replSetGetStatus', 1)])\n rs_status = self.db_command(rs_status_cmd, 'admin')\n return rs_status\n except (Exception,RuntimeError), e:\n log_debug(\"Cannot get rs status from server '%s'. cause: %s\" %\n (self.id, e))\n log_exception(e)\n return None", "metadata": "root.MongodServer.get_rs_status", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 221 }, { "content": " def get_member_rs_status(self):\n rs_status = self.get_rs_status()\n if rs_status:\n try:\n for member in rs_status['members']:\n if 'self' in member and member['self']:\n return member\n except (Exception,RuntimeError), e:\n log_debug(\"Cannot get member rs status from server '%s'.\"\n \" cause: %s\" % (self.id, e))\n log_exception(e)\n\n return None", "metadata": "root.MongodServer.get_member_rs_status", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 233 }, { "content": " def is_primary(self):\n master_result = self.is_master_command()\n\n if master_result:\n return master_result.get(\"ismaster\")", "metadata": "root.MongodServer.is_primary", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 248 }, { "content": " def is_secondary(self):\n master_result = self.is_master_command()\n\n if master_result:\n return master_result.get(\"secondary\")", "metadata": "root.MongodServer.is_secondary", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 255 }, { "content": " def is_master_command(self):\n try:\n if self.is_online():\n result = self.db_command({\"isMaster\" : 1}, \"admin\")\n return result\n\n except(Exception, RuntimeError),e:\n log_verbose(\"isMaster command failed on server '%s'. Cause %s\" %\n (self.id, e))", "metadata": "root.MongodServer.is_master_command", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 262 }, { "content": " def has_joined_replica(self):\n master_result = self.is_master_command()\n if master_result:\n return (master_result.get(\"setName\") is not None or\n master_result.get(\"ismaster\") or\n master_result.get(\"arbiterOnly\") or\n master_result.get(\"secondary\"))", "metadata": "root.MongodServer.has_joined_replica", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 273 }, { "content": " def get_repl_lag(self, master_status):\n \"\"\"\n Given two 'members' elements from rs.status(),\n return lag between their optimes (in secs).\n \"\"\"\n member_status = self.get_member_rs_status()\n\n if not member_status:\n raise MongoctlException(\"Unable to determine replicaset status for\"\n \" member '%s'\" %\n self.id)\n\n return get_member_repl_lag(member_status, master_status)", "metadata": "root.MongodServer.get_repl_lag", "header": "['class', 'MongodServer', '(', 'server', '.', 'Server', ')', ':', '___NEWLINE___', '___NL___', '###########################################################################', '___NL___', '# Constructor', '___NL___', '###########################################################################', '___NL___', '___EOS___']", "index": 282 } ]
[ { "span": "from mongoctl.mongoctl_logging import log_verbose, log_debug, log_exception, \\\n log_warning", "start_line": 7, "start_column": 0, "end_line": 8, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "abd", "ul", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "mongo", "ctl_", "._", "utils_", "import_", "resolve", "\\u", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mongo", "ctl_", "._", "mongo", "ctl", "\\u", "logging_", "import_", "log", "\\u", "verbose_", ",_", "log", "\\u", "debug_", ",_", "log", "\\u", "exception_", ",_", "log", "\\u", "warning_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "bson_", "._", "son_", "import_", "SON", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mongo", "ctl_", "._", "errors_", "import_", "Mon", "go", "ctl", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "replica", "set\\u", "cluster_", "import_", "Replica", "Set", "Cluster_", ",_", "get", "\\u", "member", "\\u", "repl", "\\u", "lag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "shard", "ed", "\\u", "cluster_", "import_", "Shard", "ed", "Cluster_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONSTANT", "S_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "mongodb", "'", "s", " ", "default", " ", "dbpa", "th_", "\\u\\u\\uNL\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "DB", "PATH_", "=_", "'/", "data", "/", "db", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOCK", "\\u", "FILE", "\\u", "NAME_", "=_", "\"", "mongo", "d", ".", "lock", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Mon", "god", "Server", " ", "Class_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Properties_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "server", "\\u", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "server", "\\u", "doc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "db", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbpa", "th_", "=_", "self_", "._", "get", "\\u", "cmd", "\\u", "option_", "(_", "\"", "dbpa", "th", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "dbpa", "th_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbpa", "th_", "=_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "get", "\\u", "server", "\\u", "home_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "dbpa", "th_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dbpa", "th_", "=_", "DEF", "AUL", "T", "\\u", "DB", "PATH_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "resolve", "\\u", "path_", "(_", "dbpa", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "server", "\\u", "home_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", "!", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "home", "\\u", "dir_", "=_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "get", "\\u", "server", "\\u", "home_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "home", "\\u", "dir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "home", "\\u", "dir_", "=_", "self_", "._", "get", "\\u", "db", "\\u", "path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "home", "\\u", "dir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "export", "\\u", "cmd", "\\u", "options_", "(_", "self_", ",_", "options", "\\u", "override_", "=_", "None_", ",_", "standalone", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", "!", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "options_", "=_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "export", "\\u", "cmd", "\\u", "options_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "options", "\\u", "override_", "=_", "options", "\\u", "override_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reset", " ", "some", " ", "props", " ", "to", " ", "export", "ing", " ", "vals_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "options_", "[_", "'", "dbpa", "th", "'_", "]_", "=_", "self_", "._", "get", "\\u", "db", "\\u", "path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "repair", "path", "'_", "in_", "cmd", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "options_", "[_", "'", "repair", "path", "'_", "]_", "=_", "resolve", "\\u", "path_", "(_", "cmd", "\\u", "options_", "[_", "'", "repair", "path", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "Replica", "Set", " ", "args", " ", "if", " ", "a", " ", "cluster", " ", "is", " ", "configured_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "repl", "\\u", "cluster_", "=_", "self_", "._", "get", "\\u", "replica", "set\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "repl", "\\u", "cluster_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "repl", "Set", "\"_", "not_", "in_", "cmd", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "options_", "[_", "\"", "repl", "Set", "\"_", "]_", "=_", "repl", "\\u", "cluster_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appl", "y", " ", "standalone", " ", "if", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "standalone", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "repl", "Set", "\"_", "in_", "cmd", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "cmd", "\\u", "options_", "[_", "\"", "repl", "Set", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "key", "File", "\"_", "in_", "cmd", "\\u", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "cmd", "\\u", "options_", "[_", "\"", "key", "File", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "configs", "vr", " ", "as", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "config", "\\u", "server_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "options_", "[_", "\"", "configs", "vr", "\"_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "shard", "sv", "r", " ", "as", " ", "needed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "shard", "\\u", "server_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd", "\\u", "options_", "[_", "\"", "shard", "sv", "r", "\"_", "]_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cmd", "\\u", "options_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "seed", "\\u", "users_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Override", "!", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seed", "\\u", "users_", "=_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "get", "\\u", "seed", "\\u", "users_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "exemp", "t", " ", "databa", "se", " ", "users", " ", "for", " ", "config", " ", "servers_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "seed", "\\u", "users_", "and_", "self_", "._", "is", "\\u", "config", "\\u", "server_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "dbname_", "in_", "seed", "\\u", "users_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "dbname_", "not_", "in_", "[_", "\"", "admin", "\"_", ",_", "\"", "local", "\"_", ",_", "\"", "config", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "seed", "\\u", "users_", "[_", "dbname_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "seed", "\\u", "users_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "lock", "\\u", "file", "\\u", "path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "default", "\\u", "file", "\\u", "path_", "(_", "LOCK", "\\u", "FILE", "\\u", "NAME_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "master_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "cmd", "\\u", "option_", "(_", "\"", "master", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "slave_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "cmd", "\\u", "option_", "(_", "\"", "slave", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "set\\u", "auth_", "(_", "self_", ",_", "auth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "cmd", "\\u", "option_", "(_", "\"", "auth", "\"_", ",_", "auth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "admin", "istr", "able_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "self_", "._", "is", "\\u", "arb", "iter", "\\u", "server_", "(_", ")_", "and_", "self_", "._", "can", "\\u", "function_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "status_", "(_", "self_", ",_", "admin_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "status", " ", "for", " ", "super_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "get", "\\u", "status_", "(_", "admin_", "=_", "admin_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "\"", "error", "\"_", "not_", "in_", "status_", "and_", "admin_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rs", "\\u", "summary_", "=_", "self_", "._", "get", "\\u", "rs", "\\u", "status", "\\u", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rs", "\\u", "summary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "[_", "\"", "self", "Replica", "Set", "Status", "Summ", "ary", "\"_", "]_", "=_", "rs", "\\u", "summary_", "\\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_", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "rs", "\\u", "status", "\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "replica", "set\\u", "member_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "member", "\\u", "rs", "\\u", "status_", "=_", "self_", "._", "get", "\\u", "member", "\\u", "rs", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "member", "\\u", "rs", "\\u", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "member", "\\u", "rs", "\\u", "status_", "[_", "'", "name", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "state", "Str", "\"_", ":_", "member", "\\u", "rs", "\\u", "status_", "[_", "'", "state", "Str", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "cluster", "\\u", "connecti", "on", "\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "not_", "self_", "._", "is", "\\u", "arb", "iter", "\\u", "server_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "arb", "iter", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "get", "\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "isinstance_", "(_", "cluster_", ",_", "Replica", "Set", "Cluster_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "cluster_", "._", "get", "\\u", "member", "\\u", "for_", "(_", "self_", ")_", "._", "is", "\\u", "arb", "iter_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "replica", "set\\u", "member_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "get", "\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "isinstance_", "(_", "cluster_", ",_", "Replica", "Set", "Cluster_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "replica", "set\\u", "cluster_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "get", "\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "cluster_", ",_", "Replica", "Set", "Cluster_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cluster_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "config", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "get", "\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "(_", "isinstance_", "(_", "cluster_", ",_", "Shard", "ed", "Cluster_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "cluster_", "._", "has", "\\u", "config", "\\u", "server_", "(_", "self_", ")_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "get", "\\u", "cmd", "\\u", "option_", "(_", "\"", "configs", "vr", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\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_", "is", "\\u", "shard", "\\u", "server_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cluster_", "=_", "self_", "._", "get", "\\u", "cluster_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "cluster_", ",_", "Shard", "ed", "Cluster_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cluster_", "._", "has", "\\u", "shard_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "cluster_", ",_", "Replica", "Set", "Cluster_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cluster_", "._", "is", "\\u", "shard", "\\u", "member_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "command", "\\u", "need", "s", "\\u", "auth_", "(_", "self_", ",_", "dbname_", ",_", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", "Master", " ", "command", " ", "doe", "s", " ", "not", " ", "need", " ", "auth_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\"", "is", "Master", "\"_", "in_", "cmd_", "or_", "\"", "isma", "ster", "\"_", "in_", "cmd_", ":_", "\\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_", "'", "shut", "down", "'_", "in_", "cmd_", "and_", "self_", "._", "is", "\\u", "arb", "iter", "\\u", "server_", "(_", ")_", ":_", "\\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_", "#", " ", "other", "wis", "e", " ", "use", " ", "default", " ", "behavior_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "super_", "(_", "Mon", "god", "Server_", ",_", "self_", ")_", "._", "command", "\\u", "need", "s", "\\u", "auth_", "(_", "dbname_", ",_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "mongo", "\\u", "uri", "\\u", "template_", "(_", "self_", ",_", "db_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "db_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "auth_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "\"/", "[", "db", "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 ", " _", "db_", "=_", "\"\"_", "\\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 ", " _", "db_", "=_", "\"/\"_", "+_", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "creds_", "=_", "\"[", "dbus", "er", "]:", "[", "dbpa", "ss", "]", "@\"_", "if_", "self_", "._", "is", "\\u", "auth_", "(_", ")_", "else_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "mongodb", "://", "%", "s", "%", "s", "%", "s", "\"_", "%_", "(_", "creds_", ",_", "self_", "._", "get", "\\u", "address", "\\u", "display_", "(_", ")_", ",_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "rs", "\\u", "status_", "(_", "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 ", " _", "rs", "\\u", "status", "\\u", "cmd_", "=_", "SON", "_", "(_", "[_", "(_", "'", "repl", "Set", "Get", "Status", "'_", ",_", "1_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rs", "\\u", "status_", "=_", "self_", "._", "db", "\\u", "command_", "(_", "rs", "\\u", "status", "\\u", "cmd_", ",_", "'", "admin", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "rs", "\\u", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Exception_", ",_", "Run", "time", "Error_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "debug_", "(_", "\"", "Cann", "ot", " ", "get", " ", "rs", " ", "status", " ", "from", " ", "server", " ", "'%", "s", "'.", " ", "caus", "e", ":", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "id_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "member", "\\u", "rs", "\\u", "status_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rs", "\\u", "status_", "=_", "self_", "._", "get", "\\u", "rs", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rs", "\\u", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "member_", "in_", "rs", "\\u", "status_", "[_", "'", "member", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "'", "self", "'_", "in_", "member_", "and_", "member_", "[_", "'", "self", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "member_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Exception_", ",_", "Run", "time", "Error_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "debug_", "(_", "\"", "Cann", "ot", " ", "get", " ", "member", " ", "rs", " ", "status", " ", "from", " ", "server", " ", "'%", "s", "'.\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "caus", "e", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "id_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "primary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "\\u", "result_", "=_", "self_", "._", "is", "\\u", "master", "\\u", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "master", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "isma", "ster", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "secondary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "\\u", "result_", "=_", "self_", "._", "is", "\\u", "master", "\\u", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "master", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "second", "ary", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "master", "\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "online_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "db", "\\u", "command_", "(_", "{_", "\"", "is", "Master", "\"_", ":_", "1_", "}_", ",_", "\"", "admin", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Exception_", ",_", "Run", "time", "Error_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log", "\\u", "verbose_", "(_", "\"", "is", "Master", " ", "command", " ", "fail", "ed", " ", "on", " ", "server", " ", "'%", "s", "'.", " ", "Cause", " ", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "id_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "joine", "d\\u", "replica_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "master", "\\u", "result_", "=_", "self_", "._", "is", "\\u", "master", "\\u", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "master", "\\u", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "set", "Name", "\"_", ")_", "is_", "not_", "None_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "isma", "ster", "\"_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "arb", "iter", "On", "ly", "\"_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "result_", "._", "get_", "(_", "\"", "second", "ary", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mon", "god", "Server_", "(_", "server_", "._", "Server_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "repl", "\\u", "lag_", "(_", "self_", ",_", "master", "\\u", "status_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "two", " ", "'", "member", "s", "'", " ", "element", "s", " ", "from", " ", "rs", ".", "status", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "lag", " ", "bet", "ween", " ", "thei", "r", " ", "optim", "es", " ", "(", "in", " ", "secs", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "member", "\\u", "status_", "=_", "self_", "._", "get", "\\u", "member", "\\u", "rs", "\\u", "status_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "member", "\\u", "status_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Mon", "go", "ctl", "Exception_", "(_", "\"", "Una", "ble", " ", "to", " ", "dete", "rmin", "e", " ", "replica", "set", " ", "status", " ", "for", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "member", " ", "'%", "s", "'\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "get", "\\u", "member", "\\u", "repl", "\\u", "lag_", "(_", "member", "\\u", "status_", ",_", "master", "\\u", "status_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
marcusmoller/pyorpg-server/src/database.py
[ { "content": "def findChar(name):\n query = database.sendQuery(\"SELECT * FROM characters WHERE name='%s';\" % name)\n rows = query.fetchone()\n\n if rows == None:\n return False\n\n else:\n return True", "metadata": "root.findChar", "header": "['module', '___EOS___']", "index": 226 }, { "content": "def savePlayer(index):\n # check if character/player already exists\n query = database.sendQuery(\"SELECT * FROM characters WHERE name='%s';\" % getPlayerName(index))\n rows = query.fetchone()\n\n if rows == None:\n # character/player doesnt exist, create it\n\n # get account id\n query = database.sendQuery(\"SELECT id FROM accounts WHERE username='%s';\" % getPlayerLogin(index))\n result = query.fetchone()\n accountID = result['id']\n\n # save character\n query = database.sendQuery(\"INSERT INTO characters (account_id, name, class, sprite, level, exp, access, map, x, y, direction, helmet, armor, weapon, shield, stats_strength, stats_defense, stats_speed, stats_magic, vital_hp, vital_mp, vital_sp) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (accountID, \\\n getPlayerName(index), \\\n getPlayerClass(index), \\\n getPlayerSprite(index), \\\n getPlayerLevel(index), \\\n getPlayerExp(index), \\\n getPlayerAccess(index), \\\n getPlayerMap(index), \\\n getPlayerX(index), \\\n getPlayerY(index), \\\n getPlayerDir(index), \\\n getPlayerEquipmentSlot(index, Equipment.helmet), \\\n getPlayerEquipmentSlot(index, Equipment.armor), \\\n getPlayerEquipmentSlot(index, Equipment.weapon), \\\n getPlayerEquipmentSlot(index, Equipment.shield), \\\n getPlayerStat(index, Stats.strength), \\\n getPlayerStat(index, Stats.defense), \\\n getPlayerStat(index, Stats.speed), \\\n getPlayerStat(index, Stats.magic), \\\n getPlayerVital(index, Vitals.hp), \\\n getPlayerVital(index, Vitals.mp), \\\n getPlayerVital(index, Vitals.sp)))\n\n elif len(rows) > 0:\n # character/player exists, so update the character\n charId = rows['id']\n\n query = database.sendQuery(\"\"\"UPDATE characters SET sprite=?,\n level=?,\n exp=?,\n map=?,\n x=?,\n y=?,\n access=?,\n direction=?,\n helmet=?, armor=?, weapon=?, shield=?,\n stats_strength=?, stats_defense=?, stats_speed=?, stats_magic=?,\n vital_hp=?, vital_mp=?, vital_sp=?\n WHERE name=?;\"\"\", (getPlayerSprite(index), \\\n getPlayerLevel(index), \\\n getPlayerExp(index), \\\n getPlayerMap(index), \\\n getPlayerX(index), \\\n getPlayerY(index), \\\n getPlayerAccess(index), \\\n getPlayerDir(index), \\\n getPlayerEquipmentSlot(index, Equipment.helmet), \\\n getPlayerEquipmentSlot(index, Equipment.armor), \\\n getPlayerEquipmentSlot(index, Equipment.weapon), \\\n getPlayerEquipmentSlot(index, Equipment.shield), \\\n getPlayerStat(index, Stats.strength), \\\n getPlayerStat(index, Stats.defense), \\\n getPlayerStat(index, Stats.speed), \\\n getPlayerStat(index, Stats.magic), \\\n getPlayerVital(index, Vitals.hp), \\\n getPlayerVital(index, Vitals.mp), \\\n getPlayerVital(index, Vitals.sp), \\\n getPlayerName(index)))\n\n # save inventory\n for i in range(MAX_INV):\n if getPlayerInvItemNum(index, i) != None:\n # add item to inventory if its not already there\n itemNum = getPlayerInvItemNum(index, i)\n\n # check if its already there\n invQuery = database.sendQuery(\"SELECT * FROM inventory WHERE (character_id=%i AND item_id=%i);\" % (charId, (itemNum+1)))\n invRows = query.fetchone()\n\n if invRows == None:\n # doesnt exist so add item\n invQuery = database.sendQuery('INSERT INTO inventory (character_id, item_id, value, durability) \\\n VALUES (%i, %i, %i, %i);' \\\n % (charId, \\\n (getPlayerInvItemNum(index, i)+1),\n getPlayerInvItemValue(index, i),\n getPlayerInvItemDur(index, i)))\n\n elif len(invRows) > 0:\n # item has already been added, update value and durability\n # get id\n rowId = invRows['id']\n invQuery = database.sendQuery('UPDATE inventory SET value=%i, durability=%i WHERE id=%i;' % (getPlayerInvItemValue(index, i), getPlayerInvItemDur(index, i), rowId))\n\n for i in range(MAX_PLAYER_SPELLS):\n if getPlayerSpell(index, i) is not None:\n spellNum = getPlayerSpell(index, i)\n\n # check if its already there\n spbQuery = database.sendQuery(\"SELECT * FROM spellbook WHERE (character_id=%i AND spellnum=%i);\" % (charId, (spellNum+1)))\n spbRows = query.fetchone()\n\n if spbRows is None:\n # doesnt exist, so add the spell\n spbQuery = database.sendQuery('INSERT INTO spellbook (character_id, spellnum) \\\n VALUES (?, ?);', \\\n (charId, \\\n spellNum+1))\n\n elif len(spbRows) > 0:\n # item is already there, so do nothing\n continue\n\n database.saveChanges()", "metadata": "root.savePlayer", "header": "['module', '___EOS___']", "index": 243 }, { "content": "def saveItem(itemNum):\n # todo: rework the id part\n\n # check if item already exists\n query = database.sendQuery(\"SELECT * FROM items WHERE id=%i;\" % (itemNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # item doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO items (id, name, pic, type, data1, data2, data3) \\\n VALUES (%i, '%s', %i, %i, %i, %i, %i);\" \\\n % (int(itemNum+1), \\\n Item[itemNum].name, \\\n Item[itemNum].pic, \\\n Item[itemNum].type, \\\n Item[itemNum].data1, \\\n Item[itemNum].data2, \\\n Item[itemNum].data3))\n\n elif len(rows) > 0:\n # item already exists, so update the item\n query = database.sendQuery(\"UPDATE items SET name='%s', \\\n pic=%i, \\\n type=%i, \\\n data1=%i, \\\n data2=%i, \\\n data3=%i \\\n WHERE id=%i;\" % (Item[itemNum].name, \\\n Item[itemNum].pic, \\\n Item[itemNum].type, \\\n Item[itemNum].data1, \\\n Item[itemNum].data2, \\\n Item[itemNum].data3, \\\n int(itemNum+1)))\n\n database.saveChanges()", "metadata": "root.saveItem", "header": "['module', '___EOS___']", "index": 504 }, { "content": "def saveSpell(spellNum):\n # todo: rework the id part\n\n # check if spell already exists\n query = database.sendQuery(\"SELECT * FROM spells WHERE id=%i;\" % (spellNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # spell doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO spells (id, name, pic, type, reqmp, reqclass, reqlevel, data1, data2, data3) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (int(spellNum+1), \\\n Spell[spellNum].name, \\\n Spell[spellNum].pic, \\\n Spell[spellNum].type, \\\n Spell[spellNum].reqMp, \\\n Spell[spellNum].reqClass, \\\n Spell[spellNum].reqLevel, \\\n Spell[spellNum].data1, \\\n Spell[spellNum].data2, \\\n Spell[spellNum].data3))\n\n elif len(rows) > 0:\n # spell already exists, so update the spell\n query = database.sendQuery(\"UPDATE spells SET name=?, \\\n pic=?, \\\n type=?, \\\n reqmp=?, \\\n reqclass=?, \\\n reqlevel=?, \\\n data1=?, \\\n data2=?, \\\n data3=? \\\n WHERE id=?;\", (Spell[spellNum].name, \\\n Spell[spellNum].pic, \\\n Spell[spellNum].type, \\\n Spell[spellNum].reqMp, \\\n Spell[spellNum].reqClass, \\\n Spell[spellNum].reqLevel, \\\n Spell[spellNum].data1, \\\n Spell[spellNum].data2, \\\n Spell[spellNum].data3, \\\n int(spellNum+1)))\n\n database.saveChanges()", "metadata": "root.saveSpell", "header": "['module', '___EOS___']", "index": 565 }, { "content": "def saveNpc(npcNum):\n # todo: rework the id part\n\n # check if npc already exists\n query = database.sendQuery(\"SELECT * FROM npcs WHERE id=%i;\" % (npcNum+1))\n rows = query.fetchone()\n\n if rows == None:\n # npc doesnt exist, create it\n query = database.sendQuery(\"INSERT INTO npcs (id, name, sprite, attack_say, spawn_secs, behavior, range, drop_chance, drop_item, drop_item_value, stat_strength, stat_defense, stat_magic, stat_speed) \\\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\", \\\n (int(npcNum+1), \\\n NPC[npcNum].name, \\\n NPC[npcNum].sprite, \\\n NPC[npcNum].attackSay, \\\n NPC[npcNum].spawnSecs, \\\n NPC[npcNum].behaviour, \\\n NPC[npcNum].range, \\\n NPC[npcNum].dropChance, \\\n NPC[npcNum].dropItem, \\\n NPC[npcNum].dropItemValue, \\\n NPC[npcNum].stat[Stats.strength], \\\n NPC[npcNum].stat[Stats.defense], \\\n NPC[npcNum].stat[Stats.magic], \\\n NPC[npcNum].stat[Stats.speed]))\n\n elif len(rows) > 0:\n # npc already exists, so update the npc\n query = database.sendQuery(\"UPDATE npcs SET name=?, \\\n sprite=?, \\\n attack_say=?, \\\n spawn_secs=?, \\\n behavior=?, \\\n range=?, \\\n drop_chance=?, \\\n drop_item=?, \\\n drop_item_value=?, \\\n stat_strength=?, \\\n stat_defense=?, \\\n stat_magic=?, \\\n stat_speed=? \\\n WHERE id=?;\", (NPC[npcNum].name, \\\n NPC[npcNum].sprite, \\\n NPC[npcNum].attackSay, \\\n NPC[npcNum].spawnSecs, \\\n NPC[npcNum].behaviour, \\\n NPC[npcNum].range, \\\n NPC[npcNum].dropChance, \\\n NPC[npcNum].dropItem, \\\n NPC[npcNum].dropItemValue, \\\n NPC[npcNum].stat[Stats.strength], \\\n NPC[npcNum].stat[Stats.defense], \\\n NPC[npcNum].stat[Stats.magic], \\\n NPC[npcNum].stat[Stats.speed], \\\n int(npcNum+1)))\n\n database.saveChanges()", "metadata": "root.saveNpc", "header": "['module', '___EOS___']", "index": 646 } ]
[ { "span": "rows == None:", "start_line": 230, "start_column": 7, "end_line": 230, "end_column": 19 }, { "span": "rows == None:", "start_line": 248, "start_column": 7, "end_line": 248, "end_column": 19 }, { "span": "invRows == None:", "start_line": 328, "start_column": 19, "end_line": 328, "end_column": 34 }, { "span": "rows == None:", "start_line": 511, "start_column": 7, "end_line": 511, "end_column": 19 }, { "span": "rows == None:", "start_line": 572, "start_column": 7, "end_line": 572, "end_column": 19 }, { "span": "rows == None:", "start_line": 653, "start_column": 7, "end_line": 653, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "Char_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "character", "s", " ", "WHE", "RE", " ", "name", "='", "%", "s", "';", "\"_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Player_", "(_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "character", "/", "player", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "character", "s", " ", "WHE", "RE", " ", "name", "='", "%", "s", "';", "\"_", "%_", "get", "Player", "Name_", "(_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "character", "/", "player", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "account", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "id", " ", "FROM", " ", "account", "s", " ", "WHE", "RE", " ", "user", "name", "='", "%", "s", "';", "\"_", "%_", "get", "Player", "Login_", "(_", "index_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account", "ID_", "=_", "result_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "character", "s", " ", "(", "account", "\\u", "id", ",", " ", "name", ",", " ", "class", ",", " ", "spri", "te", ",", " ", "level", ",", " ", "exp", ",", " ", "access", ",", " ", "map", ",", " ", "x", ",", " ", "y", ",", " ", "direction", ",", " ", "helm", "et", ",", " ", "armo", "r", ",", " ", "weapon", ",", " ", "shield", ",", " ", "stats", "\\u", "streng", "th", ",", " ", "stats", "\\u", "defense", ",", " ", "stats", "\\u", "speed", ",", " ", "stats", "\\u", "magic", ",", " ", "vita", "l\\u", "hp", ",", " ", "vita", "l\\u", "mp", ",", " ", "vita", "l\\u", "sp", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "account", "ID_", ",_", "get", "Player", "Name_", "(_", "index_", ")_", ",_", "get", "Player", "Class_", "(_", "index_", ")_", ",_", "get", "Player", "Sprite_", "(_", "index_", ")_", ",_", "get", "Player", "Level_", "(_", "index_", ")_", ",_", "get", "Player", "Exp_", "(_", "index_", ")_", ",_", "get", "Player", "Access_", "(_", "index_", ")_", ",_", "get", "Player", "Map_", "(_", "index_", ")_", ",_", "get", "Player", "X_", "(_", "index_", ")_", ",_", "get", "Player", "Y_", "(_", "index_", ")_", ",_", "get", "Player", "Dir_", "(_", "index_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "helm", "et_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "armor_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "weapon_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "shield", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "strength_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "defense", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "speed_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "magic_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "hp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "mp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "sp_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "character", "/", "player", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "character_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "Id_", "=_", "rows_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"\"\"", "UPDATE", " ", "character", "s", " ", "SET", " ", "spri", "te", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "level", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "exp", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "map", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "x", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "y", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "access", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "direction", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "helm", "et", "=?", ",", " ", "armo", "r", "=?", ",", " ", "weapon", "=?", ",", " ", "shield", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "stats", "\\u", "streng", "th", "=?", ",", " ", "stats", "\\u", "defense", "=?", ",", " ", "stats", "\\u", "speed", "=?", ",", " ", "stats", "\\u", "magic", "=?", ",", "\\", "10", ";", " ", " ", " ", " ", "vita", "l\\u", "hp", "=?", ",", " ", "vita", "l\\u", "mp", "=?", ",", " ", "vita", "l\\u", "sp", "=?", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "name", "=?", ";\"\"\"_", ",_", "(_", "get", "Player", "Sprite_", "(_", "index_", ")_", ",_", "get", "Player", "Level_", "(_", "index_", ")_", ",_", "get", "Player", "Exp_", "(_", "index_", ")_", ",_", "get", "Player", "Map_", "(_", "index_", ")_", ",_", "get", "Player", "X_", "(_", "index_", ")_", ",_", "get", "Player", "Y_", "(_", "index_", ")_", ",_", "get", "Player", "Access_", "(_", "index_", ")_", ",_", "get", "Player", "Dir_", "(_", "index_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "helm", "et_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "armor_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "weapon_", ")_", ",_", "get", "Player", "Equip", "ment", "Slot_", "(_", "index_", ",_", "Equip", "ment_", "._", "shield", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "strength_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "defense", "_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "speed_", ")_", ",_", "get", "Player", "Stat_", "(_", "index_", ",_", "Stats_", "._", "magic_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "hp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "mp_", ")_", ",_", "get", "Player", "Vit", "al_", "(_", "index_", ",_", "Vit", "als_", "._", "sp_", ")_", ",_", "get", "Player", "Name_", "(_", "index_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "save", " ", "inventory_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "MAX", "\\u", "INV", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "item", " ", "to", " ", "inventor", "y", " ", "if", " ", "its", " ", "not", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item", "Num_", "=_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "its", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "inventor", "y", " ", "WHE", "RE", " ", "(", "character", "\\u", "id", "=", "%", "i", " ", "AND", " ", "item", "\\u", "id", "=", "%", "i", ");\"_", "%_", "(_", "char", "Id_", ",_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "Rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "inv", "Rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "doesnt", " ", "exist", " ", "so", " ", "add", " ", "item_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "INSERT", " ", "INT", "O", " ", "inventor", "y", " ", "(", "character", "\\u", "id", ",", " ", "item", "\\u", "id", ",", " ", "value", ",", " ", "durab", "ilit", "y", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ");'_", "%_", "(_", "char", "Id_", ",_", "(_", "get", "Player", "Inv", "Item", "Num_", "(_", "index_", ",_", "i_", ")_", "+_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "Player", "Inv", "Item", "Value_", "(_", "index_", ",_", "i_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "get", "Player", "Inv", "Item", "Dur", "_", "(_", "index_", ",_", "i_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "inv", "Rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "adde", "d", ",", " ", "update", " ", "value", " ", "and", " ", "durab", "ility_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "row", "Id_", "=_", "inv", "Rows_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inv", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "UPDATE", " ", "inventor", "y", " ", "SET", " ", "value", "=", "%", "i", ",", " ", "durab", "ilit", "y", "=", "%", "i", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";'_", "%_", "(_", "get", "Player", "Inv", "Item", "Value_", "(_", "index_", ",_", "i_", ")_", ",_", "get", "Player", "Inv", "Item", "Dur", "_", "(_", "index_", ",_", "i_", ")_", ",_", "row", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "MAX", "\\u", "PLAYER", "\\u", "SPE", "LL", "S_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "get", "Player", "Spell", "_", "(_", "index_", ",_", "i_", ")_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spell", "Num_", "=_", "get", "Player", "Spell", "_", "(_", "index_", ",_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "its", " ", "alr", "ead", "y", " ", "there", "_", "\\u\\u\\uNL\\u\\u\\u_", "sp", "b", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "spell", "book", " ", "WHE", "RE", " ", "(", "character", "\\u", "id", "=", "%", "i", " ", "AND", " ", "spell", "num", "=", "%", "i", ");\"_", "%_", "(_", "char", "Id_", ",_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sp", "b", "Rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sp", "b", "Rows_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "doesnt", " ", "exist", ",", " ", "so", " ", "add", " ", "the", " ", "spell_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sp", "b", "Query_", "=_", "database_", "._", "send", "Query_", "(_", "'", "INSERT", " ", "INT", "O", " ", "spell", "book", " ", "(", "character", "\\u", "id", ",", " ", "spell", "num", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?)", ";'_", ",_", "(_", "char", "Id_", ",_", "spell", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "sp", "b", "Rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "is", " ", "alr", "ead", "y", " ", "there", ",", " ", "so", " ", "do", " ", "nothing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "Changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Item_", "(_", "item", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "item", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "items", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "items", " ", "(", "id", ",", " ", "name", ",", " ", "pic", ",", " ", "type", ",", " ", "data", "1", ",", " ", "data", "2", ",", " ", "data", "3", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(%", "i", ",", " ", "'%", "s", "',", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ",", " ", "%", "i", ");\"_", "%_", "(_", "int_", "(_", "item", "Num_", "+_", "1_", ")_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "name_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "pic_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "type_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data1_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data2_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "item", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "item_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "items", " ", "SET", " ", "name", "='", "%", "s", "',", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "pic", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "type", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "1", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "2", "=", "%", "i", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "3", "=", "%", "i", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "Item_", "[_", "item", "Num_", "]_", "._", "name_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "pic_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "type_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data1_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data2_", ",_", "Item_", "[_", "item", "Num_", "]_", "._", "data", "3_", ",_", "int_", "(_", "item", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "Changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Spell", "_", "(_", "spell", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "spell", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "spell", "s", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "spell", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "spell", "s", " ", "(", "id", ",", " ", "name", ",", " ", "pic", ",", " ", "type", ",", " ", "req", "mp", ",", " ", "req", "class", ",", " ", "req", "level", ",", " ", "data", "1", ",", " ", "data", "2", ",", " ", "data", "3", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "int_", "(_", "spell", "Num_", "+_", "1_", ")_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "name_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "pic_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "type_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Mp", "_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Class_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Level_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data1_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data2_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "spell", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "spell_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "spell", "s", " ", "SET", " ", "name", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "pic", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "type", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "mp", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "class", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "req", "level", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "1", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "2", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "data", "3", "=?", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=?", ";\"_", ",_", "(_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "name_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "pic_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "type_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Mp", "_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Class_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "req", "Level_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data1_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data2_", ",_", "Spell", "_", "[_", "spell", "Num_", "]_", "._", "data", "3_", ",_", "int_", "(_", "spell", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "database_", "._", "save", "Changes_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save", "Np", "c_", "(_", "npc", "Num_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", ":", " ", "rew", "ork", " ", "the", " ", "id", " ", "part_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "npc", " ", "alr", "ead", "y", " ", "exists_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "SELECT", " ", "*", " ", "FROM", " ", "npc", "s", " ", "WHE", "RE", " ", "id", "=", "%", "i", ";\"_", "%_", "(_", "npc", "Num_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "query_", "._", "fetchone_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rows_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "npc", " ", "doesnt", " ", "exist", ",", " ", "create", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "INSERT", " ", "INT", "O", " ", "npc", "s", " ", "(", "id", ",", " ", "name", ",", " ", "spri", "te", ",", " ", "attac", "k", "\\u", "say", ",", " ", "spawn", "\\u", "secs", ",", " ", "behavior", ",", " ", "range", ",", " ", "drop", "\\u", "chan", "ce", ",", " ", "drop", "\\u", "item", ",", " ", "drop", "\\u", "item", "\\u", "value", ",", " ", "stat", "\\u", "streng", "th", ",", " ", "stat", "\\u", "defense", ",", " ", "stat", "\\u", "magic", ",", " ", "stat", "\\u", "speed", ")", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", " ", "VALU", "ES", " ", "(?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?", ",", " ", "?)", ";\"_", ",_", "(_", "int_", "(_", "npc", "Num_", "+_", "1_", ")_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "name_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "sprite_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "attac", "k", "Say", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "spawn", "Secs_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "behaviour", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "range_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Chan", "ce_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item", "Value_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "strength_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "defense", "_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "magic_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "speed_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "rows_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "npc", " ", "alr", "ead", "y", " ", "exist", "s", ",", " ", "so", " ", "update", " ", "the", " ", "npc_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "database_", "._", "send", "Query_", "(_", "\"", "UPDATE", " ", "npc", "s", " ", "SET", " ", "name", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "spri", "te", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "attac", "k", "\\u", "say", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "spawn", "\\u", "secs", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "behavior", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "range", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "chan", "ce", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "item", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "drop", "\\u", "item", "\\u", "value", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "streng", "th", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "defense", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "magic", "=?", ",", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "stat", "\\u", "speed", "=?", " ", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "WHE", "RE", " ", "id", "=?", ";\"_", ",_", "(_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "name_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "sprite_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "attac", "k", "Say", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "spawn", "Secs_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "behaviour", "_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "range_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Chan", "ce_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "drop", "Item", "Value_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "strength_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "defense", "_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "magic_", "]_", ",_", "NPC", "_", "[_", "npc", "Num_", "]_", "._", "stat_", "[_", "Stats_", "._", "speed_", "]_", ",_", "int_", "(_", "npc", "Num_", "+_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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 ]
Testing equality to None
neuropoly/spinalcordtoolbox/dev/denoise/aonlm/wavelet/afb3D.py
[ { "content": "def afb3D(x, af1, af2=None, af3=None):\n if af2==None:\n af2=af1\n if af3==None:\n af3=af1\n # filter along dimension 0\n L,H=afb3D_A(x, af1, 0);\n # filter along dimension 1\n LL,LH=afb3D_A(L, af2, 1);\n HL,HH=afb3D_A(H, af2, 1);\n # filter along dimension 3\n LLL,LLH=afb3D_A(LL, af3, 2);\n LHL,LHH=afb3D_A(LH, af3, 2);\n HLL,HLH=afb3D_A(HL, af3, 2);\n HHL,HHH=afb3D_A(HH, af3, 2);\n return LLL, [LLH, LHL, LHH, HLL, HLH, HHL, HHH]", "metadata": "root.afb3D", "header": "['module', '___EOS___']", "index": 39 } ]
[ { "span": "af2==None:", "start_line": 40, "start_column": 7, "end_line": 40, "end_column": 16 }, { "span": "af3==None:", "start_line": 42, "start_column": 7, "end_line": 42, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "af", "b3", "D_", "(_", "x_", ",_", "af", "1_", ",_", "af", "2_", "=_", "None_", ",_", "af", "3_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "af", "2_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "af", "2_", "=_", "af", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "af", "3_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "af", "3_", "=_", "af", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "filter", " ", "along", " ", "dimension", " ", "0_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "L_", ",_", "H_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "x_", ",_", "af", "1_", ",_", "0_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "filter", " ", "along", " ", "dimension", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "LL_", ",_", "LH", "_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "L_", ",_", "af", "2_", ",_", "1_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HL", "_", ",_", "HH", "_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "H_", ",_", "af", "2_", ",_", "1_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "filter", " ", "along", " ", "dimension", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "LL", "L_", ",_", "LL", "H_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "LL_", ",_", "af", "3_", ",_", "2_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LH", "L_", ",_", "LH", "H_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "LH", "_", ",_", "af", "3_", ",_", "2_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HL", "L_", ",_", "HL", "H_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "HL", "_", ",_", "af", "3_", ",_", "2_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "HH", "L_", ",_", "HHH", "_", "=_", "af", "b3", "D", "\\u", "A_", "(_", "HH", "_", ",_", "af", "3_", ",_", "2_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "LL", "L_", ",_", "[_", "LL", "H_", ",_", "LH", "L_", ",_", "LH", "H_", ",_", "HL", "L_", ",_", "HL", "H_", ",_", "HH", "L_", ",_", "HHH", "_", "]_" ]
[ 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, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
CenterForOpenScience/waterbutler/tests/providers/googledrive/test_metadata.py
[ { "content": "import pytest\n\nimport os\nfrom urllib.parse import quote\n\nfrom waterbutler.providers.googledrive.provider import GoogleDrivePath\nfrom waterbutler.providers.googledrive.provider import GoogleDrivePathPart\nfrom waterbutler.providers.googledrive.metadata import GoogleDriveRevision\nfrom waterbutler.providers.googledrive.metadata import GoogleDriveFileMetadata\nfrom waterbutler.providers.googledrive.metadata import GoogleDriveFolderMetadata\n\nfrom tests.providers.googledrive import fixtures\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@pytest.fixture\ndef basepath():\n return GoogleDrivePath('/conrad')", "metadata": "root.basepath", "header": "['module', '___EOS___']", "index": 14 }, { "content": "def test_file_metadata_drive(basepath):\n item = fixtures.list_file['items'][0]\n path = basepath.child(item['title'])\n parsed = GoogleDriveFileMetadata(item, path)\n\n assert parsed.provider == 'googledrive'\n assert parsed.id == item['id']\n assert path.name == item['title']\n assert parsed.name == item['title']\n assert parsed.size == item['fileSize']\n assert parsed.modified == item['modifiedDate']\n assert parsed.content_type == item['mimeType']\n assert parsed.extra == {'revisionId': item['version'], 'webView': item['alternateLink']}\n assert parsed.path == '/' + os.path.join(*[x.raw for x in path.parts])\n assert parsed.materialized_path == str(path)\n assert parsed.is_google_doc == False\n assert parsed.export_name == item['title']", "metadata": "root.test_file_metadata_drive", "header": "['module', '___EOS___']", "index": 19 }, { "content": "def test_file_metadata_drive_slashes(basepath):\n item = fixtures.file_forward_slash\n path = basepath.child(item['title'])\n parsed = GoogleDriveFileMetadata(item, path)\n\n assert parsed.provider == 'googledrive'\n assert parsed.id == item['id']\n assert parsed.name == item['title']\n assert parsed.name == path.name\n assert parsed.size == item['fileSize']\n assert parsed.modified == item['modifiedDate']\n assert parsed.content_type == item['mimeType']\n assert parsed.extra == {'revisionId': item['version'], 'webView': item['alternateLink']}\n assert parsed.path == '/' + os.path.join(*[x.raw for x in path.parts])\n assert parsed.materialized_path == str(path)\n assert parsed.is_google_doc == False\n assert parsed.export_name == item['title']", "metadata": "root.test_file_metadata_drive_slashes", "header": "['module', '___EOS___']", "index": 38 }, { "content": "def test_file_metadata_docs(basepath):\n item = fixtures.docs_file_metadata\n path = basepath.child(item['title'])\n parsed = GoogleDriveFileMetadata(item, path)\n\n assert parsed.name == item['title'] + '.gdoc'\n assert parsed.extra == {'revisionId': item['version'], 'downloadExt': '.docx', 'webView': item['alternateLink']}\n assert parsed.is_google_doc == True\n assert parsed.export_name == item['title'] + '.docx'", "metadata": "root.test_file_metadata_docs", "header": "['module', '___EOS___']", "index": 57 }, { "content": "def test_folder_metadata():\n item = fixtures.folder_metadata\n path = GoogleDrivePath('/we/love/you/conrad').child(item['title'], folder=True)\n parsed = GoogleDriveFolderMetadata(item, path)\n\n assert parsed.provider == 'googledrive'\n assert parsed.id == item['id']\n assert parsed.name == item['title']\n assert parsed.extra == {'revisionId': item['version']}\n assert parsed.path == '/' + os.path.join(*[x.raw for x in path.parts]) + '/'\n assert parsed.materialized_path == str(path)", "metadata": "root.test_folder_metadata", "header": "['module', '___EOS___']", "index": 68 }, { "content": "def test_folder_metadata_slash():\n item = fixtures.folder_metadata_forward_slash\n path = GoogleDrivePath('/we/love/you/conrad').child(item['title'], folder=True)\n parsed = GoogleDriveFolderMetadata(item, path)\n\n assert parsed.provider == 'googledrive'\n assert parsed.id == item['id']\n assert parsed.name == item['title']\n assert parsed.extra == {'revisionId': item['version']}\n assert parsed.path == '/' + os.path.join(*[x.raw for x in path.parts]) + '/'\n assert parsed.materialized_path == str(path)", "metadata": "root.test_folder_metadata_slash", "header": "['module', '___EOS___']", "index": 81 }, { "content": "def test_revision_metadata():\n item = fixtures.revision_metadata\n parsed = GoogleDriveRevision(item)\n assert parsed.version_identifier == 'revision'\n assert parsed.version == item['id']\n assert parsed.modified == item['modifiedDate']", "metadata": "root.test_revision_metadata", "header": "['module', '___EOS___']", "index": 94 } ]
[ { "span": "from urllib.parse import quote", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 30 }, { "span": "from waterbutler.providers.googledrive.provider import GoogleDrivePathPart", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 74 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "._", "parse_", "import_", "quote_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "water", "but", "ler_", "._", "providers_", "._", "google", "drive_", "._", "provider_", "import_", "Goo", "gle", "Drive", "Path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "water", "but", "ler_", "._", "providers_", "._", "google", "drive_", "._", "provider_", "import_", "Goo", "gle", "Drive", "Path", "Part_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "water", "but", "ler_", "._", "providers_", "._", "google", "drive_", "._", "metadata_", "import_", "Goo", "gle", "Drive", "Revision_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "water", "but", "ler_", "._", "providers_", "._", "google", "drive_", "._", "metadata_", "import_", "Goo", "gle", "Drive", "File", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "water", "but", "ler_", "._", "providers_", "._", "google", "drive_", "._", "metadata_", "import_", "Goo", "gle", "Drive", "Fold", "er", "Metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tests_", "._", "providers_", "._", "google", "drive_", "import_", "fixtures_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "@_", "pytest_", "._", "fixture_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "basepath_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Goo", "gle", "Drive", "Path_", "(_", "'/", "con", "rad", "'_", ")_", "\\u\\u\\uNEWLINE\\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", "file", "\\u", "metadata", "\\u", "drive_", "(_", "basepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "list", "\\u", "file_", "[_", "'", "items", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "basepath_", "._", "child_", "(_", "item_", "[_", "'", "title", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "File", "Metadata_", "(_", "item_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "parsed_", "._", "provider_", "==_", "'", "google", "drive", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "id_", "==_", "item_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "path_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "size_", "==_", "item_", "[_", "'", "file", "Size", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "modified_", "==_", "item_", "[_", "'", "modifi", "ed", "Date", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "content", "\\u", "type_", "==_", "item_", "[_", "'", "mime", "Type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "extra_", "==_", "{_", "'", "revis", "ion", "Id", "'_", ":_", "item_", "[_", "'", "version", "'_", "]_", ",_", "'", "web", "View", "'_", ":_", "item_", "[_", "'", "alternat", "e", "Link", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "path_", "==_", "'/'_", "+_", "os_", "._", "path_", "._", "join_", "(_", "*_", "[_", "x_", "._", "raw_", "for_", "x_", "in_", "path_", "._", "parts_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "material", "ize", "d\\u", "path_", "==_", "str_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "is", "\\u", "google", "\\u", "doc_", "==_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "export", "\\u", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "file", "\\u", "metadata", "\\u", "drive", "\\u", "slash", "es_", "(_", "basepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "file", "\\u", "forward", "\\u", "slash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "basepath_", "._", "child_", "(_", "item_", "[_", "'", "title", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "File", "Metadata_", "(_", "item_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "parsed_", "._", "provider_", "==_", "'", "google", "drive", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "id_", "==_", "item_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "path_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "size_", "==_", "item_", "[_", "'", "file", "Size", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "modified_", "==_", "item_", "[_", "'", "modifi", "ed", "Date", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "content", "\\u", "type_", "==_", "item_", "[_", "'", "mime", "Type", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "extra_", "==_", "{_", "'", "revis", "ion", "Id", "'_", ":_", "item_", "[_", "'", "version", "'_", "]_", ",_", "'", "web", "View", "'_", ":_", "item_", "[_", "'", "alternat", "e", "Link", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "path_", "==_", "'/'_", "+_", "os_", "._", "path_", "._", "join_", "(_", "*_", "[_", "x_", "._", "raw_", "for_", "x_", "in_", "path_", "._", "parts_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "material", "ize", "d\\u", "path_", "==_", "str_", "(_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "is", "\\u", "google", "\\u", "doc_", "==_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "export", "\\u", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "file", "\\u", "metadata", "\\u", "docs_", "(_", "basepath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "docs", "\\u", "file", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "basepath_", "._", "child_", "(_", "item_", "[_", "'", "title", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "File", "Metadata_", "(_", "item_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "+_", "'.", "gd", "oc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "extra_", "==_", "{_", "'", "revis", "ion", "Id", "'_", ":_", "item_", "[_", "'", "version", "'_", "]_", ",_", "'", "download", "Ext", "'_", ":_", "'.", "docx", "'_", ",_", "'", "web", "View", "'_", ":_", "item_", "[_", "'", "alternat", "e", "Link", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "is", "\\u", "google", "\\u", "doc_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "export", "\\u", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "+_", "'.", "docx", "'_", "\\u\\u\\uNEWLINE\\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", "folder", "\\u", "metadata_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "folder", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "Goo", "gle", "Drive", "Path_", "(_", "'/", "we", "/", "love", "/", "you", "/", "con", "rad", "'_", ")_", "._", "child_", "(_", "item_", "[_", "'", "title", "'_", "]_", ",_", "folder_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "Fold", "er", "Metadata_", "(_", "item_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "parsed_", "._", "provider_", "==_", "'", "google", "drive", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "id_", "==_", "item_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "extra_", "==_", "{_", "'", "revis", "ion", "Id", "'_", ":_", "item_", "[_", "'", "version", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "path_", "==_", "'/'_", "+_", "os_", "._", "path_", "._", "join_", "(_", "*_", "[_", "x_", "._", "raw_", "for_", "x_", "in_", "path_", "._", "parts_", "]_", ")_", "+_", "'/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "material", "ize", "d\\u", "path_", "==_", "str_", "(_", "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_", "test\\u", "folder", "\\u", "metadata", "\\u", "slash_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "folder", "\\u", "metadata", "\\u", "forward", "\\u", "slash_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "Goo", "gle", "Drive", "Path_", "(_", "'/", "we", "/", "love", "/", "you", "/", "con", "rad", "'_", ")_", "._", "child_", "(_", "item_", "[_", "'", "title", "'_", "]_", ",_", "folder_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "Fold", "er", "Metadata_", "(_", "item_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "parsed_", "._", "provider_", "==_", "'", "google", "drive", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "id_", "==_", "item_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "name_", "==_", "item_", "[_", "'", "title", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "extra_", "==_", "{_", "'", "revis", "ion", "Id", "'_", ":_", "item_", "[_", "'", "version", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "path_", "==_", "'/'_", "+_", "os_", "._", "path_", "._", "join_", "(_", "*_", "[_", "x_", "._", "raw_", "for_", "x_", "in_", "path_", "._", "parts_", "]_", ")_", "+_", "'/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "material", "ize", "d\\u", "path_", "==_", "str_", "(_", "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_", "test\\u", "revis", "ion", "\\u", "metadata_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "item_", "=_", "fixtures_", "._", "revis", "ion", "\\u", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "Goo", "gle", "Drive", "Revision_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "version", "\\u", "identifier_", "==_", "'", "revis", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "version_", "==_", "item_", "[_", "'", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "parsed_", "._", "modified_", "==_", "item_", "[_", "'", "modifi", "ed", "Date", "'_", "]_" ]
[ 4, 4, 4, 4, 4, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 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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object.py
[ { "content": " def exportChildren(self, lwrite, level, namespace_='NetworkRouteEntryObj:', name_='NetworkRouteEntryObjectType', fromsubclass_=False, pretty_print=True):\n super(NetworkRouteEntryObjectType, self).exportChildren(lwrite, level, 'NetworkRouteEntryObj:', name_, True, pretty_print=pretty_print)\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.Destination_Address is not None:\n self.Destination_Address.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Destination_Address', pretty_print=pretty_print)\n if self.Origin is not None:\n self.Origin.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Origin', pretty_print=pretty_print)\n if self.Netmask is not None:\n self.Netmask.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Netmask', pretty_print=pretty_print)\n if self.Gateway_Address is not None:\n self.Gateway_Address.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Gateway_Address', pretty_print=pretty_print)\n if self.Metric is not None:\n self.Metric.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Metric', pretty_print=pretty_print)\n if self.Type is not None:\n self.Type.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Type', pretty_print=pretty_print)\n if self.Protocol is not None:\n self.Protocol.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Protocol', pretty_print=pretty_print)\n if self.Interface is not None:\n self.Interface.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Interface', pretty_print=pretty_print)\n if self.Preferred_Lifetime is not None:\n self.Preferred_Lifetime.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Preferred_Lifetime', pretty_print=pretty_print)\n if self.Valid_Lifetime is not None:\n self.Valid_Lifetime.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Valid_Lifetime', pretty_print=pretty_print)\n if self.Route_Age is not None:\n self.Route_Age.export(lwrite, level, 'NetworkRouteEntryObj:', name_='Route_Age', pretty_print=pretty_print)", "metadata": "root.NetworkRouteEntryObjectType.exportChildren", "header": "['class', 'NetworkRouteEntryObjectType', '(', 'cybox_common', '.', 'ObjectPropertiesType', ')', ':', '___EOS___']", "index": 216 }, { "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 = 'Network_Route_Entry'\n rootClass = NetworkRouteEntryObjectType\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": 466 }, { "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 = 'Network_Route_Entry'\n rootClass = NetworkRouteEntryObjectType\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": 483 }, { "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 = 'Network_Route_Entry'\n rootClass = NetworkRouteEntryObjectType\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_=\"Network_Route_Entry\",\n# namespacedef_='')\n return rootObj", "metadata": "root.parseString", "header": "['module', '___EOS___']", "index": 501 } ]
[ { "span": "eol_ ", "start_line": 219, "start_column": 12, "end_line": 219, "end_column": 16 }, { "span": "eol_ ", "start_line": 221, "start_column": 12, "end_line": 221, "end_column": 16 }, { "span": "rootTag ", "start_line": 471, "start_column": 8, "end_line": 471, "end_column": 15 }, { "span": "doc ", "start_line": 476, "start_column": 4, "end_line": 476, "end_column": 7 }, { "span": "doc ", "start_line": 493, "start_column": 4, "end_line": 493, "end_column": 7 }, { "span": "rootTag ", "start_line": 507, "start_column": 8, "end_line": 507, "end_column": 15 }, { "span": "doc ", "start_line": 512, "start_column": 4, "end_line": 512, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Network", "Route", "Entr", "y", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Network", "Route", "Entr", "y", "Object", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Network", "Route", "Entr", "y", "Object", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "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_", "if_", "self_", "._", "Dest", "ination", "\\u", "Address_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Dest", "ination", "\\u", "Address_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Dest", "ination", "\\u", "Address", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Origin_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Origin_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Orig", "in", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Net", "mask_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Net", "mask_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Net", "mask", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Gat", "ewa", "y", "\\u", "Address_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Gat", "ewa", "y", "\\u", "Address_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Gat", "ewa", "y", "\\u", "Address", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Metric_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Metric_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Met", "ric", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Type_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Type_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Type", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Protocol_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Protocol_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Proto", "col", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Interface_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Interface_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Interface", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Prefe", "rre", "d\\u", "Life", "time_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Prefe", "rre", "d\\u", "Life", "time_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Prefe", "rre", "d\\u", "Life", "time", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Valid", "\\u", "Life", "time_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Valid", "\\u", "Life", "time_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Valid", "\\u", "Life", "time", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Route", "\\u", "Age", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Route", "\\u", "Age", "_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Network", "Route", "Entr", "y", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Route", "\\u", "Age", "'_", ",_", "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_", "=_", "'", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Network", "Route", "Entr", "y", "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_", "=_", "'", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Network", "Route", "Entr", "y", "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_", "=_", "'", "Network", "\\u", "Route", "\\u", "Entr", "y", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Network", "Route", "Entr", "y", "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", "=\"", "Network", "\\u", "Route", "\\u", "Entr", "y", "\",", "_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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, 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 ]
Unused import
akamai-open/api-kickstart/examples/python/script_template.py
[ { "content": "#! /usr/bin/env python\n# Very basic script template. Use this to build new\n# examples for use in the api-kickstart repository\n#\n\"\"\" Copyright 2015 Akamai Technologies, Inc. All Rights Reserved.\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n\n You may obtain a copy of the License at \n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\"\"\"\n\nimport requests, logging, json\nfrom http_calls import EdgeGridHttpCaller\nfrom random import randint\nfrom akamai.edgegrid import EdgeGridAuth\nfrom config import EdgeGridConfig\nfrom urlparse import urljoin\nimport urllib\nsession = requests.Session()\ndebug = False\nverbose = False\nsection_name = \"default\"\n\nconfig = EdgeGridConfig({\"verbose\":debug},section_name)\n\nif hasattr(config, \"debug\") and config.debug:\n debug = True\n\nif hasattr(config, \"verbose\") and config.verbose:\n verbose = True\n\n# Set the config options\nsession.auth = EdgeGridAuth(\n client_token=config.client_token,\n client_secret=config.client_secret,\n access_token=config.access_token\n)\n\n# Set the baseurl based on config.host\nbaseurl = '%s://%s/' % ('https', config.host)\nhttpCaller = EdgeGridHttpCaller(session, debug, verbose, baseurl)\n\nif __name__ == \"__main__\":\n\t# If you're just doing a simple GET the call is very simple\n\t# endpoint_result = httpCaller.getResult(\"ENDPOINT\")\n\t# result_value = endpoint_result[\"VARIABLE\")\n\n\t# Add parameters\n\trequest_parameters = { \"value1\":\"foo\",\"value2\":\"bar\" }\n\tendpoint_result = httpCaller.getResult(\"ENDPOINT\",request_parameters)\n\t# result_value = endpoint_result[\"VARIABLE\")\n\n\t# POST example\n\t# \tsample_obj = { \"roleAssignments\": [ { \"roleId\": 14, \"groupId\": 41241 } ], \n \t#\t\t\"firstName\": \"Kirsten\", \n \t#\t\t\"phone\": \"8315887563\", \n \t#\t\t\"lastName\": \"Hunter\", \n \t#\t\t\"email\": \"[email protected]\"\n \t#\t}\n\t# sample_post_result = httpCaller.postResult('/user-admin/v1/users', json.dumps(user_obj))\n\n\tprint \"Waiting for some fabulous code here!\"\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import requests, logging, json", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 30 }, { "span": "from random import randint", "start_line": 22, "start_column": 0, "end_line": 22, "end_column": 26 }, { "span": "from urlparse import urljoin", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 28 }, { "span": "import urllib", "start_line": 26, "start_column": 0, "end_line": 26, "end_column": 13 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", " ", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ver", "y", " ", "basic", " ", "script", " ", "template", ".", " ", " ", "Us", "e", " ", "this", " ", "to", " ", "build", " ", "new_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "example", "s", " ", "for", " ", "use", " ", "in", " ", "the", " ", "api", "-", "kickstart", " ", "repository_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", " ", "Copy", "right", " ", "201", "5", " ", "Ak", "ama", "i", " ", "Techno", "logi", "es", ",", " ", "Inc", ".", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", ".", "\\", "10", ";", " ", "\\", "10", ";", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "\\", "10", ";", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", "\\", "10", ";", "\\", "10", ";", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at", " ", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "\\", "10", ";", "\\", "10", ";", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "\\", "10", ";", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", "\\", "10", ";", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", "\\", "10", ";", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "requests_", ",_", "logging_", ",_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "http", "\\u", "calls_", "import_", "Ed", "ge", "Grid", "Http", "Caller", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "random_", "import_", "randint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aka", "mai", "_", "._", "edge", "grid_", "import_", "Ed", "ge", "Grid", "Auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "config_", "import_", "Ed", "ge", "Grid", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "urljoin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "session_", "=_", "requests_", "._", "Session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "verbose_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "section", "\\u", "name_", "=_", "\"", "default", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "config_", "=_", "Ed", "ge", "Grid", "Config_", "(_", "{_", "\"", "verbo", "se", "\"_", ":_", "debug_", "}_", ",_", "section", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "config_", ",_", "\"", "debug", "\"_", ")_", "and_", "config_", "._", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "config_", ",_", "\"", "verbo", "se", "\"_", ")_", "and_", "config_", "._", "verbose_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "verbose_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "config", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "session_", "._", "auth_", "=_", "Ed", "ge", "Grid", "Auth_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "token_", "=_", "config_", "._", "client", "\\u", "token_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "client", "\\u", "secret_", "=_", "config_", "._", "client", "\\u", "secret_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "access", "\\u", "token_", "=_", "config_", "._", "access", "\\u", "token_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "baseu", "rl", " ", "based", " ", "on", " ", "config", ".", "host_", "\\u\\u\\uNL\\u\\u\\u_", "baseurl_", "=_", "'%", "s", "://", "%", "s", "/'_", "%_", "(_", "'", "https", "'_", ",_", "config_", "._", "host_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "Caller", "_", "=_", "Ed", "ge", "Grid", "Http", "Caller", "_", "(_", "session_", ",_", "debug_", ",_", "verbose_", ",_", "baseurl_", ")_", "\\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_", "#", " ", "If", " ", "you", "'", "re", " ", "just", " ", "doi", "ng", " ", "a", " ", "simple", " ", "GET", " ", "the", " ", "call", " ", "is", " ", "very", " ", "simple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "endpoint", "\\u", "result", " ", "=", " ", "http", "Caller", ".", "get", "Result", "(\"", "ENDPOINT", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", "\\u", "value", " ", "=", " ", "endpoint", "\\u", "result", "[\"", "VARIABLE", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "request", "\\u", "parameters_", "=_", "{_", "\"", "value", "1", "\"_", ":_", "\"", "foo", "\"_", ",_", "\"", "value", "2", "\"_", ":_", "\"", "bar", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "endpoint", "\\u", "result_", "=_", "http", "Caller", "_", "._", "get", "Result_", "(_", "\"", "ENDPOINT", "\"_", ",_", "request", "\\u", "parameters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", "\\u", "value", " ", "=", " ", "endpoint", "\\u", "result", "[\"", "VARIABLE", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POST", " ", "example_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\t", "sample", "\\u", "obj", " ", "=", " ", "{", " ", "\"", "role", "Assign", "ment", "s", "\":", " ", "[", " ", "{", " ", "\"", "role", "Id", "\":", " ", "14", ",", " ", "\"", "group", "Id", "\":", " ", "412", "4", "1", " ", "}", " ", "],", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "\"", "first", "Name", "\":", " ", "\"", "Ki", "rst", "en", "\",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "\"", "phone", "\":", " ", "\"", "831", "588", "756", "3", "\",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "\"", "last", "Name", "\":", " ", "\"", "Hunt", "er", "\",", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "\t", "\"", "email", "\":", " ", "\"", "kir", "sten", ".", "hunt", "er", "@", "aka", "mai", ".", "com", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", "\t", "}_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sample", "\\u", "post", "\\u", "result", " ", "=", " ", "http", "Caller", ".", "post", "Result", "('", "/", "user", "-", "admin", "/", "v1", "/", "users", "',", " ", "json", ".", "dump", "s", "(", "user", "\\u", "obj", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"", "Wait", "ing", " ", "for", " ", "some", " ", "fab", "ulo", "us", " ", "code", " ", "here", "!\"_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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)\nis_py3 = (_ver[0] == 3)\n\n\nif is_py2: # pragma: no cover\n from urllib import (quote, unquote, quote_plus, unquote_plus, urlencode,\n getproxies, proxy_bypass)\n from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag\n from urllib2 import parse_http_list\n import cookielib\n from Cookie import Morsel\n from StringIO import StringIO\n from httplib import IncompleteRead\n\n builtin_str = str\n bytes = str\n str = unicode\n basestring = basestring\n numeric_types = (int, long, float)\n\n\nelif is_py3: # pragma: no cover\n from urllib.parse import (urlparse, urlunparse, urljoin, urlsplit,\n urlencode, quote, unquote, quote_plus,\n unquote_plus, urldefrag)\n from urllib.request import parse_http_list, getproxies, proxy_bypass\n from http import cookiejar as cookielib\n from http.cookies import Morsel\n from io import StringIO\n from http.client import IncompleteRead\n\n builtin_str = str\n str = str\n bytes = bytes\n basestring = (str, bytes)\n numeric_types = (int, float)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def python_2_unicode_compatible(cls):\n \"\"\"\n A decorator that defines __unicode__ and __str__ methods under Python\n 2. Under Python 3 it does nothing.\n\n To support Python 2 and 3 with a single code base, define a __str__\n method returning unicode text and apply this decorator to the class.\n\n The implementation comes from django.utils.encoding.\n \"\"\"\n if not is_py3: # pragma: no cover\n cls.__unicode__ = cls.__str__\n cls.__str__ = lambda self: self.__unicode__().encode('utf-8')\n return cls", "metadata": "root.python_2_unicode_compatible", "header": "['module', '___EOS___']", "index": 41 } ]
[ { "span": "from urllib.parse import (urlparse, urlunparse, urljoin, urlsplit,\n urlencode, quote, unquote, quote_plus,\n unquote_plus, urldefrag)", "start_line": 25, "start_column": 4, "end_line": 27, "end_column": 54 }, { "span": "from urllib.request import parse_http_list, getproxies, proxy_bypass", "start_line": 28, "start_column": 4, "end_line": 28, "end_column": 72 }, { "span": "from http import cookiejar as cookielib", "start_line": 29, "start_column": 4, "end_line": 29, "end_column": 43 }, { "span": "from http.cookies import Morsel", "start_line": 30, "start_column": 4, "end_line": 30, "end_column": 35 }, { "span": "from io import StringIO", "start_line": 31, "start_column": 4, "end_line": 31, "end_column": 27 }, { "span": "from http.client import IncompleteRead", "start_line": 32, "start_column": 4, "end_line": 32, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "ver_", "=_", "sys_", "._", "version", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "py2", "_", "=_", "(_", "\\u", "ver_", "[_", "0_", "]_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "py3", "_", "=_", "(_", "\\u", "ver_", "[_", "0_", "]_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "\\u", "py2", "_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "import_", "(_", "quote_", ",_", "unquote_", ",_", "quote", "\\u", "plus_", ",_", "unqu", "ote", "\\u", "plus_", ",_", "urlencode_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "getpr", "oxi", "es_", ",_", "proxy", "\\u", "bypass", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urlparse_", "import_", "urlparse_", ",_", "urlu", "npar", "se_", ",_", "urljoin_", ",_", "urlsplit_", ",_", "url", "def", "rag", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib2_", "import_", "parse", "\\u", "http", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "cookie", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Cookie_", "import_", "Mor", "sel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "httplib_", "import_", "Incomp", "lete", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bui", "lti", "n", "\\u", "str_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "basestring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numeri", "c\\u", "types_", "=_", "(_", "int_", ",_", "long_", ",_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "is", "\\u", "py3", "_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "(_", "urlparse_", ",_", "urlu", "npar", "se_", ",_", "urljoin_", ",_", "urlsplit_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "urlencode_", ",_", "quote_", ",_", "unquote_", ",_", "quote", "\\u", "plus_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "unqu", "ote", "\\u", "plus_", ",_", "url", "def", "rag", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "urllib_", "._", "request_", "import_", "parse", "\\u", "http", "\\u", "list_", ",_", "getpr", "oxi", "es_", ",_", "proxy", "\\u", "bypass", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "http_", "import_", "cookie", "jar_", "as_", "cookie", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "http_", "._", "cookies_", "import_", "Mor", "sel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "io_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "http_", "._", "client_", "import_", "Incomp", "lete", "Read_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bui", "lti", "n", "\\u", "str_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bytes_", "=_", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basestring_", "=_", "(_", "str_", ",_", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "numeri", "c\\u", "types_", "=_", "(_", "int_", ",_", "float_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "python", "\\u", "2", "\\u", "unicode", "\\u", "compatible_", "(_", "cls_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "decorat", "or", " ", "tha", "t", " ", "defin", "es", " ", "\\u\\u", "unicode", "\\u\\u", " ", "and", " ", "\\u\\u", "str", "\\u\\u", " ", "method", "s", " ", "under", " ", "Pyth", "on", "\\", "10", ";", " ", " ", " ", " ", "2", ".", " ", "Under", " ", "Pyth", "on", " ", "3", " ", "it", " ", "doe", "s", " ", "not", "hing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "To", " ", "support", " ", "Pyth", "on", " ", "2", " ", "and", " ", "3", " ", "with", " ", "a", " ", "single", " ", "code", " ", "base", ",", " ", "defin", "e", " ", "a", " ", "\\u\\u", "str", "\\u\\u", "\\", "10", ";", " ", " ", " ", " ", "method", " ", "return", "ing", " ", "unicode", " ", "text", " ", "and", " ", "appl", "y", " ", "this", " ", "decorat", "or", " ", "to", " ", "the", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "implementation", " ", "come", "s", " ", "from", " ", "django", ".", "util", "s", ".", "encoding", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "is", "\\u", "py3", "_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "\\u\\u", "unicode\\u\\u_", "=_", "cls_", "._", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "._", "\\u\\u", "str\\u\\u_", "=_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "unicode\\u\\u_", "(_", ")_", "._", "encode_", "(_", "'", "utf", "-", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cls_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
aerospike/aerospike-client-python/test/old_tests/test_admin_set_password.py
[ { "content": "# -*- coding: utf-8 -*-\n\nimport pytest\nimport sys\nfrom .test_base_class import TestBaseClass\nfrom aerospike import exception as e\n\naerospike = pytest.importorskip(\"aerospike\")\ntry:\n import aerospike\nexcept:\n print(\"Please install aerospike python client.\")\n sys.exit(1)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def setup_method(self, method):\n \"\"\"\n Setup method\n \"\"\"\n hostlist, user, password = TestBaseClass().get_hosts()\n config = {\"hosts\": hostlist}\n TestSetPassword.Me = self\n self.client = aerospike.client(config).connect(user, password)\n try:\n self.client.admin_drop_user(\"testsetpassworduser\")\n except:\n pass\n self.client.admin_create_user(\n \"testsetpassworduser\", \"aerospike\", [\"read\"], {})\n\n self.delete_users = []", "metadata": "root.TestSetPassword.setup_method", "header": "['class', 'TestSetPassword', '(', 'TestBaseClass', ')', ':', '___EOS___']", "index": 21 } ]
[ { "span": "except:", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 7 }, { "span": "except:", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "test\\u", "base", "\\u", "class_", "import_", "Test", "Base", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "aeros", "pike", "_", "import_", "exception_", "as_", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "aeros", "pike", "_", "=_", "pytest_", "._", "import", "ors", "kip", "_", "(_", "\"", "aeros", "pike", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "aeros", "pike", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Ple", "ase", " ", "install", " ", "aeros", "pike", " ", "python", " ", "client", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "class_", "Test", "Set", "Password_", "(_", "Test", "Base", "Class_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "up", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "host", "list_", ",_", "user_", ",_", "password_", "=_", "Test", "Base", "Class_", "(_", ")_", "._", "get", "\\u", "hosts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "{_", "\"", "host", "s", "\"_", ":_", "host", "list_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Test", "Set", "Password_", "._", "Me_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "client_", "=_", "aeros", "pike", "_", "._", "client_", "(_", "config_", ")_", "._", "connect_", "(_", "user_", ",_", "password_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "client_", "._", "admin", "\\u", "drop", "\\u", "user_", "(_", "\"", "testset", "password", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "client_", "._", "admin", "\\u", "create", "\\u", "user_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "testset", "password", "user", "\"_", ",_", "\"", "aeros", "pike", "\"_", ",_", "[_", "\"", "read", "\"_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "delete", "\\u", "users_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
missionpinball/mpf/tests/test_TutorialStep15.py
[ { "content": "\nfrom MpfTestCase import MpfTestCase\nfrom mock import MagicMock\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestTutorialStep15(MpfTestCase):\n\n\n\n", "metadata": "root.TestTutorialStep15", "header": "['module', '___EOS___']", "index": 5 }, { "content": " def getConfigFile(self):\n return 'config.yaml'", "metadata": "root.TestTutorialStep15.getConfigFile", "header": "['class', 'TestTutorialStep15', '(', 'MpfTestCase', ')', ':', '___EOS___']", "index": 7 }, { "content": " def getMachinePath(self):\n return '../machine_files/tutorial_step_15/'", "metadata": "root.TestTutorialStep15.getMachinePath", "header": "['class', 'TestTutorialStep15', '(', 'MpfTestCase', ')', ':', '___EOS___']", "index": 10 }, { "content": " def get_platform(self):\n return 'smart_virtual'", "metadata": "root.TestTutorialStep15.get_platform", "header": "['class', 'TestTutorialStep15', '(', 'MpfTestCase', ')', ':', '___EOS___']", "index": 13 }, { "content": " def test_game(self):\n # start active switches should start with 5 balls in the trough\n\n self.machine.ball_controller.num_balls_known = 5\n self.assertEqual(5, self.machine.ball_devices.bd_trough.balls)\n\n # player hits start\n self.machine.switch_controller.process_switch('s_start', 1)\n self.machine.switch_controller.process_switch('s_start', 0)\n self.advance_time_and_run(2)\n\n self.assertEqual(1, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(0, self.machine.ball_devices.playfield.balls)\n\n # make sure the base game mode is active\n self.assertTrue(self.machine.mode_controller.is_active('base'))\n\n # player hits the launch button\n self.machine.switch_controller.process_switch('s_launch', 1)\n self.machine.switch_controller.process_switch('s_launch', 0)\n self.advance_time_and_run(2)\n\n # ball is on the pf\n self.machine.switch_controller.process_switch('s_right_inlane', 1)\n self.machine.switch_controller.process_switch('s_right_inlane', 0)\n self.advance_time_and_run(2)\n\n self.assertEqual(1, self.machine.game.player.ball)\n self.assertEqual(0, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n # lets drop the ball in some devices and make sure it kicks it out\n self.machine.switch_controller.process_switch('s_eject', 1)\n # todo fix this call twice\n self.advance_time_and_run(2)\n self.advance_time_and_run(1)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n self.machine.switch_controller.process_switch('s_bottom_popper', 1)\n self.advance_time_and_run(3)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n self.machine.switch_controller.process_switch('s_top_popper', 1)\n self.advance_time_and_run(3)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n # ball drains, game goes to ball 2\n self.machine.default_platform.add_ball_to_device(\n self.machine.ball_devices.bd_trough)\n # todo bug here. Have to call advance_time_and_run twice for it to work\n self.advance_time_and_run(1)\n self.advance_time_and_run(1)\n\n self.assertEqual(2, self.machine.game.player.ball)\n self.assertEqual(1, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(0, self.machine.ball_devices.playfield.balls)\n\n # repeat above cycle for ball 2\n\n # player hits the launch button\n self.machine.switch_controller.process_switch('s_launch', 1)\n self.machine.switch_controller.process_switch('s_launch', 0)\n self.advance_time_and_run(2)\n\n # ball is on the pf\n self.machine.switch_controller.process_switch('s_right_inlane', 1)\n self.machine.switch_controller.process_switch('s_right_inlane', 0)\n self.advance_time_and_run(2)\n\n self.assertEqual(2, self.machine.game.player.ball)\n self.assertEqual(0, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n # ball drains, game goes to ball 3\n self.machine.default_platform.add_ball_to_device(\n self.machine.ball_devices.bd_trough)\n # todo bug here. Have to call advance_time_and_run twice for it to work\n self.advance_time_and_run(1)\n self.advance_time_and_run(1)\n\n self.assertEqual(3, self.machine.game.player.ball)\n self.assertEqual(1, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(0, self.machine.ball_devices.playfield.balls)\n\n # repeat above cycle for ball 3\n\n # player hits the launch button\n self.machine.switch_controller.process_switch('s_launch', 1)\n self.machine.switch_controller.process_switch('s_launch', 0)\n self.advance_time_and_run(2)\n\n # ball is on the pf\n\n # this time let's test the timeout with no pf switch hit\n # self.machine.switch_controller.process_switch('s_right_inlane', 1)\n # self.machine.switch_controller.process_switch('s_right_inlane', 0)\n self.advance_time_and_run(2)\n\n self.assertEqual(3, self.machine.game.player.ball)\n self.assertEqual(0, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(4, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(1, self.machine.ball_devices.playfield.balls)\n\n # ball drains, game ends\n self.machine.default_platform.add_ball_to_device(\n self.machine.ball_devices.bd_trough)\n # todo bug here. Have to call advance_time_and_run twice for it to work\n self.advance_time_and_run(1)\n self.advance_time_and_run(1)\n\n self.assertIsNone(self.machine.game)\n self.assertEqual(0, self.machine.ball_devices.bd_plunger.balls)\n self.assertEqual(5, self.machine.ball_devices.bd_trough.balls)\n self.assertEqual(0, self.machine.ball_devices.playfield.balls)\n\n # make sure the base game mode is not active\n self.assertFalse(self.machine.mode_controller.is_active('base'))", "metadata": "root.TestTutorialStep15.test_game", "header": "['class', 'TestTutorialStep15', '(', 'MpfTestCase', ')', ':', '___EOS___']", "index": 16 } ]
[ { "span": "from mock import MagicMock", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 26 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Mp", "f", "Test", "Case_", "import_", "Mp", "f", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "Mag", "ic", "Mock_", "\\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_", "Test", "Tu", "tori", "al", "Step", "15_", "(_", "Mp", "f", "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_", "[SEP]_", "class_", "Test", "Tu", "tori", "al", "Step", "15_", "(_", "Mp", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get", "Config", "File_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "config", ".", "yaml", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tu", "tori", "al", "Step", "15_", "(_", "Mp", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Machine", "Path_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'../", "machine", "\\u", "files", "/", "tutorial", "\\u", "step", "\\u", "15", "/'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tu", "tori", "al", "Step", "15_", "(_", "Mp", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "platform_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "smart", "\\u", "virtual", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Tu", "tori", "al", "Step", "15_", "(_", "Mp", "f", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "game_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "start", " ", "active", " ", "switche", "s", " ", "shou", "ld", " ", "start", " ", "with", " ", "5", " ", "balls", " ", "in", " ", "the", " ", "trou", "gh_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "machine_", "._", "bal", "l\\u", "controller_", "._", "num", "\\u", "balls", "\\u", "known_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "5_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "player", " ", "hits", " ", "start_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "start", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "start", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", " ", "base", " ", "game", " ", "mode", " ", "is", " ", "active_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "machine_", "._", "mode", "\\u", "controller_", "._", "is", "\\u", "active_", "(_", "'", "base", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "player", " ", "hits", " ", "the", " ", "launch", " ", "button_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "is", " ", "on", " ", "the", " ", "pf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "right", "\\u", "inl", "ane", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "right", "\\u", "inl", "ane", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "game_", "._", "player_", "._", "ball_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lets", " ", "drop", " ", "the", " ", "bal", "l", " ", "in", " ", "some", " ", "device", "s", " ", "and", " ", "make", " ", "sure", " ", "it", " ", "kick", "s", " ", "it", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "ejec", "t", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", " ", "fix", " ", "this", " ", "call", " ", "twi", "ce_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "bottom", "\\u", "popp", "er", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "top", "\\u", "popp", "er", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "drain", "s", ",", " ", "game", " ", "go", "es", " ", "to", " ", "bal", "l", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "default", "\\u", "platform_", "._", "add", "\\u", "bal", "l\\u", "to", "\\u", "device_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", " ", "bug", " ", "here", ".", " ", "Ha", "ve", " ", "to", " ", "call", " ", "advance", "\\u", "time", "\\u", "and", "\\u", "run", " ", "twi", "ce", " ", "for", " ", "it", " ", "to", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "self_", "._", "machine_", "._", "game_", "._", "player_", "._", "ball_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "repeat", " ", "above", " ", "cycle", " ", "for", " ", "bal", "l", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "player", " ", "hits", " ", "the", " ", "launch", " ", "button_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "is", " ", "on", " ", "the", " ", "pf_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "right", "\\u", "inl", "ane", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "right", "\\u", "inl", "ane", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", ",_", "self_", "._", "machine_", "._", "game_", "._", "player_", "._", "ball_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "drain", "s", ",", " ", "game", " ", "go", "es", " ", "to", " ", "bal", "l", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "default", "\\u", "platform_", "._", "add", "\\u", "bal", "l\\u", "to", "\\u", "device_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", " ", "bug", " ", "here", ".", " ", "Ha", "ve", " ", "to", " ", "call", " ", "advance", "\\u", "time", "\\u", "and", "\\u", "run", " ", "twi", "ce", " ", "for", " ", "it", " ", "to", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "self_", "._", "machine_", "._", "game_", "._", "player_", "._", "ball_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "repeat", " ", "above", " ", "cycle", " ", "for", " ", "bal", "l", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "player", " ", "hits", " ", "the", " ", "launch", " ", "button_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "machine_", "._", "switch", "\\u", "controller_", "._", "process", "\\u", "switch_", "(_", "'", "s", "\\u", "launch", "'_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "is", " ", "on", " ", "the", " ", "pf_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "time", " ", "let", "'", "s", " ", "test", " ", "the", " ", "timeo", "ut", " ", "with", " ", "no", " ", "pf", " ", "switch", " ", "hit_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "machine", ".", "switch", "\\u", "controlle", "r", ".", "process", "\\u", "switch", "('", "s", "\\u", "right", "\\u", "inl", "ane", "',", " ", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "self", ".", "machine", ".", "switch", "\\u", "controlle", "r", ".", "process", "\\u", "switch", "('", "s", "\\u", "right", "\\u", "inl", "ane", "',", " ", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "3_", ",_", "self_", "._", "machine_", "._", "game_", "._", "player_", "._", "ball_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "4_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "1_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bal", "l", " ", "drain", "s", ",", " ", "game", " ", "ends_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "default", "\\u", "platform_", "._", "add", "\\u", "bal", "l\\u", "to", "\\u", "device_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "todo", " ", "bug", " ", "here", ".", " ", "Ha", "ve", " ", "to", " ", "call", " ", "advance", "\\u", "time", "\\u", "and", "\\u", "run", " ", "twi", "ce", " ", "for", " ", "it", " ", "to", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advance", "\\u", "time", "\\u", "and", "\\u", "run_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "self_", "._", "machine_", "._", "game_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "plu", "nger", "_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "5_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "bd", "\\u", "trou", "gh_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "0_", ",_", "self_", "._", "machine_", "._", "bal", "l\\u", "devices_", "._", "play", "field_", "._", "balls", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "the", " ", "base", " ", "game", " ", "mode", " ", "is", " ", "not", " ", "active_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "machine_", "._", "mode", "\\u", "controller_", "._", "is", "\\u", "active_", "(_", "'", "base", "'_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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/pymel-1.0.5/extras/completion/py/maya/app/stereo/stereoCameraCustomPanel.py
[ { "content": "import maya.cmds as cmds\nfrom . import stereoCameraErrors\nfrom . import stereoCameraSets\nfrom . import stereoCameraUtil\nimport maya.mel as mel\nimport math\nfrom . import stereoCameraRig\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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 stereoCameraViewCallback(*args):\n \"\"\"\n Main callback point for sending information to the editor command.\n The format of the callback is as follows:\n \n arg1 = the name of the editor\n arg2 = keyword dictionary represented as a string.\n \"\"\"\n\n pass", "metadata": "root.stereoCameraViewCallback", "header": "['module', '___EOS___']", "index": 8 }, { "content": "def switchToCameraLeft(cameraName, editor):\n \"\"\"\n Additional wrapper layer around switchToCamera. This function switches\n to the current camera and also toggles the view mode to be 'left'\n \"\"\"\n\n pass", "metadata": "root.switchToCameraLeft", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def useCustomBackgroundState(*args):\n \"\"\"\n Return the state (True/False) of whether we use the display preferences or\n a solid background.\n \"\"\"\n\n pass", "metadata": "root.useCustomBackgroundState", "header": "['module', '___EOS___']", "index": 29 }, { "content": "def switchToCamera(*args):\n \"\"\"\n Switch the viewport editor the specified camera name.\n \"\"\"\n\n pass", "metadata": "root.switchToCamera", "header": "['module', '___EOS___']", "index": 38 }, { "content": "def getValidPanel(editor):\n \"\"\"\n This function checks the given editor to make sure it is an editor\n that we recognize. If it is not an known editor then we try to\n find an editor that will work.\n \"\"\"\n\n pass", "metadata": "root.getValidPanel", "header": "['module', '___EOS___']", "index": 46 }, { "content": "def initialize():\n \"\"\"\n Main initialization routine for registering a new panel type. This menu\n registers the new panel with Maya. We also install callbacks to monitor\n for new scene changes.\n \"\"\"\n\n pass", "metadata": "root.initialize", "header": "['module', '___EOS___']", "index": 56 }, { "content": "def switchToCameraCenter(cameraName, editor):\n \"\"\"\n Additional wrapper layer around switchToCamera. This function switches\n to the current camera and also toggles the view mode to be 'center'\n \"\"\"\n\n pass", "metadata": "root.switchToCameraCenter", "header": "['module', '___EOS___']", "index": 66 }, { "content": "def addNewCameraToCurrentSet(rigRoot, panel):\n \"\"\"\n This is the main function for adding camera rigs to a camera\n set. Given a valid stereo rig, add that rig to the current camera\n set. If a camera set does not exist then, create one and make the\n view aware of the camera set.\n \"\"\"\n\n pass", "metadata": "root.addNewCameraToCurrentSet", "header": "['module', '___EOS___']", "index": 75 }, { "content": "def checkState(*args):\n \"\"\"\n This is a callback that is invoked by the menu creation code. It is\n used to determine if the menu item should be checked. The first argument\n is assumed to be the displayMode name to check against and the second\n argument is assumed to be the name of the editor. Both are string types.\n \"\"\"\n\n pass", "metadata": "root.checkState", "header": "['module', '___EOS___']", "index": 86 }, { "content": "def createStereoCameraViewCmdString(command, editor, the_args):\n \"\"\"\n Packs the given arguments into a python string that can be evaluated\n at runtime.\n \n - the_args is assumed to be represented as a dictionary\n - editor is the custom editor.\n \"\"\"\n\n pass", "metadata": "root.createStereoCameraViewCmdString", "header": "['module', '___EOS___']", "index": 97 }, { "content": "def toggleUseCustomBackground(*args):\n \"\"\"\n Toggle whether the current viewport background should match the background\n that is defined in the user preferences.\n \"\"\"\n\n pass", "metadata": "root.toggleUseCustomBackground", "header": "['module', '___EOS___']", "index": 109 }, { "content": "def switchToCameraRight(cameraName, editor):\n \"\"\"\n Additional wrapper layer around switchToCamera. This function switches\n to the current camera and also toggles the view mode to be 'right'\n \"\"\"\n\n pass", "metadata": "root.switchToCameraRight", "header": "['module', '___EOS___']", "index": 118 }, { "content": "def adjustBackground(*args):\n \"\"\"\n Get the camera that is assigned to the current view.\n \"\"\"\n\n pass", "metadata": "root.adjustBackground", "header": "['module', '___EOS___']", "index": 127 }, { "content": "def setConvergenceDistanceToSelected(*args):\n \"\"\"\n Sets the convergence distance on the current viewing camera to the\n the specified selection. If more than one object is selected. It\n takes the average distance between each selection. Note, this only\n works with the standard StereoCamera rig and does not support generic rig\n data types.\n \"\"\"\n\n pass", "metadata": "root.setConvergenceDistanceToSelected", "header": "['module', '___EOS___']", "index": 135 }, { "content": "def selectCamera(*args):\n \"\"\"\n Select the camera that is in the current view.\n \"\"\"\n\n pass", "metadata": "root.selectCamera", "header": "['module', '___EOS___']", "index": 147 }, { "content": "def currentViewCamera(*args):\n \"\"\"\n Get the camera that is assigned to the current view.\n \"\"\"\n\n pass", "metadata": "root.currentViewCamera", "header": "['module', '___EOS___']", "index": 155 }, { "content": "def getValidEditor(panel):\n pass", "metadata": "root.getValidEditor", "header": "['module', '___EOS___']", "index": 163 }, { "content": "def uninitialize():\n \"\"\"\n Main uninitialization routine for deregistering the new panel and removes\n callbacks.\n \"\"\"\n\n pass", "metadata": "root.uninitialize", "header": "['module', '___EOS___']", "index": 167 }, { "content": "def currentViewRigFromEditor(editor):\n pass", "metadata": "root.currentViewRigFromEditor", "header": "['module', '___EOS___']", "index": 176 }, { "content": "def switchToSinglePerspLayout():\n \"\"\"\n Switch the current view into to single perspective stereo mode.\n \"\"\"\n\n pass", "metadata": "root.switchToSinglePerspLayout", "header": "['module', '___EOS___']", "index": 180 }, { "content": "def currentViewCameraFromEditor(editor):\n \"\"\"\n Given an editor retrieve the current camera from that editor.\n \"\"\"\n\n pass", "metadata": "root.currentViewCameraFromEditor", "header": "['module', '___EOS___']", "index": 188 }, { "content": "def activeModeAvailable(*args):\n \"\"\"\n Query the custom view to determine if the specified mode is available.\n \"\"\"\n\n pass", "metadata": "root.activeModeAvailable", "header": "['module', '___EOS___']", "index": 196 }, { "content": "def switchToCameraSet(*args):\n \"\"\"\n Switch the viewport editor the specified cameraSet name.\n \"\"\"\n\n pass", "metadata": "root.switchToCameraSet", "header": "['module', '___EOS___']", "index": 204 }, { "content": "def switchToOutlinerPerspLayout():\n \"\"\"\n Switch the current view into a outliner / persp viewer mode.\n \"\"\"\n\n pass", "metadata": "root.switchToOutlinerPerspLayout", "header": "['module', '___EOS___']", "index": 212 }, { "content": "def swapCamerasState(*args):\n \"\"\"\n Query the swap bit on the view.\n \"\"\"\n\n pass", "metadata": "root.swapCamerasState", "header": "['module', '___EOS___']", "index": 220 }, { "content": "def swapCameras(*args):\n \"\"\"\n Toggle the swap bit on the view.\n \"\"\"\n\n pass", "metadata": "root.swapCameras", "header": "['module', '___EOS___']", "index": 228 }, { "content": "def switchToSelected(*args):\n \"\"\"\n Switch the viewing camera to the current selection.\n \"\"\"\n\n pass", "metadata": "root.switchToSelected", "header": "['module', '___EOS___']", "index": 236 } ]
[ { "span": "import maya.cmds as cmds", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 24 }, { "span": "import maya.mel as mel", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 22 }, { "span": "import math", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "maya", "_", "._", "cmds_", "as_", "cmds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "stereo", "Came", "ra", "Errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "stereo", "Came", "ra", "Sets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "stereo", "Came", "ra", "Util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "maya", "_", "._", "mel", "_", "as_", "mel", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "stereo", "Came", "ra", "Rig", "_", "\\u\\u\\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\\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\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "stereo", "Came", "ra", "View", "Callback_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "callback", " ", "point", " ", "for", " ", "sendin", "g", " ", "informati", "on", " ", "to", " ", "the", " ", "editor", " ", "command", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "format", " ", "of", " ", "the", " ", "callback", " ", "is", " ", "as", " ", "follow", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "arg", "1", " ", "=", " ", "the", " ", "name", " ", "of", " ", "the", " ", "editor", "\\", "10", ";", " ", " ", " ", " ", "arg", "2", " ", "=", " ", "keyw", "ord", " ", "dictionar", "y", " ", "represent", "ed", " ", "as", " ", "a", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Came", "ra", "Left_", "(_", "came", "ra", "Name_", ",_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Addition", "al", " ", "wrapp", "er", " ", "layer", " ", "aro", "und", " ", "switch", "To", "Came", "ra", ".", " ", "Thi", "s", " ", "function", " ", "switche", "s", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "current", " ", "came", "ra", " ", "and", " ", "als", "o", " ", "toggle", "s", " ", "the", " ", "view", " ", "mode", " ", "to", " ", "be", " ", "'", "left", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "use", "Custom", "Back", "ground", "State_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "state", " ", "(", "Tru", "e", "/", "Fal", "se", ")", " ", "of", " ", "whe", "ther", " ", "we", " ", "use", " ", "the", " ", "display", " ", "preference", "s", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "solid", " ", "background", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Camera_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Switch", " ", "the", " ", "viewport", " ", "editor", " ", "the", " ", "specified", " ", "came", "ra", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Valid", "Panel_", "(_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "function", " ", "checks", " ", "the", " ", "give", "n", " ", "editor", " ", "to", " ", "make", " ", "sure", " ", "it", " ", "is", " ", "an", " ", "editor", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "we", " ", "recognize", ".", " ", "If", " ", "it", " ", "is", " ", "not", " ", "an", " ", "know", "n", " ", "editor", " ", "then", " ", "we", " ", "try", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "find", " ", "an", " ", "editor", " ", "tha", "t", " ", "will", " ", "work", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "initialize_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "initialization", " ", "routin", "e", " ", "for", " ", "register", "ing", " ", "a", " ", "new", " ", "panel", " ", "type", ".", " ", "Thi", "s", " ", "menu", "\\", "10", ";", " ", " ", " ", " ", "register", "s", " ", "the", " ", "new", " ", "panel", " ", "with", " ", "Maya", ".", " ", "We", " ", "als", "o", " ", "install", " ", "callback", "s", " ", "to", " ", "monit", "or", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "new", " ", "scen", "e", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Came", "ra", "Center_", "(_", "came", "ra", "Name_", ",_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Addition", "al", " ", "wrapp", "er", " ", "layer", " ", "aro", "und", " ", "switch", "To", "Came", "ra", ".", " ", "Thi", "s", " ", "function", " ", "switche", "s", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "current", " ", "came", "ra", " ", "and", " ", "als", "o", " ", "toggle", "s", " ", "the", " ", "view", " ", "mode", " ", "to", " ", "be", " ", "'", "center", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "New", "Came", "ra", "To", "Curr", "ent", "Set_", "(_", "rig", "Root_", ",_", "panel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "the", " ", "main", " ", "function", " ", "for", " ", "addin", "g", " ", "came", "ra", " ", "rig", "s", " ", "to", " ", "a", " ", "came", "ra", "\\", "10", ";", " ", " ", " ", " ", "set", ".", " ", "Give", "n", " ", "a", " ", "valid", " ", "stereo", " ", "rig", ",", " ", "add", " ", "tha", "t", " ", "rig", " ", "to", " ", "the", " ", "current", " ", "came", "ra", "\\", "10", ";", " ", " ", " ", " ", "set", ".", " ", "If", " ", "a", " ", "came", "ra", " ", "set", " ", "doe", "s", " ", "not", " ", "exist", " ", "then", ",", " ", "create", " ", "one", " ", "and", " ", "make", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "view", " ", "awa", "re", " ", "of", " ", "the", " ", "came", "ra", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check", "State_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "a", " ", "callback", " ", "tha", "t", " ", "is", " ", "invoke", "d", " ", "by", " ", "the", " ", "menu", " ", "creati", "on", " ", "code", ".", " ", "It", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "used", " ", "to", " ", "dete", "rmin", "e", " ", "if", " ", "the", " ", "menu", " ", "item", " ", "shou", "ld", " ", "be", " ", "checke", "d", ".", " ", "The", " ", "first", " ", "argu", "ment", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "assume", "d", " ", "to", " ", "be", " ", "the", " ", "display", "Mode", " ", "name", " ", "to", " ", "check", " ", "against", " ", "and", " ", "the", " ", "second", "\\", "10", ";", " ", " ", " ", " ", "argu", "ment", " ", "is", " ", "assume", "d", " ", "to", " ", "be", " ", "the", " ", "name", " ", "of", " ", "the", " ", "editor", ".", " ", "Bot", "h", " ", "are", " ", "string", " ", "types", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "Ster", "eo", "Came", "ra", "View", "Cmd", "String_", "(_", "command_", ",_", "editor_", ",_", "the", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pack", "s", " ", "the", " ", "give", "n", " ", "argu", "ment", "s", " ", "int", "o", " ", "a", " ", "python", " ", "string", " ", "tha", "t", " ", "can", " ", "be", " ", "evaluate", "d", "\\", "10", ";", " ", " ", " ", " ", "at", " ", "runt", "ime", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "the", "\\u", "args", " ", "is", " ", "assume", "d", " ", "to", " ", "be", " ", "represent", "ed", " ", "as", " ", "a", " ", "dictionar", "y", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "editor", " ", "is", " ", "the", " ", "custom", " ", "editor", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "toggle", "Us", "e", "Custom", "Background_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Toggle", " ", "whe", "ther", " ", "the", " ", "current", " ", "viewport", " ", "background", " ", "shou", "ld", " ", "match", " ", "the", " ", "background", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "is", " ", "defin", "ed", " ", "in", " ", "the", " ", "user", " ", "preference", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Came", "ra", "Right_", "(_", "came", "ra", "Name_", ",_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Addition", "al", " ", "wrapp", "er", " ", "layer", " ", "aro", "und", " ", "switch", "To", "Came", "ra", ".", " ", "Thi", "s", " ", "function", " ", "switche", "s", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "the", " ", "current", " ", "came", "ra", " ", "and", " ", "als", "o", " ", "toggle", "s", " ", "the", " ", "view", " ", "mode", " ", "to", " ", "be", " ", "'", "right", "'", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "adjust", "Background_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "came", "ra", " ", "tha", "t", " ", "is", " ", "assign", "ed", " ", "to", " ", "the", " ", "current", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Converge", "nce", "Distan", "ce", "To", "Selected_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "the", " ", "convergence", " ", "distance", " ", "on", " ", "the", " ", "current", " ", "viewin", "g", " ", "came", "ra", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "specified", " ", "selection", ".", " ", "If", " ", "more", " ", "than", " ", "one", " ", "object", " ", "is", " ", "selecte", "d", ".", " ", "It", "\\", "10", ";", " ", " ", " ", " ", "take", "s", " ", "the", " ", "averag", "e", " ", "distance", " ", "bet", "ween", " ", "each", " ", "selection", ".", " ", "Not", "e", ",", " ", "this", " ", "only", "\\", "10", ";", " ", " ", " ", " ", "works", " ", "with", " ", "the", " ", "standard", " ", "Ster", "eo", "Came", "ra", " ", "rig", " ", "and", " ", "doe", "s", " ", "not", " ", "support", " ", "gener", "ic", " ", "rig", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "types", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select", "Camera_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Select", " ", "the", " ", "came", "ra", " ", "tha", "t", " ", "is", " ", "in", " ", "the", " ", "current", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current", "View", "Camera_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "came", "ra", " ", "tha", "t", " ", "is", " ", "assign", "ed", " ", "to", " ", "the", " ", "current", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Valid", "Editor_", "(_", "panel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unin", "iti", "alize", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Main", " ", "unin", "iti", "ali", "zatio", "n", " ", "routin", "e", " ", "for", " ", "dere", "gister", "ing", " ", "the", " ", "new", " ", "panel", " ", "and", " ", "remove", "s", "\\", "10", ";", " ", " ", " ", " ", "callback", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current", "View", "Rig", "Fro", "m", "Editor_", "(_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Sing", "le", "Pers", "p", "Layout_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Switch", " ", "the", " ", "current", " ", "view", " ", "int", "o", " ", "to", " ", "single", " ", "perspective", " ", "stereo", " ", "mode", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "current", "View", "Came", "ra", "Fro", "m", "Editor_", "(_", "editor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "an", " ", "editor", " ", "retrieve", " ", "the", " ", "current", " ", "came", "ra", " ", "from", " ", "tha", "t", " ", "editor", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "active", "Mode", "Available_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Query", " ", "the", " ", "custom", " ", "view", " ", "to", " ", "dete", "rmin", "e", " ", "if", " ", "the", " ", "specified", " ", "mode", " ", "is", " ", "avail", "able", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Came", "ra", "Set_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Switch", " ", "the", " ", "viewport", " ", "editor", " ", "the", " ", "specified", " ", "came", "ra", "Set", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Outline", "r", "Pers", "p", "Layout_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Switch", " ", "the", " ", "current", " ", "view", " ", "int", "o", " ", "a", " ", "outline", "r", " ", "/", " ", "pers", "p", " ", "viewer", " ", "mode", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "swap", "Came", "ras", "State_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Query", " ", "the", " ", "swap", " ", "bit", " ", "on", " ", "the", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "swap", "Came", "ras", "_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Toggle", " ", "the", " ", "swap", " ", "bit", " ", "on", " ", "the", " ", "view", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "switch", "To", "Selected_", "(_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Switch", " ", "the", " ", "viewin", "g", " ", "came", "ra", " ", "to", " ", "the", " ", "current", " ", "selection", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pass_" ]
[ 4, 4, 4, 4, 4, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
toastdriven/alligator/tests/test_beanstalk_backend.py
[ { "content": " def test_get(self):\n jid_1 = self.backend.push('all', 'hello', \"{'whee': 1}\")\n jid_2 = self.backend.push('all', 'world', \"{'whee': 2}\")\n\n data = self.backend.get('all', jid_2)\n self.assertEqual(data, \"{'whee': 2}\")\n self.assertEqual(self.backend.len('all'), 1)", "metadata": "root.BeanstalkTestCase.test_get", "header": "['class', 'BeanstalkTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 56 } ]
[ { "span": "jid_1 ", "start_line": 57, "start_column": 8, "end_line": 57, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Bea", "nstal", "k", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ji", "d\\u", "1_", "=_", "self_", "._", "backend_", "._", "push_", "(_", "'", "all", "'_", ",_", "'", "hell", "o", "'_", ",_", "\"{", "'", "whe", "e", "':", " ", "1", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ji", "d\\u", "2_", "=_", "self_", "._", "backend_", "._", "push_", "(_", "'", "all", "'_", ",_", "'", "world", "'_", ",_", "\"{", "'", "whe", "e", "':", " ", "2", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "self_", "._", "backend_", "._", "get_", "(_", "'", "all", "'_", ",_", "ji", "d\\u", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "data_", ",_", "\"{", "'", "whe", "e", "':", " ", "2", "}\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "backend_", "._", "len_", "(_", "'", "all", "'_", ")_", ",_", "1_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
JT5D/Alfred-Popclip-Sublime/Sublime Text 2/JsFormat/libs/diff_match_patch/python2/diff_match_patch.py
[ { "content": "#!/usr/bin/python2.4\n\nfrom __future__ import division\n\n\"\"\"Diff Match and Patch\n\nCopyright 2006 Google Inc.\nhttp://code.google.com/p/google-diff-match-patch/\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\n\n\"\"\"Functions for diff, match and patch.\n\nComputes the difference between two texts to create a patch.\nApplies the patch onto another text, allowing for errors.\n\"\"\"\n\n__author__ = '[email protected] (Neil Fraser)'\n\nimport math\nimport re\nimport sys\nimport time\nimport urllib\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class diff_match_patch:\n \"\"\"Class containing the diff, match and patch methods.\n\n Also contains the behaviour settings.\n \"\"\"\n\n\n # DIFF FUNCTIONS\n\n # The data structure representing a diff is an array of tuples:\n # [(DIFF_DELETE, \"Hello\"), (DIFF_INSERT, \"Goodbye\"), (DIFF_EQUAL, \" world.\")]\n # which means: delete \"Hello\", add \"Goodbye\" and keep \" world.\"\n DIFF_DELETE = -1\n DIFF_INSERT = 1\n DIFF_EQUAL = 0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # Define some regex patterns for matching boundaries.\n BLANKLINEEND = re.compile(r\"\\n\\r?\\n$\");\n BLANKLINESTART = re.compile(r\"^\\r?\\n\\r?\\n\");\n\n\n\n\n\n\n\n\n\n\n # MATCH FUNCTIONS\n\n\n\n\n # PATCH FUNCTIONS\n\n\n\n\n\n\n\n", "metadata": "root.diff_match_patch", "header": "['module', '___EOS___']", "index": 36 }, { "content": " def __init__(self):\n \"\"\"Inits a diff_match_patch object with default settings.\n Redefine these in your program to override the defaults.\n \"\"\"\n\n # Number of seconds to map a diff before giving up (0 for infinity).\n self.Diff_Timeout = 1.0\n # Cost of an empty edit operation in terms of edit characters.\n self.Diff_EditCost = 4\n # At what point is no match declared (0.0 = perfection, 1.0 = very loose).\n self.Match_Threshold = 0.5\n # How far to search for a match (0 = exact location, 1000+ = broad match).\n # A match this many characters away from the expected location will add\n # 1.0 to the score (0.0 is a perfect match).\n self.Match_Distance = 1000\n # When deleting a large block of text (over ~64 characters), how close do\n # the contents have to be to match the expected contents. (0.0 = perfection,\n # 1.0 = very loose). Note that Match_Threshold controls how closely the\n # end points of a delete need to match.\n self.Patch_DeleteThreshold = 0.5\n # Chunk size for context length.\n self.Patch_Margin = 4\n\n # The number of bits in an int.\n # Python has no maximum, thus to disable patch splitting set to 0.\n # However to avoid long patches in certain pathological cases, use 32.\n # Multiple short patches (using native ints) are much faster than long ones.\n self.Match_MaxBits = 32", "metadata": "root.diff_match_patch.__init__", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 42 }, { "content": " def diff_main(self, text1, text2, checklines=True, deadline=None):\n \"\"\"Find the differences between two texts. Simplifies the problem by\n stripping any common prefix or suffix off the texts before diffing.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n checklines: Optional speedup flag. If present and false, then don't run\n a line-level diff first to identify the changed areas.\n Defaults to true, which does a faster, slightly less optimal diff.\n deadline: Optional time when the diff should be complete by. Used\n internally for recursive calls. Users should set DiffTimeout instead.\n\n Returns:\n Array of changes.\n \"\"\"\n # Set a deadline by which time the diff must be complete.\n if deadline == None:\n # Unlike in most languages, Python counts time in seconds.\n if self.Diff_Timeout <= 0:\n deadline = sys.maxint\n else:\n deadline = time.time() + self.Diff_Timeout\n\n # Check for null inputs.\n if text1 == None or text2 == None:\n raise ValueError(\"Null inputs. (diff_main)\")\n\n # Check for equality (speedup).\n if text1 == text2:\n if text1:\n return [(self.DIFF_EQUAL, text1)]\n return []\n\n # Trim off common prefix (speedup).\n commonlength = self.diff_commonPrefix(text1, text2)\n commonprefix = text1[:commonlength]\n text1 = text1[commonlength:]\n text2 = text2[commonlength:]\n\n # Trim off common suffix (speedup).\n commonlength = self.diff_commonSuffix(text1, text2)\n if commonlength == 0:\n commonsuffix = ''\n else:\n commonsuffix = text1[-commonlength:]\n text1 = text1[:-commonlength]\n text2 = text2[:-commonlength]\n\n # Compute the diff on the middle block.\n diffs = self.diff_compute(text1, text2, checklines, deadline)\n\n # Restore the prefix and suffix.\n if commonprefix:\n diffs[:0] = [(self.DIFF_EQUAL, commonprefix)]\n if commonsuffix:\n diffs.append((self.DIFF_EQUAL, commonsuffix))\n self.diff_cleanupMerge(diffs)\n return diffs", "metadata": "root.diff_match_patch.diff_main", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 80 }, { "content": " def diff_compute(self, text1, text2, checklines, deadline):\n \"\"\"Find the differences between two texts. Assumes that the texts do not\n have any common prefix or suffix.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n checklines: Speedup flag. If false, then don't run a line-level diff\n first to identify the changed areas.\n If true, then run a faster, slightly less optimal diff.\n deadline: Time when the diff should be complete by.\n\n Returns:\n Array of changes.\n \"\"\"\n if not text1:\n # Just add some text (speedup).\n return [(self.DIFF_INSERT, text2)]\n\n if not text2:\n # Just delete some text (speedup).\n return [(self.DIFF_DELETE, text1)]\n\n if len(text1) > len(text2):\n (longtext, shorttext) = (text1, text2)\n else:\n (shorttext, longtext) = (text1, text2)\n i = longtext.find(shorttext)\n if i != -1:\n # Shorter text is inside the longer text (speedup).\n diffs = [(self.DIFF_INSERT, longtext[:i]), (self.DIFF_EQUAL, shorttext),\n (self.DIFF_INSERT, longtext[i + len(shorttext):])]\n # Swap insertions for deletions if diff is reversed.\n if len(text1) > len(text2):\n diffs[0] = (self.DIFF_DELETE, diffs[0][1])\n diffs[2] = (self.DIFF_DELETE, diffs[2][1])\n return diffs\n\n if len(shorttext) == 1:\n # Single character string.\n # After the previous speedup, the character can't be an equality.\n return [(self.DIFF_DELETE, text1), (self.DIFF_INSERT, text2)]\n\n # Check to see if the problem can be split in two.\n hm = self.diff_halfMatch(text1, text2)\n if hm:\n # A half-match was found, sort out the return data.\n (text1_a, text1_b, text2_a, text2_b, mid_common) = hm\n # Send both pairs off for separate processing.\n diffs_a = self.diff_main(text1_a, text2_a, checklines, deadline)\n diffs_b = self.diff_main(text1_b, text2_b, checklines, deadline)\n # Merge the results.\n return diffs_a + [(self.DIFF_EQUAL, mid_common)] + diffs_b\n\n if checklines and len(text1) > 100 and len(text2) > 100:\n return self.diff_lineMode(text1, text2, deadline)\n\n return self.diff_bisect(text1, text2, deadline)", "metadata": "root.diff_match_patch.diff_compute", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 140 }, { "content": " def diff_lineMode(self, text1, text2, deadline):\n \"\"\"Do a quick line-level diff on both strings, then rediff the parts for\n greater accuracy.\n This speedup can produce non-minimal diffs.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n deadline: Time when the diff should be complete by.\n\n Returns:\n Array of changes.\n \"\"\"\n\n # Scan the text on a line-by-line basis first.\n (text1, text2, linearray) = self.diff_linesToChars(text1, text2)\n\n diffs = self.diff_main(text1, text2, False, deadline)\n\n # Convert the diff back to original text.\n self.diff_charsToLines(diffs, linearray)\n # Eliminate freak matches (e.g. blank lines)\n self.diff_cleanupSemantic(diffs)\n\n # Rediff any replacement blocks, this time character-by-character.\n # Add a dummy entry at the end.\n diffs.append((self.DIFF_EQUAL, ''))\n pointer = 0\n count_delete = 0\n count_insert = 0\n text_delete = ''\n text_insert = ''\n while pointer < len(diffs):\n if diffs[pointer][0] == self.DIFF_INSERT:\n count_insert += 1\n text_insert += diffs[pointer][1]\n elif diffs[pointer][0] == self.DIFF_DELETE:\n count_delete += 1\n text_delete += diffs[pointer][1]\n elif diffs[pointer][0] == self.DIFF_EQUAL:\n # Upon reaching an equality, check for prior redundancies.\n if count_delete >= 1 and count_insert >= 1:\n # Delete the offending records and add the merged ones.\n a = self.diff_main(text_delete, text_insert, False, deadline)\n diffs[pointer - count_delete - count_insert : pointer] = a\n pointer = pointer - count_delete - count_insert + len(a)\n count_insert = 0\n count_delete = 0\n text_delete = ''\n text_insert = ''\n\n pointer += 1\n\n diffs.pop() # Remove the dummy entry at the end.\n\n return diffs", "metadata": "root.diff_match_patch.diff_lineMode", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 199 }, { "content": " def diff_bisect(self, text1, text2, deadline):\n \"\"\"Find the 'middle snake' of a diff, split the problem in two\n and return the recursively constructed diff.\n See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n deadline: Time at which to bail if not yet complete.\n\n Returns:\n Array of diff tuples.\n \"\"\"\n\n # Cache the text lengths to prevent multiple calls.\n text1_length = len(text1)\n text2_length = len(text2)\n max_d = (text1_length + text2_length + 1) // 2\n v_offset = max_d\n v_length = 2 * max_d\n v1 = [-1] * v_length\n v1[v_offset + 1] = 0\n v2 = v1[:]\n delta = text1_length - text2_length\n # If the total number of characters is odd, then the front path will\n # collide with the reverse path.\n front = (delta % 2 != 0)\n # Offsets for start and end of k loop.\n # Prevents mapping of space beyond the grid.\n k1start = 0\n k1end = 0\n k2start = 0\n k2end = 0\n for d in xrange(max_d):\n # Bail out if deadline is reached.\n if time.time() > deadline:\n break\n\n # Walk the front path one step.\n for k1 in xrange(-d + k1start, d + 1 - k1end, 2):\n k1_offset = v_offset + k1\n if k1 == -d or (k1 != d and\n v1[k1_offset - 1] < v1[k1_offset + 1]):\n x1 = v1[k1_offset + 1]\n else:\n x1 = v1[k1_offset - 1] + 1\n y1 = x1 - k1\n while (x1 < text1_length and y1 < text2_length and\n text1[x1] == text2[y1]):\n x1 += 1\n y1 += 1\n v1[k1_offset] = x1\n if x1 > text1_length:\n # Ran off the right of the graph.\n k1end += 2\n elif y1 > text2_length:\n # Ran off the bottom of the graph.\n k1start += 2\n elif front:\n k2_offset = v_offset + delta - k1\n if k2_offset >= 0 and k2_offset < v_length and v2[k2_offset] != -1:\n # Mirror x2 onto top-left coordinate system.\n x2 = text1_length - v2[k2_offset]\n if x1 >= x2:\n # Overlap detected.\n return self.diff_bisectSplit(text1, text2, x1, y1, deadline)\n\n # Walk the reverse path one step.\n for k2 in xrange(-d + k2start, d + 1 - k2end, 2):\n k2_offset = v_offset + k2\n if k2 == -d or (k2 != d and\n v2[k2_offset - 1] < v2[k2_offset + 1]):\n x2 = v2[k2_offset + 1]\n else:\n x2 = v2[k2_offset - 1] + 1\n y2 = x2 - k2\n while (x2 < text1_length and y2 < text2_length and\n text1[-x2 - 1] == text2[-y2 - 1]):\n x2 += 1\n y2 += 1\n v2[k2_offset] = x2\n if x2 > text1_length:\n # Ran off the left of the graph.\n k2end += 2\n elif y2 > text2_length:\n # Ran off the top of the graph.\n k2start += 2\n elif not front:\n k1_offset = v_offset + delta - k2\n if k1_offset >= 0 and k1_offset < v_length and v1[k1_offset] != -1:\n x1 = v1[k1_offset]\n y1 = v_offset + x1 - k1_offset\n # Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2\n if x1 >= x2:\n # Overlap detected.\n return self.diff_bisectSplit(text1, text2, x1, y1, deadline)\n\n # Diff took too long and hit the deadline or\n # number of diffs equals number of characters, no commonality at all.\n return [(self.DIFF_DELETE, text1), (self.DIFF_INSERT, text2)]", "metadata": "root.diff_match_patch.diff_bisect", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 256 }, { "content": " def diff_bisectSplit(self, text1, text2, x, y, deadline):\n \"\"\"Given the location of the 'middle snake', split the diff in two parts\n and recurse.\n\n Args:\n text1: Old string to be diffed.\n text2: New string to be diffed.\n x: Index of split point in text1.\n y: Index of split point in text2.\n deadline: Time at which to bail if not yet complete.\n\n Returns:\n Array of diff tuples.\n \"\"\"\n text1a = text1[:x]\n text2a = text2[:y]\n text1b = text1[x:]\n text2b = text2[y:]\n\n # Compute both diffs serially.\n diffs = self.diff_main(text1a, text2a, False, deadline)\n diffsb = self.diff_main(text1b, text2b, False, deadline)\n\n return diffs + diffsb", "metadata": "root.diff_match_patch.diff_bisectSplit", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 358 }, { "content": " def diff_linesToChars(self, text1, text2):\n \"\"\"Split two texts into an array of strings. Reduce the texts to a string\n of hashes where each Unicode character represents one line.\n\n Args:\n text1: First string.\n text2: Second string.\n\n Returns:\n Three element tuple, containing the encoded text1, the encoded text2 and\n the array of unique strings. The zeroth element of the array of unique\n strings is intentionally blank.\n \"\"\"\n lineArray = [] # e.g. lineArray[4] == \"Hello\\n\"\n lineHash = {} # e.g. lineHash[\"Hello\\n\"] == 4\n\n # \"\\x00\" is a valid character, but various debuggers don't like it.\n # So we'll insert a junk entry to avoid generating a null character.\n lineArray.append('')\n\n def diff_linesToCharsMunge(text):\n \"\"\"Split a text into an array of strings. Reduce the texts to a string\n of hashes where each Unicode character represents one line.\n Modifies linearray and linehash through being a closure.\n\n Args:\n text: String to encode.\n\n Returns:\n Encoded string.\n \"\"\"\n chars = []\n # Walk the text, pulling out a substring for each line.\n # text.split('\\n') would would temporarily double our memory footprint.\n # Modifying text would create many large strings to garbage collect.\n lineStart = 0\n lineEnd = -1\n while lineEnd < len(text) - 1:\n lineEnd = text.find('\\n', lineStart)\n if lineEnd == -1:\n lineEnd = len(text) - 1\n line = text[lineStart:lineEnd + 1]\n lineStart = lineEnd + 1\n\n if line in lineHash:\n chars.append(unichr(lineHash[line]))\n else:\n lineArray.append(line)\n lineHash[line] = len(lineArray) - 1\n chars.append(unichr(len(lineArray) - 1))\n return \"\".join(chars)\n\n chars1 = diff_linesToCharsMunge(text1)\n chars2 = diff_linesToCharsMunge(text2)\n return (chars1, chars2, lineArray)", "metadata": "root.diff_match_patch.diff_linesToChars", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 383 }, { "content": " def diff_charsToLines(self, diffs, lineArray):\n \"\"\"Rehydrate the text in a diff from a string of line hashes to real lines\n of text.\n\n Args:\n diffs: Array of diff tuples.\n lineArray: Array of unique strings.\n \"\"\"\n for x in xrange(len(diffs)):\n text = []\n for char in diffs[x][1]:\n text.append(lineArray[ord(char)])\n diffs[x] = (diffs[x][0], \"\".join(text))", "metadata": "root.diff_match_patch.diff_charsToLines", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 439 }, { "content": " def diff_commonPrefix(self, text1, text2):\n \"\"\"Determine the common prefix of two strings.\n\n Args:\n text1: First string.\n text2: Second string.\n\n Returns:\n The number of characters common to the start of each string.\n \"\"\"\n # Quick check for common null cases.\n if not text1 or not text2 or text1[0] != text2[0]:\n return 0\n # Binary search.\n # Performance analysis: http://neil.fraser.name/news/2007/10/09/\n pointermin = 0\n pointermax = min(len(text1), len(text2))\n pointermid = pointermax\n pointerstart = 0\n while pointermin < pointermid:\n if text1[pointerstart:pointermid] == text2[pointerstart:pointermid]:\n pointermin = pointermid\n pointerstart = pointermin\n else:\n pointermax = pointermid\n pointermid = (pointermax - pointermin) // 2 + pointermin\n return pointermid", "metadata": "root.diff_match_patch.diff_commonPrefix", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 453 }, { "content": " def diff_commonSuffix(self, text1, text2):\n \"\"\"Determine the common suffix of two strings.\n\n Args:\n text1: First string.\n text2: Second string.\n\n Returns:\n The number of characters common to the end of each string.\n \"\"\"\n # Quick check for common null cases.\n if not text1 or not text2 or text1[-1] != text2[-1]:\n return 0\n # Binary search.\n # Performance analysis: http://neil.fraser.name/news/2007/10/09/\n pointermin = 0\n pointermax = min(len(text1), len(text2))\n pointermid = pointermax\n pointerend = 0\n while pointermin < pointermid:\n if (text1[-pointermid:len(text1) - pointerend] ==\n text2[-pointermid:len(text2) - pointerend]):\n pointermin = pointermid\n pointerend = pointermin\n else:\n pointermax = pointermid\n pointermid = (pointermax - pointermin) // 2 + pointermin\n return pointermid", "metadata": "root.diff_match_patch.diff_commonSuffix", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 481 }, { "content": " def diff_commonOverlap(self, text1, text2):\n \"\"\"Determine if the suffix of one string is the prefix of another.\n\n Args:\n text1 First string.\n text2 Second string.\n\n Returns:\n The number of characters common to the end of the first\n string and the start of the second string.\n \"\"\"\n # Cache the text lengths to prevent multiple calls.\n text1_length = len(text1)\n text2_length = len(text2)\n # Eliminate the null case.\n if text1_length == 0 or text2_length == 0:\n return 0\n # Truncate the longer string.\n if text1_length > text2_length:\n text1 = text1[-text2_length:]\n elif text1_length < text2_length:\n text2 = text2[:text1_length]\n text_length = min(text1_length, text2_length)\n # Quick check for the worst case.\n if text1 == text2:\n return text_length\n\n # Start by looking for a single character match\n # and increase length until no match is found.\n # Performance analysis: http://neil.fraser.name/news/2010/11/04/\n best = 0\n length = 1\n while True:\n pattern = text1[-length:]\n found = text2.find(pattern)\n if found == -1:\n return best\n length += found\n if found == 0 or text1[-length:] == text2[:length]:\n best = length\n length += 1", "metadata": "root.diff_match_patch.diff_commonOverlap", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 510 }, { "content": " def diff_halfMatch(self, text1, text2):\n \"\"\"Do the two texts share a substring which is at least half the length of\n the longer text?\n This speedup can produce non-minimal diffs.\n\n Args:\n text1: First string.\n text2: Second string.\n\n Returns:\n Five element Array, containing the prefix of text1, the suffix of text1,\n the prefix of text2, the suffix of text2 and the common middle. Or None\n if there was no match.\n \"\"\"\n if self.Diff_Timeout <= 0:\n # Don't risk returning a non-optimal diff if we have unlimited time.\n return None\n if len(text1) > len(text2):\n (longtext, shorttext) = (text1, text2)\n else:\n (shorttext, longtext) = (text1, text2)\n if len(longtext) < 4 or len(shorttext) * 2 < len(longtext):\n return None # Pointless.\n\n def diff_halfMatchI(longtext, shorttext, i):\n \"\"\"Does a substring of shorttext exist within longtext such that the\n substring is at least half the length of longtext?\n Closure, but does not reference any external variables.\n\n Args:\n longtext: Longer string.\n shorttext: Shorter string.\n i: Start index of quarter length substring within longtext.\n\n Returns:\n Five element Array, containing the prefix of longtext, the suffix of\n longtext, the prefix of shorttext, the suffix of shorttext and the\n common middle. Or None if there was no match.\n \"\"\"\n seed = longtext[i:i + len(longtext) // 4]\n best_common = ''\n j = shorttext.find(seed)\n while j != -1:\n prefixLength = self.diff_commonPrefix(longtext[i:], shorttext[j:])\n suffixLength = self.diff_commonSuffix(longtext[:i], shorttext[:j])\n if len(best_common) < suffixLength + prefixLength:\n best_common = (shorttext[j - suffixLength:j] +\n shorttext[j:j + prefixLength])\n best_longtext_a = longtext[:i - suffixLength]\n best_longtext_b = longtext[i + prefixLength:]\n best_shorttext_a = shorttext[:j - suffixLength]\n best_shorttext_b = shorttext[j + prefixLength:]\n j = shorttext.find(seed, j + 1)\n\n if len(best_common) * 2 >= len(longtext):\n return (best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common)\n else:\n return None\n\n # First check if the second quarter is the seed for a half-match.\n hm1 = diff_halfMatchI(longtext, shorttext, (len(longtext) + 3) // 4)\n # Check again based on the third quarter.\n hm2 = diff_halfMatchI(longtext, shorttext, (len(longtext) + 1) // 2)\n if not hm1 and not hm2:\n return None\n elif not hm2:\n hm = hm1\n elif not hm1:\n hm = hm2\n else:\n # Both matched. Select the longest.\n if len(hm1[4]) > len(hm2[4]):\n hm = hm1\n else:\n hm = hm2\n\n # A half-match was found, sort out the return data.\n if len(text1) > len(text2):\n (text1_a, text1_b, text2_a, text2_b, mid_common) = hm\n else:\n (text2_a, text2_b, text1_a, text1_b, mid_common) = hm\n return (text1_a, text1_b, text2_a, text2_b, mid_common)", "metadata": "root.diff_match_patch.diff_halfMatch", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 552 }, { "content": " def diff_cleanupSemantic(self, diffs):\n \"\"\"Reduce the number of edits by eliminating semantically trivial\n equalities.\n\n Args:\n diffs: Array of diff tuples.\n \"\"\"\n changes = False\n equalities = [] # Stack of indices where equalities are found.\n lastequality = None # Always equal to diffs[equalities[-1]][1]\n pointer = 0 # Index of current position.\n # Number of chars that changed prior to the equality.\n length_insertions1, length_deletions1 = 0, 0\n # Number of chars that changed after the equality.\n length_insertions2, length_deletions2 = 0, 0\n while pointer < len(diffs):\n if diffs[pointer][0] == self.DIFF_EQUAL: # Equality found.\n equalities.append(pointer)\n length_insertions1, length_insertions2 = length_insertions2, 0\n length_deletions1, length_deletions2 = length_deletions2, 0\n lastequality = diffs[pointer][1]\n else: # An insertion or deletion.\n if diffs[pointer][0] == self.DIFF_INSERT:\n length_insertions2 += len(diffs[pointer][1])\n else:\n length_deletions2 += len(diffs[pointer][1])\n # Eliminate an equality that is smaller or equal to the edits on both\n # sides of it.\n if (lastequality and (len(lastequality) <=\n max(length_insertions1, length_deletions1)) and\n (len(lastequality) <= max(length_insertions2, length_deletions2))):\n # Duplicate record.\n diffs.insert(equalities[-1], (self.DIFF_DELETE, lastequality))\n # Change second copy to insert.\n diffs[equalities[-1] + 1] = (self.DIFF_INSERT,\n diffs[equalities[-1] + 1][1])\n # Throw away the equality we just deleted.\n equalities.pop()\n # Throw away the previous equality (it needs to be reevaluated).\n if len(equalities):\n equalities.pop()\n if len(equalities):\n pointer = equalities[-1]\n else:\n pointer = -1\n # Reset the counters.\n length_insertions1, length_deletions1 = 0, 0\n length_insertions2, length_deletions2 = 0, 0\n lastequality = None\n changes = True\n pointer += 1\n\n # Normalize the diff.\n if changes:\n self.diff_cleanupMerge(diffs)\n self.diff_cleanupSemanticLossless(diffs)\n\n # Find any overlaps between deletions and insertions.\n # e.g: <del>abcxxx</del><ins>xxxdef</ins>\n # -> <del>abc</del>xxx<ins>def</ins>\n # e.g: <del>xxxabc</del><ins>defxxx</ins>\n # -> <ins>def</ins>xxx<del>abc</del>\n # Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1\n while pointer < len(diffs):\n if (diffs[pointer - 1][0] == self.DIFF_DELETE and\n diffs[pointer][0] == self.DIFF_INSERT):\n deletion = diffs[pointer - 1][1]\n insertion = diffs[pointer][1]\n overlap_length1 = self.diff_commonOverlap(deletion, insertion)\n overlap_length2 = self.diff_commonOverlap(insertion, deletion)\n if overlap_length1 >= overlap_length2:\n if (overlap_length1 >= len(deletion) / 2.0 or\n overlap_length1 >= len(insertion) / 2.0):\n # Overlap found. Insert an equality and trim the surrounding edits.\n diffs.insert(pointer, (self.DIFF_EQUAL,\n insertion[:overlap_length1]))\n diffs[pointer - 1] = (self.DIFF_DELETE,\n deletion[:len(deletion) - overlap_length1])\n diffs[pointer + 1] = (self.DIFF_INSERT,\n insertion[overlap_length1:])\n pointer += 1\n else:\n if (overlap_length2 >= len(deletion) / 2.0 or\n overlap_length2 >= len(insertion) / 2.0):\n # Reverse overlap found.\n # Insert an equality and swap and trim the surrounding edits.\n diffs.insert(pointer, (self.DIFF_EQUAL, deletion[:overlap_length2]))\n diffs[pointer - 1] = (self.DIFF_INSERT,\n insertion[:len(insertion) - overlap_length2])\n diffs[pointer + 1] = (self.DIFF_DELETE, deletion[overlap_length2:])\n pointer += 1\n pointer += 1\n pointer += 1", "metadata": "root.diff_match_patch.diff_cleanupSemantic", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 636 }, { "content": " def diff_cleanupSemanticLossless(self, diffs):\n \"\"\"Look for single edits surrounded on both sides by equalities\n which can be shifted sideways to align the edit to a word boundary.\n e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came.\n\n Args:\n diffs: Array of diff tuples.\n \"\"\"\n\n def diff_cleanupSemanticScore(one, two):\n \"\"\"Given two strings, compute a score representing whether the\n internal boundary falls on logical boundaries.\n Scores range from 6 (best) to 0 (worst).\n Closure, but does not reference any external variables.\n\n Args:\n one: First string.\n two: Second string.\n\n Returns:\n The score.\n \"\"\"\n if not one or not two:\n # Edges are the best.\n return 6\n\n # Each port of this function behaves slightly differently due to\n # subtle differences in each language's definition of things like\n # 'whitespace'. Since this function's purpose is largely cosmetic,\n # the choice has been made to use each language's native features\n # rather than force total conformity.\n char1 = one[-1]\n char2 = two[0]\n nonAlphaNumeric1 = not char1.isalnum()\n nonAlphaNumeric2 = not char2.isalnum()\n whitespace1 = nonAlphaNumeric1 and char1.isspace()\n whitespace2 = nonAlphaNumeric2 and char2.isspace()\n lineBreak1 = whitespace1 and (char1 == \"\\r\" or char1 == \"\\n\")\n lineBreak2 = whitespace2 and (char2 == \"\\r\" or char2 == \"\\n\")\n blankLine1 = lineBreak1 and self.BLANKLINEEND.search(one)\n blankLine2 = lineBreak2 and self.BLANKLINESTART.match(two)\n\n if blankLine1 or blankLine2:\n # Five points for blank lines.\n return 5\n elif lineBreak1 or lineBreak2:\n # Four points for line breaks.\n return 4\n elif nonAlphaNumeric1 and not whitespace1 and whitespace2:\n # Three points for end of sentences.\n return 3\n elif whitespace1 or whitespace2:\n # Two points for whitespace.\n return 2\n elif nonAlphaNumeric1 or nonAlphaNumeric2:\n # One point for non-alphanumeric.\n return 1\n return 0\n\n pointer = 1\n # Intentionally ignore the first and last element (don't need checking).\n while pointer < len(diffs) - 1:\n if (diffs[pointer - 1][0] == self.DIFF_EQUAL and\n diffs[pointer + 1][0] == self.DIFF_EQUAL):\n # This is a single edit surrounded by equalities.\n equality1 = diffs[pointer - 1][1]\n edit = diffs[pointer][1]\n equality2 = diffs[pointer + 1][1]\n\n # First, shift the edit as far left as possible.\n commonOffset = self.diff_commonSuffix(equality1, edit)\n if commonOffset:\n commonString = edit[-commonOffset:]\n equality1 = equality1[:-commonOffset]\n edit = commonString + edit[:-commonOffset]\n equality2 = commonString + equality2\n\n # Second, step character by character right, looking for the best fit.\n bestEquality1 = equality1\n bestEdit = edit\n bestEquality2 = equality2\n bestScore = (diff_cleanupSemanticScore(equality1, edit) +\n diff_cleanupSemanticScore(edit, equality2))\n while edit and equality2 and edit[0] == equality2[0]:\n equality1 += edit[0]\n edit = edit[1:] + equality2[0]\n equality2 = equality2[1:]\n score = (diff_cleanupSemanticScore(equality1, edit) +\n diff_cleanupSemanticScore(edit, equality2))\n # The >= encourages trailing rather than leading whitespace on edits.\n if score >= bestScore:\n bestScore = score\n bestEquality1 = equality1\n bestEdit = edit\n bestEquality2 = equality2\n\n if diffs[pointer - 1][1] != bestEquality1:\n # We have an improvement, save it back to the diff.\n if bestEquality1:\n diffs[pointer - 1] = (diffs[pointer - 1][0], bestEquality1)\n else:\n del diffs[pointer - 1]\n pointer -= 1\n diffs[pointer] = (diffs[pointer][0], bestEdit)\n if bestEquality2:\n diffs[pointer + 1] = (diffs[pointer + 1][0], bestEquality2)\n else:\n del diffs[pointer + 1]\n pointer -= 1\n pointer += 1", "metadata": "root.diff_match_patch.diff_cleanupSemanticLossless", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 731 }, { "content": " def diff_cleanupEfficiency(self, diffs):\n \"\"\"Reduce the number of edits by eliminating operationally trivial\n equalities.\n\n Args:\n diffs: Array of diff tuples.\n \"\"\"\n changes = False\n equalities = [] # Stack of indices where equalities are found.\n lastequality = None # Always equal to diffs[equalities[-1]][1]\n pointer = 0 # Index of current position.\n pre_ins = False # Is there an insertion operation before the last equality.\n pre_del = False # Is there a deletion operation before the last equality.\n post_ins = False # Is there an insertion operation after the last equality.\n post_del = False # Is there a deletion operation after the last equality.\n while pointer < len(diffs):\n if diffs[pointer][0] == self.DIFF_EQUAL: # Equality found.\n if (len(diffs[pointer][1]) < self.Diff_EditCost and\n (post_ins or post_del)):\n # Candidate found.\n equalities.append(pointer)\n pre_ins = post_ins\n pre_del = post_del\n lastequality = diffs[pointer][1]\n else:\n # Not a candidate, and can never become one.\n equalities = []\n lastequality = None\n\n post_ins = post_del = False\n else: # An insertion or deletion.\n if diffs[pointer][0] == self.DIFF_DELETE:\n post_del = True\n else:\n post_ins = True\n\n # Five types to be split:\n # <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>\n # <ins>A</ins>X<ins>C</ins><del>D</del>\n # <ins>A</ins><del>B</del>X<ins>C</ins>\n # <ins>A</del>X<ins>C</ins><del>D</del>\n # <ins>A</ins><del>B</del>X<del>C</del>\n\n if lastequality and ((pre_ins and pre_del and post_ins and post_del) or\n ((len(lastequality) < self.Diff_EditCost / 2) and\n (pre_ins + pre_del + post_ins + post_del) == 3)):\n # Duplicate record.\n diffs.insert(equalities[-1], (self.DIFF_DELETE, lastequality))\n # Change second copy to insert.\n diffs[equalities[-1] + 1] = (self.DIFF_INSERT,\n diffs[equalities[-1] + 1][1])\n equalities.pop() # Throw away the equality we just deleted.\n lastequality = None\n if pre_ins and pre_del:\n # No changes made which could affect previous entry, keep going.\n post_ins = post_del = True\n equalities = []\n else:\n if len(equalities):\n equalities.pop() # Throw away the previous equality.\n if len(equalities):\n pointer = equalities[-1]\n else:\n pointer = -1\n post_ins = post_del = False\n changes = True\n pointer += 1\n\n if changes:\n self.diff_cleanupMerge(diffs)", "metadata": "root.diff_match_patch.diff_cleanupEfficiency", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 846 }, { "content": " def diff_cleanupMerge(self, diffs):\n \"\"\"Reorder and merge like edit sections. Merge equalities.\n Any edit section can move as long as it doesn't cross an equality.\n\n Args:\n diffs: Array of diff tuples.\n \"\"\"\n diffs.append((self.DIFF_EQUAL, '')) # Add a dummy entry at the end.\n pointer = 0\n count_delete = 0\n count_insert = 0\n text_delete = ''\n text_insert = ''\n while pointer < len(diffs):\n if diffs[pointer][0] == self.DIFF_INSERT:\n count_insert += 1\n text_insert += diffs[pointer][1]\n pointer += 1\n elif diffs[pointer][0] == self.DIFF_DELETE:\n count_delete += 1\n text_delete += diffs[pointer][1]\n pointer += 1\n elif diffs[pointer][0] == self.DIFF_EQUAL:\n # Upon reaching an equality, check for prior redundancies.\n if count_delete + count_insert > 1:\n if count_delete != 0 and count_insert != 0:\n # Factor out any common prefixies.\n commonlength = self.diff_commonPrefix(text_insert, text_delete)\n if commonlength != 0:\n x = pointer - count_delete - count_insert - 1\n if x >= 0 and diffs[x][0] == self.DIFF_EQUAL:\n diffs[x] = (diffs[x][0], diffs[x][1] +\n text_insert[:commonlength])\n else:\n diffs.insert(0, (self.DIFF_EQUAL, text_insert[:commonlength]))\n pointer += 1\n text_insert = text_insert[commonlength:]\n text_delete = text_delete[commonlength:]\n # Factor out any common suffixies.\n commonlength = self.diff_commonSuffix(text_insert, text_delete)\n if commonlength != 0:\n diffs[pointer] = (diffs[pointer][0], text_insert[-commonlength:] +\n diffs[pointer][1])\n text_insert = text_insert[:-commonlength]\n text_delete = text_delete[:-commonlength]\n # Delete the offending records and add the merged ones.\n if count_delete == 0:\n diffs[pointer - count_insert : pointer] = [\n (self.DIFF_INSERT, text_insert)]\n elif count_insert == 0:\n diffs[pointer - count_delete : pointer] = [\n (self.DIFF_DELETE, text_delete)]\n else:\n diffs[pointer - count_delete - count_insert : pointer] = [\n (self.DIFF_DELETE, text_delete),\n (self.DIFF_INSERT, text_insert)]\n pointer = pointer - count_delete - count_insert + 1\n if count_delete != 0:\n pointer += 1\n if count_insert != 0:\n pointer += 1\n elif pointer != 0 and diffs[pointer - 1][0] == self.DIFF_EQUAL:\n # Merge this equality with the previous one.\n diffs[pointer - 1] = (diffs[pointer - 1][0],\n diffs[pointer - 1][1] + diffs[pointer][1])\n del diffs[pointer]\n else:\n pointer += 1\n\n count_insert = 0\n count_delete = 0\n text_delete = ''\n text_insert = ''\n\n if diffs[-1][1] == '':\n diffs.pop() # Remove the dummy entry at the end.\n\n # Second pass: look for single edits surrounded on both sides by equalities\n # which can be shifted sideways to eliminate an equality.\n # e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC\n changes = False\n pointer = 1\n # Intentionally ignore the first and last element (don't need checking).\n while pointer < len(diffs) - 1:\n if (diffs[pointer - 1][0] == self.DIFF_EQUAL and\n diffs[pointer + 1][0] == self.DIFF_EQUAL):\n # This is a single edit surrounded by equalities.\n if diffs[pointer][1].endswith(diffs[pointer - 1][1]):\n # Shift the edit over the previous equality.\n diffs[pointer] = (diffs[pointer][0],\n diffs[pointer - 1][1] +\n diffs[pointer][1][:-len(diffs[pointer - 1][1])])\n diffs[pointer + 1] = (diffs[pointer + 1][0],\n diffs[pointer - 1][1] + diffs[pointer + 1][1])\n del diffs[pointer - 1]\n changes = True\n elif diffs[pointer][1].startswith(diffs[pointer + 1][1]):\n # Shift the edit over the next equality.\n diffs[pointer - 1] = (diffs[pointer - 1][0],\n diffs[pointer - 1][1] + diffs[pointer + 1][1])\n diffs[pointer] = (diffs[pointer][0],\n diffs[pointer][1][len(diffs[pointer + 1][1]):] +\n diffs[pointer + 1][1])\n del diffs[pointer + 1]\n changes = True\n pointer += 1\n\n # If shifts were made, the diff needs reordering and another shift sweep.\n if changes:\n self.diff_cleanupMerge(diffs)", "metadata": "root.diff_match_patch.diff_cleanupMerge", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 917 }, { "content": " def diff_xIndex(self, diffs, loc):\n \"\"\"loc is a location in text1, compute and return the equivalent location\n in text2. e.g. \"The cat\" vs \"The big cat\", 1->1, 5->8\n\n Args:\n diffs: Array of diff tuples.\n loc: Location within text1.\n\n Returns:\n Location within text2.\n \"\"\"\n chars1 = 0\n chars2 = 0\n last_chars1 = 0\n last_chars2 = 0\n for x in xrange(len(diffs)):\n (op, text) = diffs[x]\n if op != self.DIFF_INSERT: # Equality or deletion.\n chars1 += len(text)\n if op != self.DIFF_DELETE: # Equality or insertion.\n chars2 += len(text)\n if chars1 > loc: # Overshot the location.\n break\n last_chars1 = chars1\n last_chars2 = chars2\n\n if len(diffs) != x and diffs[x][0] == self.DIFF_DELETE:\n # The location was deleted.\n return last_chars2\n # Add the remaining len(character).\n return last_chars2 + (loc - last_chars1)", "metadata": "root.diff_match_patch.diff_xIndex", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1028 }, { "content": " def diff_prettyHtml(self, diffs):\n \"\"\"Convert a diff array into a pretty HTML report.\n\n Args:\n diffs: Array of diff tuples.\n\n Returns:\n HTML representation.\n \"\"\"\n html = []\n for (op, data) in diffs:\n text = (data.replace(\"&\", \"&amp;\").replace(\"<\", \"&lt;\")\n .replace(\">\", \"&gt;\").replace(\"\\n\", \"&para;<br>\"))\n if op == self.DIFF_INSERT:\n html.append(\"<ins style=\\\"background:#e6ffe6;\\\">%s</ins>\" % text)\n elif op == self.DIFF_DELETE:\n html.append(\"<del style=\\\"background:#ffe6e6;\\\">%s</del>\" % text)\n elif op == self.DIFF_EQUAL:\n html.append(\"<span>%s</span>\" % text)\n return \"\".join(html)", "metadata": "root.diff_match_patch.diff_prettyHtml", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1060 }, { "content": " def diff_text1(self, diffs):\n \"\"\"Compute and return the source text (all equalities and deletions).\n\n Args:\n diffs: Array of diff tuples.\n\n Returns:\n Source text.\n \"\"\"\n text = []\n for (op, data) in diffs:\n if op != self.DIFF_INSERT:\n text.append(data)\n return \"\".join(text)", "metadata": "root.diff_match_patch.diff_text1", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1081 }, { "content": " def diff_text2(self, diffs):\n \"\"\"Compute and return the destination text (all equalities and insertions).\n\n Args:\n diffs: Array of diff tuples.\n\n Returns:\n Destination text.\n \"\"\"\n text = []\n for (op, data) in diffs:\n if op != self.DIFF_DELETE:\n text.append(data)\n return \"\".join(text)", "metadata": "root.diff_match_patch.diff_text2", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1096 }, { "content": " def diff_levenshtein(self, diffs):\n \"\"\"Compute the Levenshtein distance; the number of inserted, deleted or\n substituted characters.\n\n Args:\n diffs: Array of diff tuples.\n\n Returns:\n Number of changes.\n \"\"\"\n levenshtein = 0\n insertions = 0\n deletions = 0\n for (op, data) in diffs:\n if op == self.DIFF_INSERT:\n insertions += len(data)\n elif op == self.DIFF_DELETE:\n deletions += len(data)\n elif op == self.DIFF_EQUAL:\n # A deletion and an insertion is one substitution.\n levenshtein += max(insertions, deletions)\n insertions = 0\n deletions = 0\n levenshtein += max(insertions, deletions)\n return levenshtein", "metadata": "root.diff_match_patch.diff_levenshtein", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1111 }, { "content": " def diff_toDelta(self, diffs):\n \"\"\"Crush the diff into an encoded string which describes the operations\n required to transform text1 into text2.\n E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n Operations are tab-separated. Inserted text is escaped using %xx notation.\n\n Args:\n diffs: Array of diff tuples.\n\n Returns:\n Delta text.\n \"\"\"\n text = []\n for (op, data) in diffs:\n if op == self.DIFF_INSERT:\n # High ascii will raise UnicodeDecodeError. Use Unicode instead.\n data = data.encode(\"utf-8\")\n text.append(\"+\" + urllib.quote(data, \"!~*'();/?:@&=+$,# \"))\n elif op == self.DIFF_DELETE:\n text.append(\"-%d\" % len(data))\n elif op == self.DIFF_EQUAL:\n text.append(\"=%d\" % len(data))\n return \"\\t\".join(text)", "metadata": "root.diff_match_patch.diff_toDelta", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1137 }, { "content": " def diff_fromDelta(self, text1, delta):\n \"\"\"Given the original text1, and an encoded string which describes the\n operations required to transform text1 into text2, compute the full diff.\n\n Args:\n text1: Source string for the diff.\n delta: Delta text.\n\n Returns:\n Array of diff tuples.\n\n Raises:\n ValueError: If invalid input.\n \"\"\"\n if type(delta) == unicode:\n # Deltas should be composed of a subset of ascii chars, Unicode not\n # required. If this encode raises UnicodeEncodeError, delta is invalid.\n delta = delta.encode(\"ascii\")\n diffs = []\n pointer = 0 # Cursor in text1\n tokens = delta.split(\"\\t\")\n for token in tokens:\n if token == \"\":\n # Blank tokens are ok (from a trailing \\t).\n continue\n # Each token begins with a one character parameter which specifies the\n # operation of this token (delete, insert, equality).\n param = token[1:]\n if token[0] == \"+\":\n param = urllib.unquote(param).decode(\"utf-8\")\n diffs.append((self.DIFF_INSERT, param))\n elif token[0] == \"-\" or token[0] == \"=\":\n try:\n n = int(param)\n except ValueError:\n raise ValueError(\"Invalid number in diff_fromDelta: \" + param)\n if n < 0:\n raise ValueError(\"Negative number in diff_fromDelta: \" + param)\n text = text1[pointer : pointer + n]\n pointer += n\n if token[0] == \"=\":\n diffs.append((self.DIFF_EQUAL, text))\n else:\n diffs.append((self.DIFF_DELETE, text))\n else:\n # Anything else is an error.\n raise ValueError(\"Invalid diff operation in diff_fromDelta: \" +\n token[0])\n if pointer != len(text1):\n raise ValueError(\n \"Delta length (%d) does not equal source text length (%d).\" %\n (pointer, len(text1)))\n return diffs", "metadata": "root.diff_match_patch.diff_fromDelta", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1161 }, { "content": " def match_main(self, text, pattern, loc):\n \"\"\"Locate the best instance of 'pattern' in 'text' near 'loc'.\n\n Args:\n text: The text to search.\n pattern: The pattern to search for.\n loc: The location to search around.\n\n Returns:\n Best match index or -1.\n \"\"\"\n # Check for null inputs.\n if text == None or pattern == None:\n raise ValueError(\"Null inputs. (match_main)\")\n\n loc = max(0, min(loc, len(text)))\n if text == pattern:\n # Shortcut (potentially not guaranteed by the algorithm)\n return 0\n elif not text:\n # Nothing to match.\n return -1\n elif text[loc:loc + len(pattern)] == pattern:\n # Perfect match at the perfect spot! (Includes case of null pattern)\n return loc\n else:\n # Do a fuzzy compare.\n match = self.match_bitap(text, pattern, loc)\n return match", "metadata": "root.diff_match_patch.match_main", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1217 }, { "content": " def match_bitap(self, text, pattern, loc):\n \"\"\"Locate the best instance of 'pattern' in 'text' near 'loc' using the\n Bitap algorithm.\n\n Args:\n text: The text to search.\n pattern: The pattern to search for.\n loc: The location to search around.\n\n Returns:\n Best match index or -1.\n \"\"\"\n # Python doesn't have a maxint limit, so ignore this check.\n #if self.Match_MaxBits != 0 and len(pattern) > self.Match_MaxBits:\n # raise ValueError(\"Pattern too long for this application.\")\n\n # Initialise the alphabet.\n s = self.match_alphabet(pattern)\n\n def match_bitapScore(e, x):\n \"\"\"Compute and return the score for a match with e errors and x location.\n Accesses loc and pattern through being a closure.\n\n Args:\n e: Number of errors in match.\n x: Location of match.\n\n Returns:\n Overall score for match (0.0 = good, 1.0 = bad).\n \"\"\"\n accuracy = float(e) / len(pattern)\n proximity = abs(loc - x)\n if not self.Match_Distance:\n # Dodge divide by zero error.\n return proximity and 1.0 or accuracy\n return accuracy + (proximity / float(self.Match_Distance))\n\n # Highest score beyond which we give up.\n score_threshold = self.Match_Threshold\n # Is there a nearby exact match? (speedup)\n best_loc = text.find(pattern, loc)\n if best_loc != -1:\n score_threshold = min(match_bitapScore(0, best_loc), score_threshold)\n # What about in the other direction? (speedup)\n best_loc = text.rfind(pattern, loc + len(pattern))\n if best_loc != -1:\n score_threshold = min(match_bitapScore(0, best_loc), score_threshold)\n\n # Initialise the bit arrays.\n matchmask = 1 << (len(pattern) - 1)\n best_loc = -1\n\n bin_max = len(pattern) + len(text)\n # Empty initialization added to appease pychecker.\n last_rd = None\n for d in xrange(len(pattern)):\n # Scan for the best match each iteration allows for one more error.\n # Run a binary search to determine how far from 'loc' we can stray at\n # this error level.\n bin_min = 0\n bin_mid = bin_max\n while bin_min < bin_mid:\n if match_bitapScore(d, loc + bin_mid) <= score_threshold:\n bin_min = bin_mid\n else:\n bin_max = bin_mid\n bin_mid = (bin_max - bin_min) // 2 + bin_min\n\n # Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid\n start = max(1, loc - bin_mid + 1)\n finish = min(loc + bin_mid, len(text)) + len(pattern)\n\n rd = [0] * (finish + 2)\n rd[finish + 1] = (1 << d) - 1\n for j in xrange(finish, start - 1, -1):\n if len(text) <= j - 1:\n # Out of range.\n charMatch = 0\n else:\n charMatch = s.get(text[j - 1], 0)\n if d == 0: # First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch\n else: # Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | (\n ((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1]\n if rd[j] & matchmask:\n score = match_bitapScore(d, j - 1)\n # This match will almost certainly be better than any existing match.\n # But check anyway.\n if score <= score_threshold:\n # Told you so.\n score_threshold = score\n best_loc = j - 1\n if best_loc > loc:\n # When passing loc, don't exceed our current distance from loc.\n start = max(1, 2 * loc - best_loc)\n else:\n # Already passed loc, downhill from here on in.\n break\n # No hope for a (better) match at greater error levels.\n if match_bitapScore(d + 1, loc) > score_threshold:\n break\n last_rd = rd\n return best_loc", "metadata": "root.diff_match_patch.match_bitap", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1247 }, { "content": " def match_alphabet(self, pattern):\n \"\"\"Initialise the alphabet for the Bitap algorithm.\n\n Args:\n pattern: The text to encode.\n\n Returns:\n Hash of character locations.\n \"\"\"\n s = {}\n for char in pattern:\n s[char] = 0\n for i in xrange(len(pattern)):\n s[pattern[i]] |= 1 << (len(pattern) - i - 1)\n return s", "metadata": "root.diff_match_patch.match_alphabet", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1353 }, { "content": " def patch_addContext(self, patch, text):\n \"\"\"Increase the context until it is unique,\n but don't let the pattern expand beyond Match_MaxBits.\n\n Args:\n patch: The patch to grow.\n text: Source text.\n \"\"\"\n if len(text) == 0:\n return\n pattern = text[patch.start2 : patch.start2 + patch.length1]\n padding = 0\n\n # Look for the first and last matches of pattern in text. If two different\n # matches are found, increase the pattern length.\n while (text.find(pattern) != text.rfind(pattern) and (self.Match_MaxBits ==\n 0 or len(pattern) < self.Match_MaxBits - self.Patch_Margin -\n self.Patch_Margin)):\n padding += self.Patch_Margin\n pattern = text[max(0, patch.start2 - padding) :\n patch.start2 + patch.length1 + padding]\n # Add one chunk for good luck.\n padding += self.Patch_Margin\n\n # Add the prefix.\n prefix = text[max(0, patch.start2 - padding) : patch.start2]\n if prefix:\n patch.diffs[:0] = [(self.DIFF_EQUAL, prefix)]\n # Add the suffix.\n suffix = text[patch.start2 + patch.length1 :\n patch.start2 + patch.length1 + padding]\n if suffix:\n patch.diffs.append((self.DIFF_EQUAL, suffix))\n\n # Roll back the start points.\n patch.start1 -= len(prefix)\n patch.start2 -= len(prefix)\n # Extend lengths.\n patch.length1 += len(prefix) + len(suffix)\n patch.length2 += len(prefix) + len(suffix)", "metadata": "root.diff_match_patch.patch_addContext", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1371 }, { "content": " def patch_make(self, a, b=None, c=None):\n \"\"\"Compute a list of patches to turn text1 into text2.\n Use diffs if provided, otherwise compute it ourselves.\n There are four ways to call this function, depending on what data is\n available to the caller:\n Method 1:\n a = text1, b = text2\n Method 2:\n a = diffs\n Method 3 (optimal):\n a = text1, b = diffs\n Method 4 (deprecated, use method 3):\n a = text1, b = text2, c = diffs\n\n Args:\n a: text1 (methods 1,3,4) or Array of diff tuples for text1 to\n text2 (method 2).\n b: text2 (methods 1,4) or Array of diff tuples for text1 to\n text2 (method 3) or undefined (method 2).\n c: Array of diff tuples for text1 to text2 (method 4) or\n undefined (methods 1,2,3).\n\n Returns:\n Array of Patch objects.\n \"\"\"\n text1 = None\n diffs = None\n # Note that texts may arrive as 'str' or 'unicode'.\n if isinstance(a, basestring) and isinstance(b, basestring) and c is None:\n # Method 1: text1, text2\n # Compute diffs from text1 and text2.\n text1 = a\n diffs = self.diff_main(text1, b, True)\n if len(diffs) > 2:\n self.diff_cleanupSemantic(diffs)\n self.diff_cleanupEfficiency(diffs)\n elif isinstance(a, list) and b is None and c is None:\n # Method 2: diffs\n # Compute text1 from diffs.\n diffs = a\n text1 = self.diff_text1(diffs)\n elif isinstance(a, basestring) and isinstance(b, list) and c is None:\n # Method 3: text1, diffs\n text1 = a\n diffs = b\n elif (isinstance(a, basestring) and isinstance(b, basestring) and\n isinstance(c, list)):\n # Method 4: text1, text2, diffs\n # text2 is not used.\n text1 = a\n diffs = c\n else:\n raise ValueError(\"Unknown call format to patch_make.\")\n\n if not diffs:\n return [] # Get rid of the None case.\n patches = []\n patch = patch_obj()\n char_count1 = 0 # Number of characters into the text1 string.\n char_count2 = 0 # Number of characters into the text2 string.\n prepatch_text = text1 # Recreate the patches to determine context info.\n postpatch_text = text1\n for x in xrange(len(diffs)):\n (diff_type, diff_text) = diffs[x]\n if len(patch.diffs) == 0 and diff_type != self.DIFF_EQUAL:\n # A new patch starts here.\n patch.start1 = char_count1\n patch.start2 = char_count2\n if diff_type == self.DIFF_INSERT:\n # Insertion\n patch.diffs.append(diffs[x])\n patch.length2 += len(diff_text)\n postpatch_text = (postpatch_text[:char_count2] + diff_text +\n postpatch_text[char_count2:])\n elif diff_type == self.DIFF_DELETE:\n # Deletion.\n patch.length1 += len(diff_text)\n patch.diffs.append(diffs[x])\n postpatch_text = (postpatch_text[:char_count2] +\n postpatch_text[char_count2 + len(diff_text):])\n elif (diff_type == self.DIFF_EQUAL and\n len(diff_text) <= 2 * self.Patch_Margin and\n len(patch.diffs) != 0 and len(diffs) != x + 1):\n # Small equality inside a patch.\n patch.diffs.append(diffs[x])\n patch.length1 += len(diff_text)\n patch.length2 += len(diff_text)\n\n if (diff_type == self.DIFF_EQUAL and\n len(diff_text) >= 2 * self.Patch_Margin):\n # Time for a new patch.\n if len(patch.diffs) != 0:\n self.patch_addContext(patch, prepatch_text)\n patches.append(patch)\n patch = patch_obj()\n # Unlike Unidiff, our patch lists have a rolling context.\n # http://code.google.com/p/google-diff-match-patch/wiki/Unidiff\n # Update prepatch text & pos to reflect the application of the\n # just completed patch.\n prepatch_text = postpatch_text\n char_count1 = char_count2\n\n # Update the current character count.\n if diff_type != self.DIFF_INSERT:\n char_count1 += len(diff_text)\n if diff_type != self.DIFF_DELETE:\n char_count2 += len(diff_text)\n\n # Pick up the leftover patch if not empty.\n if len(patch.diffs) != 0:\n self.patch_addContext(patch, prepatch_text)\n patches.append(patch)\n return patches", "metadata": "root.diff_match_patch.patch_make", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1412 }, { "content": " def patch_deepCopy(self, patches):\n \"\"\"Given an array of patches, return another array that is identical.\n\n Args:\n patches: Array of Patch objects.\n\n Returns:\n Array of Patch objects.\n \"\"\"\n patchesCopy = []\n for patch in patches:\n patchCopy = patch_obj()\n # No need to deep copy the tuples since they are immutable.\n patchCopy.diffs = patch.diffs[:]\n patchCopy.start1 = patch.start1\n patchCopy.start2 = patch.start2\n patchCopy.length1 = patch.length1\n patchCopy.length2 = patch.length2\n patchesCopy.append(patchCopy)\n return patchesCopy", "metadata": "root.diff_match_patch.patch_deepCopy", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1526 }, { "content": " def patch_apply(self, patches, text):\n \"\"\"Merge a set of patches onto the text. Return a patched text, as well\n as a list of true/false values indicating which patches were applied.\n\n Args:\n patches: Array of Patch objects.\n text: Old text.\n\n Returns:\n Two element Array, containing the new text and an array of boolean values.\n \"\"\"\n if not patches:\n return (text, [])\n\n # Deep copy the patches so that no changes are made to originals.\n patches = self.patch_deepCopy(patches)\n\n nullPadding = self.patch_addPadding(patches)\n text = nullPadding + text + nullPadding\n self.patch_splitMax(patches)\n\n # delta keeps track of the offset between the expected and actual location\n # of the previous patch. If there are patches expected at positions 10 and\n # 20, but the first patch was found at 12, delta is 2 and the second patch\n # has an effective expected position of 22.\n delta = 0\n results = []\n for patch in patches:\n expected_loc = patch.start2 + delta\n text1 = self.diff_text1(patch.diffs)\n end_loc = -1\n if len(text1) > self.Match_MaxBits:\n # patch_splitMax will only provide an oversized pattern in the case of\n # a monster delete.\n start_loc = self.match_main(text, text1[:self.Match_MaxBits],\n expected_loc)\n if start_loc != -1:\n end_loc = self.match_main(text, text1[-self.Match_MaxBits:],\n expected_loc + len(text1) - self.Match_MaxBits)\n if end_loc == -1 or start_loc >= end_loc:\n # Can't find valid trailing context. Drop this patch.\n start_loc = -1\n else:\n start_loc = self.match_main(text, text1, expected_loc)\n if start_loc == -1:\n # No match found. :(\n results.append(False)\n # Subtract the delta for this failed patch from subsequent patches.\n delta -= patch.length2 - patch.length1\n else:\n # Found a match. :)\n results.append(True)\n delta = start_loc - expected_loc\n if end_loc == -1:\n text2 = text[start_loc : start_loc + len(text1)]\n else:\n text2 = text[start_loc : end_loc + self.Match_MaxBits]\n if text1 == text2:\n # Perfect match, just shove the replacement text in.\n text = (text[:start_loc] + self.diff_text2(patch.diffs) +\n text[start_loc + len(text1):])\n else:\n # Imperfect match.\n # Run a diff to get a framework of equivalent indices.\n diffs = self.diff_main(text1, text2, False)\n if (len(text1) > self.Match_MaxBits and\n self.diff_levenshtein(diffs) / float(len(text1)) >\n self.Patch_DeleteThreshold):\n # The end points match, but the content is unacceptably bad.\n results[-1] = False\n else:\n self.diff_cleanupSemanticLossless(diffs)\n index1 = 0\n for (op, data) in patch.diffs:\n if op != self.DIFF_EQUAL:\n index2 = self.diff_xIndex(diffs, index1)\n if op == self.DIFF_INSERT: # Insertion\n text = text[:start_loc + index2] + data + text[start_loc +\n index2:]\n elif op == self.DIFF_DELETE: # Deletion\n text = text[:start_loc + index2] + text[start_loc +\n self.diff_xIndex(diffs, index1 + len(data)):]\n if op != self.DIFF_DELETE:\n index1 += len(data)\n # Strip the padding off.\n text = text[len(nullPadding):-len(nullPadding)]\n return (text, results)", "metadata": "root.diff_match_patch.patch_apply", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1547 }, { "content": " def patch_addPadding(self, patches):\n \"\"\"Add some padding on text start and end so that edges can match\n something. Intended to be called only from within patch_apply.\n\n Args:\n patches: Array of Patch objects.\n\n Returns:\n The padding string added to each side.\n \"\"\"\n paddingLength = self.Patch_Margin\n nullPadding = \"\"\n for x in xrange(1, paddingLength + 1):\n nullPadding += chr(x)\n\n # Bump all the patches forward.\n for patch in patches:\n patch.start1 += paddingLength\n patch.start2 += paddingLength\n\n # Add some padding on start of first diff.\n patch = patches[0]\n diffs = patch.diffs\n if not diffs or diffs[0][0] != self.DIFF_EQUAL:\n # Add nullPadding equality.\n diffs.insert(0, (self.DIFF_EQUAL, nullPadding))\n patch.start1 -= paddingLength # Should be 0.\n patch.start2 -= paddingLength # Should be 0.\n patch.length1 += paddingLength\n patch.length2 += paddingLength\n elif paddingLength > len(diffs[0][1]):\n # Grow first equality.\n extraLength = paddingLength - len(diffs[0][1])\n newText = nullPadding[len(diffs[0][1]):] + diffs[0][1]\n diffs[0] = (diffs[0][0], newText)\n patch.start1 -= extraLength\n patch.start2 -= extraLength\n patch.length1 += extraLength\n patch.length2 += extraLength\n\n # Add some padding on end of last diff.\n patch = patches[-1]\n diffs = patch.diffs\n if not diffs or diffs[-1][0] != self.DIFF_EQUAL:\n # Add nullPadding equality.\n diffs.append((self.DIFF_EQUAL, nullPadding))\n patch.length1 += paddingLength\n patch.length2 += paddingLength\n elif paddingLength > len(diffs[-1][1]):\n # Grow last equality.\n extraLength = paddingLength - len(diffs[-1][1])\n newText = diffs[-1][1] + nullPadding[:extraLength]\n diffs[-1] = (diffs[-1][0], newText)\n patch.length1 += extraLength\n patch.length2 += extraLength\n\n return nullPadding", "metadata": "root.diff_match_patch.patch_addPadding", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1635 }, { "content": " def patch_splitMax(self, patches):\n \"\"\"Look through the patches and break up any which are longer than the\n maximum limit of the match algorithm.\n Intended to be called only from within patch_apply.\n\n Args:\n patches: Array of Patch objects.\n \"\"\"\n patch_size = self.Match_MaxBits\n if patch_size == 0:\n # Python has the option of not splitting strings due to its ability\n # to handle integers of arbitrary precision.\n return\n for x in xrange(len(patches)):\n if patches[x].length1 <= patch_size:\n continue\n bigpatch = patches[x]\n # Remove the big old patch.\n del patches[x]\n x -= 1\n start1 = bigpatch.start1\n start2 = bigpatch.start2\n precontext = ''\n while len(bigpatch.diffs) != 0:\n # Create one of several smaller patches.\n patch = patch_obj()\n empty = True\n patch.start1 = start1 - len(precontext)\n patch.start2 = start2 - len(precontext)\n if precontext:\n patch.length1 = patch.length2 = len(precontext)\n patch.diffs.append((self.DIFF_EQUAL, precontext))\n\n while (len(bigpatch.diffs) != 0 and\n patch.length1 < patch_size - self.Patch_Margin):\n (diff_type, diff_text) = bigpatch.diffs[0]\n if diff_type == self.DIFF_INSERT:\n # Insertions are harmless.\n patch.length2 += len(diff_text)\n start2 += len(diff_text)\n patch.diffs.append(bigpatch.diffs.pop(0))\n empty = False\n elif (diff_type == self.DIFF_DELETE and len(patch.diffs) == 1 and\n patch.diffs[0][0] == self.DIFF_EQUAL and\n len(diff_text) > 2 * patch_size):\n # This is a large deletion. Let it pass in one chunk.\n patch.length1 += len(diff_text)\n start1 += len(diff_text)\n empty = False\n patch.diffs.append((diff_type, diff_text))\n del bigpatch.diffs[0]\n else:\n # Deletion or equality. Only take as much as we can stomach.\n diff_text = diff_text[:patch_size - patch.length1 -\n self.Patch_Margin]\n patch.length1 += len(diff_text)\n start1 += len(diff_text)\n if diff_type == self.DIFF_EQUAL:\n patch.length2 += len(diff_text)\n start2 += len(diff_text)\n else:\n empty = False\n\n patch.diffs.append((diff_type, diff_text))\n if diff_text == bigpatch.diffs[0][1]:\n del bigpatch.diffs[0]\n else:\n bigpatch.diffs[0] = (bigpatch.diffs[0][0],\n bigpatch.diffs[0][1][len(diff_text):])\n\n # Compute the head context for the next patch.\n precontext = self.diff_text2(patch.diffs)\n precontext = precontext[-self.Patch_Margin:]\n # Append the end context for this patch.\n postcontext = self.diff_text1(bigpatch.diffs)[:self.Patch_Margin]\n if postcontext:\n patch.length1 += len(postcontext)\n patch.length2 += len(postcontext)\n if len(patch.diffs) != 0 and patch.diffs[-1][0] == self.DIFF_EQUAL:\n patch.diffs[-1] = (self.DIFF_EQUAL, patch.diffs[-1][1] +\n postcontext)\n else:\n patch.diffs.append((self.DIFF_EQUAL, postcontext))\n\n if not empty:\n x += 1\n patches.insert(x, patch)", "metadata": "root.diff_match_patch.patch_splitMax", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1693 }, { "content": " def patch_toText(self, patches):\n \"\"\"Take a list of patches and return a textual representation.\n\n Args:\n patches: Array of Patch objects.\n\n Returns:\n Text representation of patches.\n \"\"\"\n text = []\n for patch in patches:\n text.append(str(patch))\n return \"\".join(text)", "metadata": "root.diff_match_patch.patch_toText", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1781 }, { "content": " def patch_fromText(self, textline):\n \"\"\"Parse a textual representation of patches and return a list of patch\n objects.\n\n Args:\n textline: Text representation of patches.\n\n Returns:\n Array of Patch objects.\n\n Raises:\n ValueError: If invalid input.\n \"\"\"\n if type(textline) == unicode:\n # Patches should be composed of a subset of ascii chars, Unicode not\n # required. If this encode raises UnicodeEncodeError, patch is invalid.\n textline = textline.encode(\"ascii\")\n patches = []\n if not textline:\n return patches\n text = textline.split('\\n')\n while len(text) != 0:\n m = re.match(\"^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$\", text[0])\n if not m:\n raise ValueError(\"Invalid patch string: \" + text[0])\n patch = patch_obj()\n patches.append(patch)\n patch.start1 = int(m.group(1))\n if m.group(2) == '':\n patch.start1 -= 1\n patch.length1 = 1\n elif m.group(2) == '0':\n patch.length1 = 0\n else:\n patch.start1 -= 1\n patch.length1 = int(m.group(2))\n\n patch.start2 = int(m.group(3))\n if m.group(4) == '':\n patch.start2 -= 1\n patch.length2 = 1\n elif m.group(4) == '0':\n patch.length2 = 0\n else:\n patch.start2 -= 1\n patch.length2 = int(m.group(4))\n\n del text[0]\n\n while len(text) != 0:\n if text[0]:\n sign = text[0][0]\n else:\n sign = ''\n line = urllib.unquote(text[0][1:])\n line = line.decode(\"utf-8\")\n if sign == '+':\n # Insertion.\n patch.diffs.append((self.DIFF_INSERT, line))\n elif sign == '-':\n # Deletion.\n patch.diffs.append((self.DIFF_DELETE, line))\n elif sign == ' ':\n # Minor equality.\n patch.diffs.append((self.DIFF_EQUAL, line))\n elif sign == '@':\n # Start of next patch.\n break\n elif sign == '':\n # Blank line? Whatever.\n pass\n else:\n # WTF?\n raise ValueError(\"Invalid patch mode: '%s'\\n%s\" % (sign, line))\n del text[0]\n return patches", "metadata": "root.diff_match_patch.patch_fromText", "header": "['class', 'diff_match_patch', ':', '___EOS___']", "index": 1795 }, { "content": "class patch_obj:\n \"\"\"Class representing one patch operation.\n \"\"\"\n\n", "metadata": "root.patch_obj", "header": "['module', '___EOS___']", "index": 1873 }, { "content": " def __init__(self):\n \"\"\"Initializes with an empty list of diffs.\n \"\"\"\n self.diffs = []\n self.start1 = None\n self.start2 = None\n self.length1 = 0\n self.length2 = 0", "metadata": "root.patch_obj.__init__", "header": "['class', 'patch_obj', ':', '___EOS___']", "index": 1877 }, { "content": " def __str__(self):\n \"\"\"Emmulate GNU diff's format.\n Header: @@ -382,8 +481,9 @@\n Indicies are printed as 1-based, not 0-based.\n\n Returns:\n The GNU diff string.\n \"\"\"\n if self.length1 == 0:\n coords1 = str(self.start1) + \",0\"\n elif self.length1 == 1:\n coords1 = str(self.start1 + 1)\n else:\n coords1 = str(self.start1 + 1) + \",\" + str(self.length1)\n if self.length2 == 0:\n coords2 = str(self.start2) + \",0\"\n elif self.length2 == 1:\n coords2 = str(self.start2 + 1)\n else:\n coords2 = str(self.start2 + 1) + \",\" + str(self.length2)\n text = [\"@@ -\", coords1, \" +\", coords2, \" @@\\n\"]\n # Escape the body of the patch with %xx notation.\n for (op, data) in self.diffs:\n if op == diff_match_patch.DIFF_INSERT:\n text.append(\"+\")\n elif op == diff_match_patch.DIFF_DELETE:\n text.append(\"-\")\n elif op == diff_match_patch.DIFF_EQUAL:\n text.append(\" \")\n # High ascii will raise UnicodeDecodeError. Use Unicode instead.\n data = data.encode(\"utf-8\")\n text.append(urllib.quote(data, \"!~*'();/?:@&=+$,# \") + \"\\n\")\n return \"\".join(text)", "metadata": "root.patch_obj.__str__", "header": "['class', 'patch_obj', ':', '___EOS___']", "index": 1886 } ]
[ { "span": "import math", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python", "2.4", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Diff", " ", "Match", " ", "and", " ", "Pat", "ch", "\\", "10", ";", "\\", "10", ";", "Copy", "right", " ", "2006", " ", "Goo", "gle", " ", "Inc", ".", "\\", "10", ";", "http", "://", "code", ".", "google", ".", "com", "/", "p", "/", "google", "-", "diff", "-", "match", "-", "patch", "/", "\\", "10", ";", "\\", "10", ";", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "\\", "10", ";", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", "\\", "10", ";", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at", "\\", "10", ";", "\\", "10", ";", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "\\", "10", ";", "\\", "10", ";", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "\\", "10", ";", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", "\\", "10", ";", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", "\\", "10", ";", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Function", "s", " ", "for", " ", "diff", ",", " ", "match", " ", "and", " ", "patch", ".", "\\", "10", ";", "\\", "10", ";", "Compute", "s", " ", "the", " ", "difference", " ", "bet", "ween", " ", "two", " ", "texts", " ", "to", " ", "create", " ", "a", " ", "patch", ".", "\\", "10", ";", "Appl", "ies", " ", "the", " ", "patch", " ", "onto", " ", "anot", "her", " ", "text", ",", " ", "allow", "ing", " ", "for", " ", "error", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "fra", "ser", "@", "google", ".", "com", " ", "(", "Nei", "l", " ", "Fra", "ser", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Class", " ", "contain", "ing", " ", "the", " ", "diff", ",", " ", "match", " ", "and", " ", "patch", " ", "method", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Al", "so", " ", "contain", "s", " ", "the", " ", "behaviour", " ", "settings", ".", "\\", "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_", "#", " ", " ", "DIFF", " ", "FUNCTIONS", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "data", " ", "structure", " ", "represent", "ing", " ", "a", " ", "diff", " ", "is", " ", "an", " ", "array", " ", "of", " ", "tuple", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[(", "DIFF", "\\u", "DELET", "E", ",", " ", "\"", "Hell", "o", "\")", ",", " ", "(", "DIFF", "\\u", "INSERT", ",", " ", "\"", "Good", "bye", "\")", ",", " ", "(", "DIFF", "\\u", "EQUAL", ",", " ", "\"", " ", "world", ".\"", ")]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "means", ":", " ", "delete", " ", "\"", "Hell", "o", "\",", " ", "add", " ", "\"", "Good", "bye", "\"", " ", "and", " ", "keep", " ", "\"", " ", "world", ".\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DIFF", "\\u", "DELETE_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DIFF", "\\u", "INSERT", "_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DIFF", "\\u", "EQUAL", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Define", " ", "some", " ", "regex", " ", "pattern", "s", " ", "for", " ", "matchi", "ng", " ", "bound", "aries", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "BLANK", "LINE", "END_", "=_", "re_", "._", "compile_", "(_", "r", "\"\\\\", "n", "\\\\", "r", "?\\\\", "n", "$\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "BLANK", "LINES", "TAR", "T_", "=_", "re_", "._", "compile_", "(_", "r", "\"", "^", "\\\\", "r", "?\\\\", "n", "\\\\", "r", "?\\\\", "n", "\"_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "MATCH", " ", "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_", "#", " ", " ", "PATCH", " ", "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_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Ini", "ts", " ", "a", " ", "diff", "\\u", "match", "\\u", "patch", " ", "object", " ", "with", " ", "default", " ", "settings", ".", "\\", "10", ";", " ", " ", " ", " ", "Red", "efin", "e", " ", "these", " ", "in", " ", "your", " ", "program", " ", "to", " ", "override", " ", "the", " ", "default", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Number", " ", "of", " ", "second", "s", " ", "to", " ", "map", " ", "a", " ", "diff", " ", "bef", "ore", " ", "gi", "ving", " ", "up", " ", "(", "0", " ", "for", " ", "infinity", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Diff", "\\u", "Timeout_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cost", " ", "of", " ", "an", " ", "empty", " ", "edit", " ", "operati", "on", " ", "in", " ", "term", "s", " ", "of", " ", "edit", " ", "character", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Diff", "\\u", "Edit", "Cost_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "At", " ", "what", " ", "point", " ", "is", " ", "no", " ", "match", " ", "declared", " ", "(", "0.", "0", " ", "=", " ", "perfect", "ion", ",", " ", "1.0", " ", "=", " ", "very", " ", "loose", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Match", "\\u", "Threshold_", "=_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ho", "w", " ", "far", " ", "to", " ", "search", " ", "for", " ", "a", " ", "match", " ", "(", "0", " ", "=", " ", "exact", " ", "location", ",", " ", "1000", "+", " ", "=", " ", "broad", " ", "match", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "match", " ", "this", " ", "many", " ", "character", "s", " ", "awa", "y", " ", "from", " ", "the", " ", "expected", " ", "location", " ", "will", " ", "add_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1.0", " ", "to", " ", "the", " ", "score", " ", "(", "0.", "0", " ", "is", " ", "a", " ", "perfect", " ", "match", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Match", "\\u", "Distance_", "=_", "1000_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "n", " ", "delet", "ing", " ", "a", " ", "large", " ", "block", " ", "of", " ", "text", " ", "(", "over", " ", "~", "64", " ", "character", "s", "),", " ", "how", " ", "close", " ", "do_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "content", "s", " ", "have", " ", "to", " ", "be", " ", "to", " ", "match", " ", "the", " ", "expected", " ", "content", "s", ".", " ", "(", "0.", "0", " ", "=", " ", "perfect", "ion", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1.0", " ", "=", " ", "very", " ", "loose", ").", " ", " ", "Not", "e", " ", "tha", "t", " ", "Match", "\\u", "Thresh", "old", " ", "controls", " ", "how", " ", "close", "ly", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "end", " ", "points", " ", "of", " ", "a", " ", "delete", " ", "need", " ", "to", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Pat", "ch", "\\u", "Delete", "Threshold_", "=_", "0.5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Chunk", " ", "size", " ", "for", " ", "context", " ", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "=_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "number", " ", "of", " ", "bits", " ", "in", " ", "an", " ", "int", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "has", " ", "no", " ", "maxim", "um", ",", " ", "thu", "s", " ", "to", " ", "disable", " ", "patch", " ", "splitting", " ", "set", " ", "to", " ", "0._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ho", "we", "ver", " ", "to", " ", "avoid", " ", "long", " ", "patche", "s", " ", "in", " ", "cert", "ain", " ", "patho", "logical", " ", "case", "s", ",", " ", "use", " ", "32.", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Multipl", "e", " ", "short", " ", "patche", "s", " ", "(", "usi", "ng", " ", "nativ", "e", " ", "ints", ")", " ", "are", " ", "muc", "h", " ", "faste", "r", " ", "than", " ", "long", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Match", "\\u", "Max", "Bits_", "=_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "diff", "\\u", "main_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "check", "lines_", "=_", "True_", ",_", "deadline_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "the", " ", "difference", "s", " ", "bet", "ween", " ", "two", " ", "texts", ".", " ", " ", "Simplif", "ies", " ", "the", " ", "problem", " ", "by", "\\", "10", ";", " ", " ", "strip", "ping", " ", "any", " ", "common", " ", "prefix", " ", "or", " ", "suff", "ix", " ", "off", " ", "the", " ", "texts", " ", "bef", "ore", " ", "diff", "ing", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "check", "lines", ":", " ", "Optio", "nal", " ", "speed", "up", " ", "flag", ".", " ", " ", "If", " ", "presen", "t", " ", "and", " ", "fal", "se", ",", " ", "then", " ", "don", "'", "t", " ", "run", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "line", "-", "level", " ", "diff", " ", "first", " ", "to", " ", "identify", " ", "the", " ", "change", "d", " ", "area", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Default", "s", " ", "to", " ", "true", ",", " ", "whi", "ch", " ", "doe", "s", " ", "a", " ", "faste", "r", ",", " ", "slight", "ly", " ", "less", " ", "optim", "al", " ", "diff", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Optio", "nal", " ", "time", " ", "whe", "n", " ", "the", " ", "diff", " ", "shou", "ld", " ", "be", " ", "complete", " ", "by", ".", " ", " ", "Us", "ed", "\\", "10", ";", " ", " ", " ", " ", "internal", "ly", " ", "for", " ", "recurs", "ive", " ", "calls", ".", " ", " ", "User", "s", " ", "shou", "ld", " ", "set", " ", "Diff", "Time", "out", " ", "inst", "ead", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Set", " ", "a", " ", "deadl", "ine", " ", "by", " ", "whi", "ch", " ", "time", " ", "the", " ", "diff", " ", "must", " ", "be", " ", "complete", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "deadline_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unli", "ke", " ", "in", " ", "most", " ", "language", "s", ",", " ", "Pyth", "on", " ", "count", "s", " ", "time", " ", "in", " ", "second", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "Diff", "\\u", "Timeout_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deadline_", "=_", "sys_", "._", "maxint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deadline_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "self_", "._", "Diff", "\\u", "Timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "null", " ", "inputs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "_", "==_", "None_", "or_", "text2_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Null", " ", "inputs", ".", " ", "(", "diff", "\\u", "main", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "equality", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "_", "==_", "text2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text1", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "text1", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Trim", " ", "off", " ", "common", " ", "prefix", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Prefix_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "common", "prefix_", "=_", "text1", "_", "[_", ":_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "text1", "_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text2_", "=_", "text2_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Trim", " ", "off", " ", "common", " ", "suff", "ix", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Suffix_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common", "length_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "suffix_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "suffix_", "=_", "text1", "_", "[_", "-_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "text1", "_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text2_", "=_", "text2_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "the", " ", "diff", " ", "on", " ", "the", " ", "middle", " ", "block", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "=_", "self_", "._", "diff", "\\u", "compute_", "(_", "text1", "_", ",_", "text2_", ",_", "check", "lines_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Restor", "e", " ", "the", " ", "prefix", " ", "and", " ", "suff", "ix", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "common", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", ":_", "0_", "]_", "=_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "common", "prefix_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "common", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "common", "suffix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "diff", "\\u", "clean", "up", "Merge_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "compute_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "check", "lines_", ",_", "deadline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "the", " ", "difference", "s", " ", "bet", "ween", " ", "two", " ", "texts", ".", " ", " ", "Assume", "s", " ", "tha", "t", " ", "the", " ", "texts", " ", "do", " ", "not", "\\", "10", ";", " ", " ", "have", " ", "any", " ", "common", " ", "prefix", " ", "or", " ", "suff", "ix", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "check", "lines", ":", " ", "Spee", "dup", " ", "flag", ".", " ", " ", "If", " ", "fal", "se", ",", " ", "then", " ", "don", "'", "t", " ", "run", " ", "a", " ", "line", "-", "level", " ", "diff", "\\", "10", ";", " ", " ", " ", " ", "first", " ", "to", " ", "identify", " ", "the", " ", "change", "d", " ", "area", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "true", ",", " ", "then", " ", "run", " ", "a", " ", "faste", "r", ",", " ", "slight", "ly", " ", "less", " ", "optim", "al", " ", "diff", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Time", " ", "whe", "n", " ", "the", " ", "diff", " ", "shou", "ld", " ", "be", " ", "complete", " ", "by", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "text1", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "add", " ", "some", " ", "text", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "text2_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "text2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ju", "st", " ", "delete", " ", "some", " ", "text", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text1", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "text1", "_", ")_", ">_", "len_", "(_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "long", "text_", ",_", "short", "text_", ")_", "=_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "short", "text_", ",_", "long", "text_", ")_", "=_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "long", "text_", "._", "find_", "(_", "short", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "i_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Short", "er", " ", "text", " ", "is", " ", "insi", "de", " ", "the", " ", "long", "er", " ", "text", " ", "(", "speed", "up", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "=_", "[_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "long", "text_", "[_", ":_", "i_", "]_", ")_", ",_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "short", "text_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "long", "text_", "[_", "i_", "+_", "len_", "(_", "short", "text_", ")_", ":_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Swa", "p", " ", "insertion", "s", " ", "for", " ", "deletion", "s", " ", "if", " ", "diff", " ", "is", " ", "reverse", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "text1", "_", ")_", ">_", "len_", "(_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "0_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "2_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "diffs_", "[_", "2_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "short", "text_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sing", "le", " ", "character", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Af", "ter", " ", "the", " ", "previ", "ous", " ", "speed", "up", ",", " ", "the", " ", "character", " ", "can", "'", "t", " ", "be", " ", "an", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text1", "_", ")_", ",_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "text2_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "to", " ", "see", " ", "if", " ", "the", " ", "problem", " ", "can", " ", "be", " ", "split", " ", "in", " ", "two", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hm_", "=_", "self_", "._", "diff", "\\u", "half", "Match_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hm_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "half", "-", "match", " ", "was", " ", "found", ",", " ", "sort", " ", "out", " ", "the", " ", "return", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "text1", "\\u", "a_", ",_", "text1", "\\u", "b_", ",_", "text", "2", "\\u", "a_", ",_", "text", "2", "\\u", "b_", ",_", "mid", "\\u", "common_", ")_", "=_", "hm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sen", "d", " ", "bot", "h", " ", "pair", "s", " ", "off", " ", "for", " ", "separate", " ", "process", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "diffs", "\\u", "a_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "\\u", "a_", ",_", "text", "2", "\\u", "a_", ",_", "check", "lines_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs", "\\u", "b_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "\\u", "b_", ",_", "text", "2", "\\u", "b_", ",_", "check", "lines_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Merge", " ", "the", " ", "results", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "diffs", "\\u", "a_", "+_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "mid", "\\u", "common_", ")_", "]_", "+_", "diffs", "\\u", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "check", "lines_", "and_", "len_", "(_", "text1", "_", ")_", ">_", "100_", "and_", "len_", "(_", "text2_", ")_", ">_", "100_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "diff", "\\u", "line", "Mode_", "(_", "text1", "_", ",_", "text2_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "diff", "\\u", "bisect_", "(_", "text1", "_", ",_", "text2_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "line", "Mode_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "deadline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", " ", "a", " ", "quick", " ", "line", "-", "level", " ", "diff", " ", "on", " ", "bot", "h", " ", "string", "s", ",", " ", "then", " ", "red", "iff", " ", "the", " ", "part", "s", " ", "for", "\\", "10", ";", " ", " ", "great", "er", " ", "accu", "rac", "y", ".", "\\", "10", ";", " ", " ", "Thi", "s", " ", "speed", "up", " ", "can", " ", "produce", " ", "non", "-", "minima", "l", " ", "diffs", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Time", " ", "whe", "n", " ", "the", " ", "diff", " ", "shou", "ld", " ", "be", " ", "complete", " ", "by", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sca", "n", " ", "the", " ", "text", " ", "on", " ", "a", " ", "line", "-", "by", "-", "line", " ", "basi", "s", " ", "first", "._", "\\u\\u\\uNL\\u\\u\\u_", "(_", "text1", "_", ",_", "text2_", ",_", "linear", "ray_", ")_", "=_", "self_", "._", "diff", "\\u", "lines", "To", "Chars_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "_", ",_", "text2_", ",_", "False_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Convert", " ", "the", " ", "diff", " ", "back", " ", "to", " ", "original", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "diff", "\\u", "char", "s", "To", "Lines_", "(_", "diffs_", ",_", "linear", "ray_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Elimina", "te", " ", "fre", "ak", " ", "matche", "s", " ", "(", "e", ".", "g", ".", " ", "blank", " ", "lines", ")_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "diff", "\\u", "clean", "up", "Semantic", "_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Red", "iff", " ", "any", " ", "replace", "ment", " ", "blocks", ",", " ", "this", " ", "time", " ", "character", "-", "by", "-", "character", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "dummy", " ", "entry", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "delete_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "insert_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count", "\\u", "insert_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "+=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count", "\\u", "delete_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "+=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Up", "on", " ", "reach", "ing", " ", "an", " ", "equality", ",", " ", "check", " ", "for", " ", "prior", " ", "redu", "ndan", "cies", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "count", "\\u", "delete_", ">=_", "1_", "and_", "count", "\\u", "insert_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Delete", " ", "the", " ", "offen", "ding", " ", "record", "s", " ", "and", " ", "add", " ", "the", " ", "merge", "d", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text", "\\u", "delete_", ",_", "text", "\\u", "insert_", ",_", "False_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "count", "\\u", "delete_", "-_", "count", "\\u", "insert_", ":_", "pointer_", "]_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "pointer_", "-_", "count", "\\u", "delete_", "-_", "count", "\\u", "insert_", "+_", "len_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count", "\\u", "insert_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "delete_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "._", "pop_", "(_", ")_", "#", " ", "Remove", " ", "the", " ", "dummy", " ", "entry", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "bisect_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "deadline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "d", " ", "the", " ", "'", "middle", " ", "snake", "'", " ", "of", " ", "a", " ", "diff", ",", " ", "split", " ", "the", " ", "problem", " ", "in", " ", "two", "\\", "10", ";", " ", " ", "and", " ", "return", " ", "the", " ", "recurs", "ively", " ", "construct", "ed", " ", "diff", ".", "\\", "10", ";", " ", " ", "See", " ", "My", "ers", " ", "198", "6", " ", "pape", "r", ":", " ", "An", " ", "O", "(", "ND", ")", " ", "Difference", " ", "Algorit", "hm", " ", "and", " ", "It", "s", " ", "Variation", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Time", " ", "at", " ", "whi", "ch", " ", "to", " ", "bai", "l", " ", "if", " ", "not", " ", "ye", "t", " ", "complete", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cache", " ", "the", " ", "text", " ", "length", "s", " ", "to", " ", "prevent", " ", "multiple", " ", "calls", "._", "\\u\\u\\uNL\\u\\u\\u_", "text1", "\\u", "length_", "=_", "len_", "(_", "text1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "2", "\\u", "length_", "=_", "len_", "(_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "d_", "=_", "(_", "text1", "\\u", "length_", "+_", "text", "2", "\\u", "length_", "+_", "1_", ")_", "//_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v", "\\u", "offset_", "=_", "max", "\\u", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v", "\\u", "length_", "=_", "2_", "*_", "max", "\\u", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v1_", "=_", "[_", "-_", "1_", "]_", "*_", "v", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v1_", "[_", "v", "\\u", "offset_", "+_", "1_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v2_", "=_", "v1_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "text1", "\\u", "length_", "-_", "text", "2", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "total", " ", "number", " ", "of", " ", "character", "s", " ", "is", " ", "odd", ",", " ", "then", " ", "the", " ", "front", " ", "path", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "collide", " ", "with", " ", "the", " ", "reverse", " ", "path", "._", "\\u\\u\\uNL\\u\\u\\u_", "front_", "=_", "(_", "delta_", "%_", "2_", "!=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Offsets", " ", "for", " ", "start", " ", "and", " ", "end", " ", "of", " ", "k", " ", "loop", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Prev", "ents", " ", "mapping", " ", "of", " ", "space", " ", "be", "yon", "d", " ", "the", " ", "grid", "._", "\\u\\u\\uNL\\u\\u\\u_", "k", "1s", "tart_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k", "1e", "nd_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k2", "start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k2", "end_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "xrange_", "(_", "max", "\\u", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bai", "l", " ", "out", " ", "if", " ", "deadl", "ine", " ", "is", " ", "reache", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "time_", "._", "time_", "(_", ")_", ">_", "deadline_", ":_", "\\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_", "#", " ", "Walk", " ", "the", " ", "front", " ", "path", " ", "one", " ", "step", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k1_", "in_", "xrange_", "(_", "-_", "d_", "+_", "k", "1s", "tart_", ",_", "d_", "+_", "1_", "-_", "k", "1e", "nd_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k", "1", "\\u", "offset_", "=_", "v", "\\u", "offset_", "+_", "k1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k1_", "==_", "-_", "d_", "or_", "(_", "k1_", "!=_", "d_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "v1_", "[_", "k", "1", "\\u", "offset_", "-_", "1_", "]_", "<_", "v1_", "[_", "k", "1", "\\u", "offset_", "+_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x1_", "=_", "v1_", "[_", "k", "1", "\\u", "offset_", "+_", "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 ", " _", "x1_", "=_", "v1_", "[_", "k", "1", "\\u", "offset_", "-_", "1_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "y1_", "=_", "x1_", "-_", "k1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "x1_", "<_", "text1", "\\u", "length_", "and_", "y1_", "<_", "text", "2", "\\u", "length_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "text1", "_", "[_", "x1_", "]_", "==_", "text2_", "[_", "y1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y1_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v1_", "[_", "k", "1", "\\u", "offset_", "]_", "=_", "x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x1_", ">_", "text1", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ran", " ", "off", " ", "the", " ", "right", " ", "of", " ", "the", " ", "graph", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k", "1e", "nd_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "y1_", ">_", "text", "2", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ran", " ", "off", " ", "the", " ", "bottom", " ", "of", " ", "the", " ", "graph", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k", "1s", "tart_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "front_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k2", "\\u", "offset_", "=_", "v", "\\u", "offset_", "+_", "delta_", "-_", "k1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k2", "\\u", "offset_", ">=_", "0_", "and_", "k2", "\\u", "offset_", "<_", "v", "\\u", "length_", "and_", "v2_", "[_", "k2", "\\u", "offset_", "]_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mirror", " ", "x2", " ", "onto", " ", "top", "-", "left", " ", "coordinate", " ", "system", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x2_", "=_", "text1", "\\u", "length_", "-_", "v2_", "[_", "k2", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x1_", ">=_", "x2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Overlap", " ", "detect", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "diff", "\\u", "bisect", "Split_", "(_", "text1", "_", ",_", "text2_", ",_", "x1_", ",_", "y1_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Walk", " ", "the", " ", "reverse", " ", "path", " ", "one", " ", "step", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k2_", "in_", "xrange_", "(_", "-_", "d_", "+_", "k2", "start_", ",_", "d_", "+_", "1_", "-_", "k2", "end_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k2", "\\u", "offset_", "=_", "v", "\\u", "offset_", "+_", "k2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k2_", "==_", "-_", "d_", "or_", "(_", "k2_", "!=_", "d_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "v2_", "[_", "k2", "\\u", "offset_", "-_", "1_", "]_", "<_", "v2_", "[_", "k2", "\\u", "offset_", "+_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x2_", "=_", "v2_", "[_", "k2", "\\u", "offset_", "+_", "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 ", " _", "x2_", "=_", "v2_", "[_", "k2", "\\u", "offset_", "-_", "1_", "]_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "y2_", "=_", "x2_", "-_", "k2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "x2_", "<_", "text1", "\\u", "length_", "and_", "y2_", "<_", "text", "2", "\\u", "length_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "text1", "_", "[_", "-_", "x2_", "-_", "1_", "]_", "==_", "text2_", "[_", "-_", "y2_", "-_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x2_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y2_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "v2_", "[_", "k2", "\\u", "offset_", "]_", "=_", "x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x2_", ">_", "text1", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ran", " ", "off", " ", "the", " ", "left", " ", "of", " ", "the", " ", "graph", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k2", "end_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "y2_", ">_", "text", "2", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ran", " ", "off", " ", "the", " ", "top", " ", "of", " ", "the", " ", "graph", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k2", "start_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "front_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "k", "1", "\\u", "offset_", "=_", "v", "\\u", "offset_", "+_", "delta_", "-_", "k2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "k", "1", "\\u", "offset_", ">=_", "0_", "and_", "k", "1", "\\u", "offset_", "<_", "v", "\\u", "length_", "and_", "v1_", "[_", "k", "1", "\\u", "offset_", "]_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x1_", "=_", "v1_", "[_", "k", "1", "\\u", "offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y1_", "=_", "v", "\\u", "offset_", "+_", "x1_", "-_", "k", "1", "\\u", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mirror", " ", "x2", " ", "onto", " ", "top", "-", "left", " ", "coordinate", " ", "system", "._", "\\u\\u\\uNL\\u\\u\\u_", "x2_", "=_", "text1", "\\u", "length_", "-_", "x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x1_", ">=_", "x2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Overlap", " ", "detect", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "diff", "\\u", "bisect", "Split_", "(_", "text1", "_", ",_", "text2_", ",_", "x1_", ",_", "y1_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Diff", " ", "too", "k", " ", "too", " ", "long", " ", "and", " ", "hit", " ", "the", " ", "deadl", "ine", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "diffs", " ", "equals", " ", "number", " ", "of", " ", "character", "s", ",", " ", "no", " ", "common", "ality", " ", "at", " ", "all", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text1", "_", ")_", ",_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "text2_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "bisect", "Split_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ",_", "x_", ",_", "y_", ",_", "deadline_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "the", " ", "location", " ", "of", " ", "the", " ", "'", "middle", " ", "snake", "',", " ", "split", " ", "the", " ", "diff", " ", "in", " ", "two", " ", "part", "s", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "recurse", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Old", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "New", " ", "string", " ", "to", " ", "be", " ", "diff", "ed", ".", "\\", "10", ";", " ", " ", "x", ":", " ", "Index", " ", "of", " ", "split", " ", "point", " ", "in", " ", "text1", ".", "\\", "10", ";", " ", " ", "y", ":", " ", "Index", " ", "of", " ", "split", " ", "point", " ", "in", " ", "text", "2", ".", "\\", "10", ";", " ", " ", "deadl", "ine", ":", " ", "Time", " ", "at", " ", "whi", "ch", " ", "to", " ", "bai", "l", " ", "if", " ", "not", " ", "ye", "t", " ", "complete", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "a_", "=_", "text1", "_", "[_", ":_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "2a", "_", "=_", "text2_", "[_", ":_", "y_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "b_", "=_", "text1", "_", "[_", "x_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "2b", "_", "=_", "text2_", "[_", "y_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "bot", "h", " ", "diffs", " ", "serial", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "a_", ",_", "text", "2a", "_", ",_", "False_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs", "b_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "b_", ",_", "text", "2b", "_", ",_", "False_", ",_", "deadline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "diffs_", "+_", "diffs", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "lines", "To", "Chars_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Split", " ", "two", " ", "texts", " ", "int", "o", " ", "an", " ", "array", " ", "of", " ", "string", "s", ".", " ", " ", "Reduce", " ", "the", " ", "texts", " ", "to", " ", "a", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "hashe", "s", " ", "where", " ", "each", " ", "Unic", "ode", " ", "character", " ", "represent", "s", " ", "one", " ", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Thre", "e", " ", "element", " ", "tuple", ",", " ", "contain", "ing", " ", "the", " ", "encode", "d", " ", "text1", ",", " ", "the", " ", "encode", "d", " ", "text", "2", " ", "and", "\\", "10", ";", " ", " ", "the", " ", "array", " ", "of", " ", "unique", " ", "string", "s", ".", " ", " ", "The", " ", "zero", "th", " ", "element", " ", "of", " ", "the", " ", "array", " ", "of", " ", "unique", "\\", "10", ";", " ", " ", "string", "s", " ", "is", " ", "intent", "ional", "ly", " ", "blank", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Array_", "=_", "[_", "]_", "#", " ", "e", ".", "g", ".", " ", "line", "Array", "[", "4", "]", " ", "==", " ", "\"", "Hell", "o", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Hash_", "=_", "{_", "}_", "#", " ", "e", ".", "g", ".", " ", "line", "Hash", "[\"", "Hell", "o", "\\\\", "n", "\"]", " ", "==", " ", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"\\\\", "x0", "0", "\"", " ", "is", " ", "a", " ", "valid", " ", "character", ",", " ", "but", " ", "vari", "ous", " ", "debugg", "ers", " ", "don", "'", "t", " ", "like", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "So", " ", "we", "'", "ll", " ", "insert", " ", "a", " ", "junk", " ", "entry", " ", "to", " ", "avoid", " ", "generat", "ing", " ", "a", " ", "null", " ", "character", "._", "\\u\\u\\uNL\\u\\u\\u_", "line", "Array_", "._", "append_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "diff", "\\u", "lines", "To", "Char", "s", "Mun", "ge_", "(_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Split", " ", "a", " ", "text", " ", "int", "o", " ", "an", " ", "array", " ", "of", " ", "string", "s", ".", " ", " ", "Reduce", " ", "the", " ", "texts", " ", "to", " ", "a", " ", "string", "\\", "10", ";", " ", " ", "of", " ", "hashe", "s", " ", "where", " ", "each", " ", "Unic", "ode", " ", "character", " ", "represent", "s", " ", "one", " ", "line", ".", "\\", "10", ";", " ", " ", "Modifie", "s", " ", "linear", "ray", " ", "and", " ", "line", "hash", " ", "through", " ", "bei", "ng", " ", "a", " ", "clos", "ure", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "text", ":", " ", "String", " ", "to", " ", "encode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Encode", "d", " ", "string", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chars_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Walk", " ", "the", " ", "text", ",", " ", "pull", "ing", " ", "out", " ", "a", " ", "substring", " ", "for", " ", "each", " ", "line", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "text", ".", "split", "('\\", "\\", "n", "')", " ", "wou", "ld", " ", "wou", "ld", " ", "temporar", "il", "y", " ", "double", " ", "our", " ", "memory", " ", "footprint", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modif", "ying", " ", "text", " ", "wou", "ld", " ", "create", " ", "many", " ", "large", " ", "string", "s", " ", "to", " ", "gar", "bage", " ", "collect", "._", "\\u\\u\\uNL\\u\\u\\u_", "line", "Start_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "End_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "line", "End_", "<_", "len_", "(_", "text_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "End_", "=_", "text_", "._", "find_", "(_", "'\\\\", "n", "'_", ",_", "line", "Start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "line", "End_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "End_", "=_", "len_", "(_", "text_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line_", "=_", "text_", "[_", "line", "Start_", ":_", "line", "End_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Start_", "=_", "line", "End_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "line_", "in_", "line", "Hash_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chars_", "._", "append_", "(_", "unichr_", "(_", "line", "Hash_", "[_", "line_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "line", "Array_", "._", "append_", "(_", "line_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Hash_", "[_", "line_", "]_", "=_", "len_", "(_", "line", "Array_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chars_", "._", "append_", "(_", "unichr_", "(_", "len_", "(_", "line", "Array_", ")_", "-_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "chars_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "char", "s1_", "=_", "diff", "\\u", "lines", "To", "Char", "s", "Mun", "ge_", "(_", "text1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "s2_", "=_", "diff", "\\u", "lines", "To", "Char", "s", "Mun", "ge_", "(_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "char", "s1_", ",_", "char", "s2_", ",_", "line", "Array_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "char", "s", "To", "Lines_", "(_", "self_", ",_", "diffs_", ",_", "line", "Array_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Re", "hydra", "te", " ", "the", " ", "text", " ", "in", " ", "a", " ", "diff", " ", "from", " ", "a", " ", "string", " ", "of", " ", "line", " ", "hashe", "s", " ", "to", " ", "real", " ", "lines", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", "line", "Array", ":", " ", "Array", " ", "of", " ", "unique", " ", "string", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "len_", "(_", "diffs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "char_", "in_", "diffs_", "[_", "x_", "]_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "line", "Array_", "[_", "ord_", "(_", "char_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "[_", "x_", "]_", "=_", "(_", "diffs_", "[_", "x_", "]_", "[_", "0_", "]_", ",_", "\"\"_", "._", "join_", "(_", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "common", "Prefix_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Det", "erm", "ine", " ", "the", " ", "common", " ", "prefix", " ", "of", " ", "two", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "number", " ", "of", " ", "character", "s", " ", "common", " ", "to", " ", "the", " ", "start", " ", "of", " ", "each", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Qui", "ck", " ", "check", " ", "for", " ", "common", " ", "null", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "text1", "_", "or_", "not_", "text2_", "or_", "text1", "_", "[_", "0_", "]_", "!=_", "text2_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bin", "ary", " ", "search", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perform", "anc", "e", " ", "analys", "is", ":", " ", "http", "://", "nei", "l", ".", "fra", "ser", ".", "name", "/", "news", "/", "2007", "/", "10", "/", "09", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "erm", "in_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "erm", "ax_", "=_", "min_", "(_", "len_", "(_", "text1", "_", ")_", ",_", "len_", "(_", "text2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "erm", "id_", "=_", "point", "erm", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointers", "tart_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "point", "erm", "in_", "<_", "point", "erm", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text1", "_", "[_", "pointers", "tart_", ":_", "point", "erm", "id_", "]_", "==_", "text2_", "[_", "pointers", "tart_", ":_", "point", "erm", "id_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "point", "erm", "in_", "=_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointers", "tart_", "=_", "point", "erm", "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 ", " _", "point", "erm", "ax_", "=_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "erm", "id_", "=_", "(_", "point", "erm", "ax_", "-_", "point", "erm", "in_", ")_", "//_", "2_", "+_", "point", "erm", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "common", "Suffix_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Det", "erm", "ine", " ", "the", " ", "common", " ", "suff", "ix", " ", "of", " ", "two", " ", "string", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "number", " ", "of", " ", "character", "s", " ", "common", " ", "to", " ", "the", " ", "end", " ", "of", " ", "each", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Qui", "ck", " ", "check", " ", "for", " ", "common", " ", "null", " ", "case", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "text1", "_", "or_", "not_", "text2_", "or_", "text1", "_", "[_", "-_", "1_", "]_", "!=_", "text2_", "[_", "-_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bin", "ary", " ", "search", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perform", "anc", "e", " ", "analys", "is", ":", " ", "http", "://", "nei", "l", ".", "fra", "ser", ".", "name", "/", "news", "/", "2007", "/", "10", "/", "09", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "erm", "in_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "erm", "ax_", "=_", "min_", "(_", "len_", "(_", "text1", "_", ")_", ",_", "len_", "(_", "text2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "erm", "id_", "=_", "point", "erm", "ax_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "eren", "d_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "point", "erm", "in_", "<_", "point", "erm", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "text1", "_", "[_", "-_", "point", "erm", "id_", ":_", "len_", "(_", "text1", "_", ")_", "-_", "point", "eren", "d_", "]_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "text2_", "[_", "-_", "point", "erm", "id_", ":_", "len_", "(_", "text2_", ")_", "-_", "point", "eren", "d_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "point", "erm", "in_", "=_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "point", "eren", "d_", "=_", "point", "erm", "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 ", " _", "point", "erm", "ax_", "=_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "point", "erm", "id_", "=_", "(_", "point", "erm", "ax_", "-_", "point", "erm", "in_", ")_", "//_", "2_", "+_", "point", "erm", "in_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "point", "erm", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "common", "Overlap", "_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Det", "erm", "ine", " ", "if", " ", "the", " ", "suff", "ix", " ", "of", " ", "one", " ", "string", " ", "is", " ", "the", " ", "prefix", " ", "of", " ", "anot", "her", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", "text", "2", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "number", " ", "of", " ", "character", "s", " ", "common", " ", "to", " ", "the", " ", "end", " ", "of", " ", "the", " ", "first", "\\", "10", ";", " ", " ", "string", " ", "and", " ", "the", " ", "start", " ", "of", " ", "the", " ", "second", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Cache", " ", "the", " ", "text", " ", "length", "s", " ", "to", " ", "prevent", " ", "multiple", " ", "calls", "._", "\\u\\u\\uNL\\u\\u\\u_", "text1", "\\u", "length_", "=_", "len_", "(_", "text1", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "2", "\\u", "length_", "=_", "len_", "(_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Elimina", "te", " ", "the", " ", "null", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text1", "\\u", "length_", "==_", "0_", "or_", "text", "2", "\\u", "length_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Truncate", " ", "the", " ", "long", "er", " ", "string", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "\\u", "length_", ">_", "text", "2", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text1", "_", "=_", "text1", "_", "[_", "-_", "text", "2", "\\u", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text1", "\\u", "length_", "<_", "text", "2", "\\u", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text2_", "=_", "text2_", "[_", ":_", "text1", "\\u", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text", "\\u", "length_", "=_", "min_", "(_", "text1", "\\u", "length_", ",_", "text", "2", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Qui", "ck", " ", "check", " ", "for", " ", "the", " ", "worst", " ", "case", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text1", "_", "==_", "text2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "text", "\\u", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Start", " ", "by", " ", "look", "ing", " ", "for", " ", "a", " ", "single", " ", "character", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "increase", " ", "length", " ", "unti", "l", " ", "no", " ", "match", " ", "is", " ", "found", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Perform", "anc", "e", " ", "analys", "is", ":", " ", "http", "://", "nei", "l", ".", "fra", "ser", ".", "name", "/", "news", "/", "2010", "/", "11", "/", "04", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "best_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pattern_", "=_", "text1", "_", "[_", "-_", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "text2_", "._", "find_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "found_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "best_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "length_", "+=_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "found_", "==_", "0_", "or_", "text1", "_", "[_", "-_", "length_", ":_", "]_", "==_", "text2_", "[_", ":_", "length_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best_", "=_", "length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "half", "Match_", "(_", "self_", ",_", "text1", "_", ",_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", " ", "the", " ", "two", " ", "texts", " ", "share", " ", "a", " ", "substring", " ", "whi", "ch", " ", "is", " ", "at", " ", "leas", "t", " ", "half", " ", "the", " ", "length", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "long", "er", " ", "text", "?", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "speed", "up", " ", "can", " ", "produce", " ", "non", "-", "minima", "l", " ", "diffs", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", "text", "2", ":", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Fiv", "e", " ", "element", " ", "Array", ",", " ", "contain", "ing", " ", "the", " ", "prefix", " ", "of", " ", "text1", ",", " ", "the", " ", "suff", "ix", " ", "of", " ", "text1", ",", "\\", "10", ";", " ", " ", "the", " ", "prefix", " ", "of", " ", "text", "2", ",", " ", "the", " ", "suff", "ix", " ", "of", " ", "text", "2", " ", "and", " ", "the", " ", "common", " ", "middle", ".", " ", " ", "Or", " ", "Non", "e", "\\", "10", ";", " ", " ", "if", " ", "there", " ", "was", " ", "no", " ", "match", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "Diff", "\\u", "Timeout_", "<=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "risk", " ", "return", "ing", " ", "a", " ", "non", "-", "optim", "al", " ", "diff", " ", "if", " ", "we", " ", "have", " ", "unlimited", " ", "time", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "text1", "_", ")_", ">_", "len_", "(_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "long", "text_", ",_", "short", "text_", ")_", "=_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "short", "text_", ",_", "long", "text_", ")_", "=_", "(_", "text1", "_", ",_", "text2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "long", "text_", ")_", "<_", "4_", "or_", "len_", "(_", "short", "text_", ")_", "*_", "2_", "<_", "len_", "(_", "long", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "#", " ", "Point", "less", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "half", "Match", "I_", "(_", "long", "text_", ",_", "short", "text_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", "es", " ", "a", " ", "substring", " ", "of", " ", "short", "text", " ", "exist", " ", "within", " ", "long", "text", " ", "suc", "h", " ", "tha", "t", " ", "the", "\\", "10", ";", " ", " ", "substring", " ", "is", " ", "at", " ", "leas", "t", " ", "half", " ", "the", " ", "length", " ", "of", " ", "long", "text", "?", "\\", "10", ";", " ", " ", "Clos", "ure", ",", " ", "but", " ", "doe", "s", " ", "not", " ", "reference", " ", "any", " ", "external", " ", "variab", "les", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "long", "text", ":", " ", "Long", "er", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "short", "text", ":", " ", "Short", "er", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "i", ":", " ", "Start", " ", "index", " ", "of", " ", "quarter", " ", "length", " ", "substring", " ", "within", " ", "long", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Fiv", "e", " ", "element", " ", "Array", ",", " ", "contain", "ing", " ", "the", " ", "prefix", " ", "of", " ", "long", "text", ",", " ", "the", " ", "suff", "ix", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "long", "text", ",", " ", "the", " ", "prefix", " ", "of", " ", "short", "text", ",", " ", "the", " ", "suff", "ix", " ", "of", " ", "short", "text", " ", "and", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "common", " ", "middle", ".", " ", " ", "Or", " ", "Non", "e", " ", "if", " ", "there", " ", "was", " ", "no", " ", "match", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seed_", "=_", "long", "text_", "[_", "i_", ":_", "i_", "+_", "len_", "(_", "long", "text_", ")_", "//_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "common_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "j_", "=_", "short", "text_", "._", "find_", "(_", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "j_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix", "Length_", "=_", "self_", "._", "diff", "\\u", "common", "Prefix_", "(_", "long", "text_", "[_", "i_", ":_", "]_", ",_", "short", "text_", "[_", "j_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suff", "ix", "Length_", "=_", "self_", "._", "diff", "\\u", "common", "Suffix_", "(_", "long", "text_", "[_", ":_", "i_", "]_", ",_", "short", "text_", "[_", ":_", "j_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "best", "\\u", "common_", ")_", "<_", "suff", "ix", "Length_", "+_", "prefix", "Length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best", "\\u", "common_", "=_", "(_", "short", "text_", "[_", "j_", "-_", "suff", "ix", "Length_", ":_", "j_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "short", "text_", "[_", "j_", ":_", "j_", "+_", "prefix", "Length_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "long", "text", "\\u", "a_", "=_", "long", "text_", "[_", ":_", "i_", "-_", "suff", "ix", "Length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "long", "text", "\\u", "b_", "=_", "long", "text_", "[_", "i_", "+_", "prefix", "Length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "short", "text", "\\u", "a_", "=_", "short", "text_", "[_", ":_", "j_", "-_", "suff", "ix", "Length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "short", "text", "\\u", "b_", "=_", "short", "text_", "[_", "j_", "+_", "prefix", "Length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "j_", "=_", "short", "text_", "._", "find_", "(_", "seed_", ",_", "j_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "best", "\\u", "common_", ")_", "*_", "2_", ">=_", "len_", "(_", "long", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "best", "\\u", "long", "text", "\\u", "a_", ",_", "best", "\\u", "long", "text", "\\u", "b_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "best", "\\u", "short", "text", "\\u", "a_", ",_", "best", "\\u", "short", "text", "\\u", "b_", ",_", "best", "\\u", "common_", ")_", "\\u\\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\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "check", " ", "if", " ", "the", " ", "second", " ", "quarter", " ", "is", " ", "the", " ", "seed", " ", "for", " ", "a", " ", "half", "-", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hm", "1_", "=_", "diff", "\\u", "half", "Match", "I_", "(_", "long", "text_", ",_", "short", "text_", ",_", "(_", "len_", "(_", "long", "text_", ")_", "+_", "3_", ")_", "//_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "again", " ", "based", " ", "on", " ", "the", " ", "third", " ", "quarter", "._", "\\u\\u\\uNL\\u\\u\\u_", "hm", "2_", "=_", "diff", "\\u", "half", "Match", "I_", "(_", "long", "text_", ",_", "short", "text_", ",_", "(_", "len_", "(_", "long", "text_", ")_", "+_", "1_", ")_", "//_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hm", "1_", "and_", "not_", "hm", "2_", ":_", "\\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_", "elif_", "not_", "hm", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hm_", "=_", "hm", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "hm", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hm_", "=_", "hm", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Bot", "h", " ", "matche", "d", ".", " ", " ", "Select", " ", "the", " ", "long", "est", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "hm", "1_", "[_", "4_", "]_", ")_", ">_", "len_", "(_", "hm", "2_", "[_", "4_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hm_", "=_", "hm", "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 ", " _", "hm_", "=_", "hm", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "half", "-", "match", " ", "was", " ", "found", ",", " ", "sort", " ", "out", " ", "the", " ", "return", " ", "data", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "text1", "_", ")_", ">_", "len_", "(_", "text2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "text1", "\\u", "a_", ",_", "text1", "\\u", "b_", ",_", "text", "2", "\\u", "a_", ",_", "text", "2", "\\u", "b_", ",_", "mid", "\\u", "common_", ")_", "=_", "hm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "text", "2", "\\u", "a_", ",_", "text", "2", "\\u", "b_", ",_", "text1", "\\u", "a_", ",_", "text1", "\\u", "b_", ",_", "mid", "\\u", "common_", ")_", "=_", "hm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "text1", "\\u", "a_", ",_", "text1", "\\u", "b_", ",_", "text", "2", "\\u", "a_", ",_", "text", "2", "\\u", "b_", ",_", "mid", "\\u", "common_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "clean", "up", "Semantic", "_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Reduce", " ", "the", " ", "number", " ", "of", " ", "edits", " ", "by", " ", "eliminat", "ing", " ", "sema", "ntic", "ally", " ", "trivial", "\\", "10", ";", " ", " ", " ", " ", "equal", "iti", "es", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equal", "ities_", "=_", "[_", "]_", "#", " ", "Stack", " ", "of", " ", "indice", "s", " ", "where", " ", "equal", "iti", "es", " ", "are", " ", "found", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "None_", "#", " ", "Al", "way", "s", " ", "equal", " ", "to", " ", "diffs", "[", "equal", "iti", "es", "[-", "1", "]]", "[", "1", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "0_", "#", " ", "Index", " ", "of", " ", "current", " ", "position", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Number", " ", "of", " ", "char", "s", " ", "tha", "t", " ", "change", "d", " ", "prior", " ", "to", " ", "the", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "length", "\\u", "insertion", "s1_", ",_", "length", "\\u", "deletion", "s1_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Number", " ", "of", " ", "char", "s", " ", "tha", "t", " ", "change", "d", " ", "after", " ", "the", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "length", "\\u", "insertion", "s2_", ",_", "length", "\\u", "deletion", "s2_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "#", " ", "Equali", "ty", " ", "found", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equal", "ities_", "._", "append_", "(_", "pointer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length", "\\u", "insertion", "s1_", ",_", "length", "\\u", "insertion", "s2_", "=_", "length", "\\u", "insertion", "s2_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length", "\\u", "deletion", "s1_", ",_", "length", "\\u", "deletion", "s2_", "=_", "length", "\\u", "deletion", "s2_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "An", " ", "insertion", " ", "or", " ", "deletion", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length", "\\u", "insertion", "s2_", "+=_", "len_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "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 ", " _", "length", "\\u", "deletion", "s2_", "+=_", "len_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Elimina", "te", " ", "an", " ", "equality", " ", "tha", "t", " ", "is", " ", "small", "er", " ", "or", " ", "equal", " ", "to", " ", "the", " ", "edits", " ", "on", " ", "both_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "side", "s", " ", "of", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "last", "equality", "_", "and_", "(_", "len_", "(_", "last", "equality", "_", ")_", "<=_", "\\u\\u\\uNL\\u\\u\\u_", "max_", "(_", "length", "\\u", "insertion", "s1_", ",_", "length", "\\u", "deletion", "s1_", ")_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "len_", "(_", "last", "equality", "_", ")_", "<=_", "max_", "(_", "length", "\\u", "insertion", "s2_", ",_", "length", "\\u", "deletion", "s2_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Duplicate", " ", "record", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "equal", "ities_", "[_", "-_", "1_", "]_", ",_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "last", "equality", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Change", " ", "second", " ", "copy", " ", "to", " ", "insert", "._", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "equal", "ities_", "[_", "-_", "1_", "]_", "+_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "equal", "ities_", "[_", "-_", "1_", "]_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Throw", " ", "awa", "y", " ", "the", " ", "equality", " ", "we", " ", "just", " ", "delete", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "equal", "ities_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Throw", " ", "awa", "y", " ", "the", " ", "previ", "ous", " ", "equality", " ", "(", "it", " ", "need", "s", " ", "to", " ", "be", " ", "ree", "valu", "ated", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "equal", "ities_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equal", "ities_", "._", "pop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "equal", "ities_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pointer_", "=_", "equal", "ities_", "[_", "-_", "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 ", " _", "pointer_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reset", " ", "the", " ", "counter", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "length", "\\u", "insertion", "s1_", ",_", "length", "\\u", "deletion", "s1_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length", "\\u", "insertion", "s2_", ",_", "length", "\\u", "deletion", "s2_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Normalize", " ", "the", " ", "diff", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "changes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "diff", "\\u", "clean", "up", "Merge_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "diff", "\\u", "clean", "up", "Semantic", "Lo", "ssl", "ess_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fin", "d", " ", "any", " ", "overlaps", " ", "bet", "ween", " ", "deletion", "s", " ", "and", " ", "insertion", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "e", ".", "g", ":", " ", "<", "del", ">", "abc", "xxx", "</", "del", "><", "ins", ">", "xxx", "def", "</", "ins", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "->", " ", "<", "del", ">", "abc", "</", "del", ">", "xxx", "<", "ins", ">", "def", "</", "ins", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "e", ".", "g", ":", " ", "<", "del", ">", "xxx", "abc", "</", "del", "><", "ins", ">", "def", "xxx", "</", "ins", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "->", " ", "<", "ins", ">", "def", "</", "ins", ">", "xxx", "<", "del", ">", "abc", "</", "del", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "extract", " ", "an", " ", "overl", "ap", " ", "if", " ", "it", " ", "is", " ", "as", " ", "big", " ", "as", " ", "the", " ", "edit", " ", "ahe", "ad", " ", "or", " ", "beh", "ind", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "pointer_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deletion_", "=_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insertion", "_", "=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "overl", "ap", "\\u", "length", "1_", "=_", "self_", "._", "diff", "\\u", "common", "Overlap", "_", "(_", "deletion_", ",_", "insertion", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "overl", "ap", "\\u", "length", "2_", "=_", "self_", "._", "diff", "\\u", "common", "Overlap", "_", "(_", "insertion", "_", ",_", "deletion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "overl", "ap", "\\u", "length", "1_", ">=_", "overl", "ap", "\\u", "length", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "overl", "ap", "\\u", "length", "1_", ">=_", "len_", "(_", "deletion_", ")_", "/_", "2.0_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "overl", "ap", "\\u", "length", "1_", ">=_", "len_", "(_", "insertion", "_", ")_", "/_", "2.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Overlap", " ", "found", ".", " ", " ", "Insert", " ", "an", " ", "equality", " ", "and", " ", "trim", " ", "the", " ", "surround", "ing", " ", "edits", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "pointer_", ",_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "insertion", "_", "[_", ":_", "overl", "ap", "\\u", "length", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "deletion_", "[_", ":_", "len_", "(_", "deletion_", ")_", "-_", "overl", "ap", "\\u", "length", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "insertion", "_", "[_", "overl", "ap", "\\u", "length", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "overl", "ap", "\\u", "length", "2_", ">=_", "len_", "(_", "deletion_", ")_", "/_", "2.0_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "overl", "ap", "\\u", "length", "2_", ">=_", "len_", "(_", "insertion", "_", ")_", "/_", "2.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Revers", "e", " ", "overl", "ap", " ", "found", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Insert", " ", "an", " ", "equality", " ", "and", " ", "swap", " ", "and", " ", "trim", " ", "the", " ", "surround", "ing", " ", "edits", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "pointer_", ",_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "deletion_", "[_", ":_", "overl", "ap", "\\u", "length", "2_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "insertion", "_", "[_", ":_", "len_", "(_", "insertion", "_", ")_", "-_", "overl", "ap", "\\u", "length", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "deletion_", "[_", "overl", "ap", "\\u", "length", "2_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "clean", "up", "Semantic", "Lo", "ssl", "ess_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Look", " ", "for", " ", "single", " ", "edits", " ", "surround", "ed", " ", "on", " ", "bot", "h", " ", "side", "s", " ", "by", " ", "equal", "iti", "es", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "can", " ", "be", " ", "shifted", " ", "side", "way", "s", " ", "to", " ", "align", " ", "the", " ", "edit", " ", "to", " ", "a", " ", "word", " ", "bound", "ary", ".", "\\", "10", ";", " ", " ", " ", " ", "e", ".", "g", ":", " ", "The", " ", "c", "<", "ins", ">", "at", " ", "c", "</", "ins", ">", "ame", ".", " ", "->", " ", "The", " ", "<", "ins", ">", "cat", " ", "</", "ins", ">", "came", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "diff", "\\u", "clean", "up", "Semantic", "Score_", "(_", "one_", ",_", "two_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "two", " ", "string", "s", ",", " ", "compute", " ", "a", " ", "score", " ", "represent", "ing", " ", "whe", "ther", " ", "the", "\\", "10", ";", " ", " ", "internal", " ", "bound", "ary", " ", "fall", "s", " ", "on", " ", "logical", " ", "bound", "aries", ".", "\\", "10", ";", " ", " ", "Score", "s", " ", "range", " ", "from", " ", "6", " ", "(", "best", ")", " ", "to", " ", "0", " ", "(", "worst", ").", "\\", "10", ";", " ", " ", "Clos", "ure", ",", " ", "but", " ", "doe", "s", " ", "not", " ", "reference", " ", "any", " ", "external", " ", "variab", "les", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "one", ":", " ", "Fi", "rst", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "two", ":", " ", "Second", " ", "string", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "score", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "one_", "or_", "not_", "two_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ed", "ges", " ", "are", " ", "the", " ", "best", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "6_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "port", " ", "of", " ", "this", " ", "function", " ", "behave", "s", " ", "slight", "ly", " ", "different", "ly", " ", "due", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "subt", "le", " ", "difference", "s", " ", "in", " ", "each", " ", "language", "'", "s", " ", "definit", "ion", " ", "of", " ", "thing", "s", " ", "like_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "whitespace", "'.", " ", " ", "Sin", "ce", " ", "this", " ", "function", "'", "s", " ", "purpose", " ", "is", " ", "large", "ly", " ", "cosm", "etic", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "choice", " ", "has", " ", "bee", "n", " ", "made", " ", "to", " ", "use", " ", "each", " ", "language", "'", "s", " ", "nativ", "e", " ", "features_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rat", "her", " ", "than", " ", "force", " ", "total", " ", "conform", "it", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "char", "1_", "=_", "one_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "2_", "=_", "two_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "non", "Al", "pha", "Numer", "ic", "1_", "=_", "not_", "char", "1_", "._", "isal", "num_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "non", "Al", "pha", "Numer", "ic", "2_", "=_", "not_", "char", "2_", "._", "isal", "num_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "whitespace", "1_", "=_", "non", "Al", "pha", "Numer", "ic", "1_", "and_", "char", "1_", "._", "isspace", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "whitespace", "2_", "=_", "non", "Al", "pha", "Numer", "ic", "2_", "and_", "char", "2_", "._", "isspace", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Break", "1_", "=_", "whitespace", "1_", "and_", "(_", "char", "1_", "==_", "\"\\\\", "r", "\"_", "or_", "char", "1_", "==_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line", "Break", "2_", "=_", "whitespace", "2_", "and_", "(_", "char", "2_", "==_", "\"\\\\", "r", "\"_", "or_", "char", "2_", "==_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "Line", "1_", "=_", "line", "Break", "1_", "and_", "self_", "._", "BLANK", "LINE", "END_", "._", "search_", "(_", "one_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "blank", "Line", "2_", "=_", "line", "Break", "2_", "and_", "self_", "._", "BLANK", "LINES", "TAR", "T_", "._", "match_", "(_", "two_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "blank", "Line", "1_", "or_", "blank", "Line", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fiv", "e", " ", "points", " ", "for", " ", "blank", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "line", "Break", "1_", "or_", "line", "Break", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Four", " ", "points", " ", "for", " ", "line", " ", "breaks", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "non", "Al", "pha", "Numer", "ic", "1_", "and_", "not_", "whitespace", "1_", "and_", "whitespace", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thre", "e", " ", "points", " ", "for", " ", "end", " ", "of", " ", "sentence", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "whitespace", "1_", "or_", "whitespace", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tw", "o", " ", "points", " ", "for", " ", "whitespace", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "non", "Al", "pha", "Numer", "ic", "1_", "or_", "non", "Al", "pha", "Numer", "ic", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "One", " ", "point", " ", "for", " ", "non", "-", "alphanumeric", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inten", "tion", "ally", " ", "ignore", " ", "the", " ", "first", " ", "and", " ", "last", " ", "element", " ", "(", "don", "'", "t", " ", "need", " ", "checking", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "single", " ", "edit", " ", "surround", "ed", " ", "by", " ", "equal", "iti", "es", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equality", "1_", "=_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edit_", "=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equality", "2_", "=_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", ",", " ", "shift", " ", "the", " ", "edit", " ", "as", " ", "far", " ", "left", " ", "as", " ", "possib", "le", "._", "\\u\\u\\uNL\\u\\u\\u_", "common", "Offset_", "=_", "self_", "._", "diff", "\\u", "common", "Suffix_", "(_", "equality", "1_", ",_", "edit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common", "Offset_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "String_", "=_", "edit_", "[_", "-_", "common", "Offset_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equality", "1_", "=_", "equality", "1_", "[_", ":_", "-_", "common", "Offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edit_", "=_", "common", "String_", "+_", "edit_", "[_", ":_", "-_", "common", "Offset_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equality", "2_", "=_", "common", "String_", "+_", "equality", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Second", ",", " ", "step", " ", "character", " ", "by", " ", "character", " ", "right", ",", " ", "look", "ing", " ", "for", " ", "the", " ", "best", " ", "fit", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "best", "Equali", "ty", "1_", "=_", "equality", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Edit_", "=_", "edit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Equali", "ty", "2_", "=_", "equality", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Score_", "=_", "(_", "diff", "\\u", "clean", "up", "Semantic", "Score_", "(_", "equality", "1_", ",_", "edit_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "diff", "\\u", "clean", "up", "Semantic", "Score_", "(_", "edit_", ",_", "equality", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "edit_", "and_", "equality", "2_", "and_", "edit_", "[_", "0_", "]_", "==_", "equality", "2_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equality", "1_", "+=_", "edit_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "edit_", "=_", "edit_", "[_", "1_", ":_", "]_", "+_", "equality", "2_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equality", "2_", "=_", "equality", "2_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "(_", "diff", "\\u", "clean", "up", "Semantic", "Score_", "(_", "equality", "1_", ",_", "edit_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "diff", "\\u", "clean", "up", "Semantic", "Score_", "(_", "edit_", ",_", "equality", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", ">=", " ", "enco", "ura", "ges", " ", "trail", "ing", " ", "rat", "her", " ", "than", " ", "lead", "ing", " ", "whitespace", " ", "on", " ", "edits", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "score_", ">=_", "best", "Score_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "best", "Score_", "=_", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Equali", "ty", "1_", "=_", "equality", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Edit_", "=_", "edit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Equali", "ty", "2_", "=_", "equality", "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_", "if_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "!=_", "best", "Equali", "ty", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "have", " ", "an", " ", "improvement", ",", " ", "save", " ", "it", " ", "back", " ", "to", " ", "the", " ", "diff", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "best", "Equali", "ty", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", ",_", "best", "Equali", "ty", "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 ", " _", "del_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", ",_", "best", "Edit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "best", "Equali", "ty", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "0_", "]_", ",_", "best", "Equali", "ty", "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 ", " _", "del_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "diff", "\\u", "clean", "up", "Efficien", "cy_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Reduce", " ", "the", " ", "number", " ", "of", " ", "edits", " ", "by", " ", "eliminat", "ing", " ", "operati", "onal", "ly", " ", "trivial", "\\", "10", ";", " ", " ", " ", " ", "equal", "iti", "es", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equal", "ities_", "=_", "[_", "]_", "#", " ", "Stack", " ", "of", " ", "indice", "s", " ", "where", " ", "equal", "iti", "es", " ", "are", " ", "found", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "None_", "#", " ", "Al", "way", "s", " ", "equal", " ", "to", " ", "diffs", "[", "equal", "iti", "es", "[-", "1", "]]", "[", "1", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "0_", "#", " ", "Index", " ", "of", " ", "current", " ", "position", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pre", "\\u", "ins_", "=_", "False_", "#", " ", "Is", " ", "there", " ", "an", " ", "insertion", " ", "operati", "on", " ", "bef", "ore", " ", "the", " ", "last", " ", "equality", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pre", "\\u", "del_", "=_", "False_", "#", " ", "Is", " ", "there", " ", "a", " ", "deletion", " ", "operati", "on", " ", "bef", "ore", " ", "the", " ", "last", " ", "equality", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "ins_", "=_", "False_", "#", " ", "Is", " ", "there", " ", "an", " ", "insertion", " ", "operati", "on", " ", "after", " ", "the", " ", "last", " ", "equality", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post", "\\u", "del_", "=_", "False_", "#", " ", "Is", " ", "there", " ", "a", " ", "deletion", " ", "operati", "on", " ", "after", " ", "the", " ", "last", " ", "equality", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "#", " ", "Equali", "ty", " ", "found", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "len_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", ")_", "<_", "self_", "._", "Diff", "\\u", "Edit", "Cost_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "post", "\\u", "ins_", "or_", "post", "\\u", "del_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Candidate", " ", "found", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equal", "ities_", "._", "append_", "(_", "pointer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pre", "\\u", "ins_", "=_", "post", "\\u", "ins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pre", "\\u", "del_", "=_", "post", "\\u", "del_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", " ", "a", " ", "candidate", ",", " ", "and", " ", "can", " ", "neve", "r", " ", "bec", "ome", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equal", "ities_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "post", "\\u", "ins_", "=_", "post", "\\u", "del_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "An", " ", "insertion", " ", "or", " ", "deletion", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post", "\\u", "del_", "=_", "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 ", " _", "post", "\\u", "ins_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fiv", "e", " ", "types", " ", "to", " ", "be", " ", "split", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "ins", ">", "A", "</", "ins", "><", "del", ">", "B", "</", "del", ">", "XY", "<", "ins", ">", "C", "</", "ins", "><", "del", ">", "D", "</", "del", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "ins", ">", "A", "</", "ins", ">", "X", "<", "ins", ">", "C", "</", "ins", "><", "del", ">", "D", "</", "del", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "ins", ">", "A", "</", "ins", "><", "del", ">", "B", "</", "del", ">", "X", "<", "ins", ">", "C", "</", "ins", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "ins", ">", "A", "</", "del", ">", "X", "<", "ins", ">", "C", "</", "ins", "><", "del", ">", "D", "</", "del", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<", "ins", ">", "A", "</", "ins", "><", "del", ">", "B", "</", "del", ">", "X", "<", "del", ">", "C", "</", "del", ">_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "last", "equality", "_", "and_", "(_", "(_", "pre", "\\u", "ins_", "and_", "pre", "\\u", "del_", "and_", "post", "\\u", "ins_", "and_", "post", "\\u", "del_", ")_", "or_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "len_", "(_", "last", "equality", "_", ")_", "<_", "self_", "._", "Diff", "\\u", "Edit", "Cost_", "/_", "2_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "pre", "\\u", "ins_", "+_", "pre", "\\u", "del_", "+_", "post", "\\u", "ins_", "+_", "post", "\\u", "del_", ")_", "==_", "3_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Duplicate", " ", "record", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "equal", "ities_", "[_", "-_", "1_", "]_", ",_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "last", "equality", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Change", " ", "second", " ", "copy", " ", "to", " ", "insert", "._", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "equal", "ities_", "[_", "-_", "1_", "]_", "+_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "equal", "ities_", "[_", "-_", "1_", "]_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equal", "ities_", "._", "pop_", "(_", ")_", "#", " ", "Throw", " ", "awa", "y", " ", "the", " ", "equality", " ", "we", " ", "just", " ", "delete", "d", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "equality", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pre", "\\u", "ins_", "and_", "pre", "\\u", "del_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "change", "s", " ", "made", " ", "whi", "ch", " ", "coul", "d", " ", "affect", " ", "previ", "ous", " ", "entry", ",", " ", "keep", " ", "goi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post", "\\u", "ins_", "=_", "post", "\\u", "del_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "equal", "ities_", "=_", "[_", "]_", "\\u\\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_", "len_", "(_", "equal", "ities_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "equal", "ities_", "._", "pop_", "(_", ")_", "#", " ", "Throw", " ", "awa", "y", " ", "the", " ", "previ", "ous", " ", "equality", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "equal", "ities_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pointer_", "=_", "equal", "ities_", "[_", "-_", "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 ", " _", "pointer_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "post", "\\u", "ins_", "=_", "post", "\\u", "del_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "changes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "diff", "\\u", "clean", "up", "Merge_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "clean", "up", "Merge_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Re", "order", " ", "and", " ", "merge", " ", "like", " ", "edit", " ", "section", "s", ".", " ", " ", "Merge", " ", "equal", "iti", "es", ".", "\\", "10", ";", " ", " ", " ", " ", "Any", " ", "edit", " ", "section", " ", "can", " ", "move", " ", "as", " ", "long", " ", "as", " ", "it", " ", "doe", "sn", "'", "t", " ", "cross", " ", "an", " ", "equality", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "''_", ")_", ")_", "#", " ", "Add", " ", "a", " ", "dummy", " ", "entry", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "delete_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "insert_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count", "\\u", "insert_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "+=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count", "\\u", "delete_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "+=_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Up", "on", " ", "reach", "ing", " ", "an", " ", "equality", ",", " ", "check", " ", "for", " ", "prior", " ", "redu", "ndan", "cies", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "count", "\\u", "delete_", "+_", "count", "\\u", "insert_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "count", "\\u", "delete_", "!=_", "0_", "and_", "count", "\\u", "insert_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Factor", " ", "out", " ", "any", " ", "common", " ", "prefix", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Prefix_", "(_", "text", "\\u", "insert_", ",_", "text", "\\u", "delete_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common", "length_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "=_", "pointer_", "-_", "count", "\\u", "delete_", "-_", "count", "\\u", "insert_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "x_", ">=_", "0_", "and_", "diffs_", "[_", "x_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "x_", "]_", "=_", "(_", "diffs_", "[_", "x_", "]_", "[_", "0_", "]_", ",_", "diffs_", "[_", "x_", "]_", "[_", "1_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "text", "\\u", "insert_", "[_", ":_", "common", "length_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "0_", ",_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "text", "\\u", "insert_", "[_", ":_", "common", "length_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text", "\\u", "insert_", "=_", "text", "\\u", "insert_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "text", "\\u", "delete_", "[_", "common", "length_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Factor", " ", "out", " ", "any", " ", "common", " ", "suff", "ix", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "common", "length_", "=_", "self_", "._", "diff", "\\u", "common", "Suffix_", "(_", "text", "\\u", "insert_", ",_", "text", "\\u", "delete_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "common", "length_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", ",_", "text", "\\u", "insert_", "[_", "-_", "common", "length_", ":_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "=_", "text", "\\u", "insert_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "text", "\\u", "delete_", "[_", ":_", "-_", "common", "length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Delete", " ", "the", " ", "offen", "ding", " ", "record", "s", " ", "and", " ", "add", " ", "the", " ", "merge", "d", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count", "\\u", "delete_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "count", "\\u", "insert_", ":_", "pointer_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "text", "\\u", "insert_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "count", "\\u", "insert_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "count", "\\u", "delete_", ":_", "pointer_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text", "\\u", "delete_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "count", "\\u", "delete_", "-_", "count", "\\u", "insert_", ":_", "pointer_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text", "\\u", "delete_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "text", "\\u", "insert_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "=_", "pointer_", "-_", "count", "\\u", "delete_", "-_", "count", "\\u", "insert_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "count", "\\u", "delete_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count", "\\u", "insert_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "pointer_", "!=_", "0_", "and_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Merge", " ", "this", " ", "equality", " ", "with", " ", "the", " ", "previ", "ous", " ", "one", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "diffs_", "[_", "pointer_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "count", "\\u", "insert_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count", "\\u", "delete_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "delete_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "insert_", "=_", "''_", "\\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_", "diffs_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "pop_", "(_", ")_", "#", " ", "Remove", " ", "the", " ", "dummy", " ", "entry", " ", "at", " ", "the", " ", "end", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Second", " ", "pass", ":", " ", "look", " ", "for", " ", "single", " ", "edits", " ", "surround", "ed", " ", "on", " ", "bot", "h", " ", "side", "s", " ", "by", " ", "equal", "ities_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "can", " ", "be", " ", "shifted", " ", "side", "way", "s", " ", "to", " ", "eliminat", "e", " ", "an", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "e", ".", "g", ":", " ", "A", "<", "ins", ">", "BA", "</", "ins", ">", "C", " ", "->", " ", "<", "ins", ">", "AB", "</", "ins", ">", "AC_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "changes_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inten", "tion", "ally", " ", "ignore", " ", "the", " ", "first", " ", "and", " ", "last", " ", "element", " ", "(", "don", "'", "t", " ", "need", " ", "checking", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "pointer_", "<_", "len_", "(_", "diffs_", ")_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "single", " ", "edit", " ", "surround", "ed", " ", "by", " ", "equal", "iti", "es", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "._", "endswith_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Shi", "ft", " ", "the", " ", "edit", " ", "over", " ", "the", " ", "previ", "ous", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "[_", ":_", "-_", "len_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "._", "startswith_", "(_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Shi", "ft", " ", "the", " ", "edit", " ", "over", " ", "the", " ", "next", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "=_", "(_", "diffs_", "[_", "pointer_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "]_", "[_", "1_", "]_", "[_", "len_", "(_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", ":_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "diffs_", "[_", "pointer_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "changes_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pointer_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "shift", "s", " ", "wer", "e", " ", "made", ",", " ", "the", " ", "diff", " ", "need", "s", " ", "reorder", "ing", " ", "and", " ", "anot", "her", " ", "shift", " ", "sweep", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "changes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "diff", "\\u", "clean", "up", "Merge_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "x", "Index_", "(_", "self_", ",_", "diffs_", ",_", "loc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "loc", " ", "is", " ", "a", " ", "location", " ", "in", " ", "text1", ",", " ", "compute", " ", "and", " ", "return", " ", "the", " ", "equivalent", " ", "location", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "text", "2", ".", " ", " ", "e", ".", "g", ".", " ", "\"", "The", " ", "cat", "\"", " ", "vs", " ", "\"", "The", " ", "big", " ", "cat", "\",", " ", "1", "->", "1", ",", " ", "5", "->", "8", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", " ", " ", "loc", ":", " ", "Locat", "ion", " ", "within", " ", "text1", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Locat", "ion", " ", "within", " ", "text", "2", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "s1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "s2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "char", "s1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "char", "s2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "len_", "(_", "diffs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "op_", ",_", "text_", ")_", "=_", "diffs_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "#", " ", "Equali", "ty", " ", "or", " ", "deletion", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "s1_", "+=_", "len_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "#", " ", "Equali", "ty", " ", "or", " ", "insertion", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "s2_", "+=_", "len_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "char", "s1_", ">_", "loc_", ":_", "#", " ", "Over", "sho", "t", " ", "the", " ", "location", "._", "\\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_", "last", "\\u", "char", "s1_", "=_", "char", "s1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "char", "s2_", "=_", "char", "s2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "diffs_", ")_", "!=_", "x_", "and_", "diffs_", "[_", "x_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "location", " ", "was", " ", "delete", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "last", "\\u", "char", "s2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "rema", "inin", "g", " ", "len", "(", "character", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "last", "\\u", "char", "s2_", "+_", "(_", "loc_", "-_", "last", "\\u", "char", "s1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "pretty", "Html_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Convert", " ", "a", " ", "diff", " ", "array", " ", "int", "o", " ", "a", " ", "pretty", " ", "HTM", "L", " ", "report", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "HTM", "L", " ", "represent", "ation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "(_", "data_", "._", "replace_", "(_", "\"&\"_", ",_", "\"&", "amp", ";\"_", ")_", "._", "replace_", "(_", "\"<\"_", ",_", "\"&", "lt", ";\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "._", "replace_", "(_", "\">\"_", ",_", "\"&", "gt", ";\"_", ")_", "._", "replace_", "(_", "\"\\\\", "n", "\"_", ",_", "\"&", "para", ";<", "br", ">\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "op_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html_", "._", "append_", "(_", "\"<", "ins", " ", "style", "=\\\\\"", "background", ":", "#", "e", "6f", "fe", "6", ";\\\\", "\">", "%", "s", "</", "ins", ">\"_", "%_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html_", "._", "append_", "(_", "\"<", "del", " ", "style", "=\\\\\"", "background", ":", "#", "ffe", "6e", "6", ";\\\\", "\">", "%", "s", "</", "del", ">\"_", "%_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "html_", "._", "append_", "(_", "\"<", "span", ">", "%", "s", "</", "span", ">\"_", "%_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "text1", "_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", " ", "and", " ", "return", " ", "the", " ", "source", " ", "text", " ", "(", "all", " ", "equal", "iti", "es", " ", "and", " ", "deletion", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Sou", "rce", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "text2_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", " ", "and", " ", "return", " ", "the", " ", "destinat", "ion", " ", "text", " ", "(", "all", " ", "equal", "iti", "es", " ", "and", " ", "insertion", "s", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Dest", "ination", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "leve", "nsh", "tein", "_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", " ", "the", " ", "Leve", "nsh", "tein", " ", "distance", ";", " ", "the", " ", "number", " ", "of", " ", "inserted", ",", " ", "delete", "d", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "substitute", "d", " ", "character", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Number", " ", "of", " ", "change", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "leve", "nsh", "tein", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insertion", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deletion", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "insertion", "s_", "+=_", "len_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "deletion", "s_", "+=_", "len_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "deletion", " ", "and", " ", "an", " ", "insertion", " ", "is", " ", "one", " ", "substitution", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "leve", "nsh", "tein", "_", "+=_", "max_", "(_", "insertion", "s_", ",_", "deletion", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insertion", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deletion", "s_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "leve", "nsh", "tein", "_", "+=_", "max_", "(_", "insertion", "s_", ",_", "deletion", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "leve", "nsh", "tein", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "to", "Delta_", "(_", "self_", ",_", "diffs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Cru", "sh", " ", "the", " ", "diff", " ", "int", "o", " ", "an", " ", "encode", "d", " ", "string", " ", "whi", "ch", " ", "descri", "bes", " ", "the", " ", "operati", "ons", "\\", "10", ";", " ", " ", " ", " ", "require", "d", " ", "to", " ", "transform", " ", "text1", " ", "int", "o", " ", "text", "2", ".", "\\", "10", ";", " ", " ", " ", " ", "E", ".", "g", ".", " ", "=", "3", "\\\\", "t", "-", "2", "\\\\", "t", "+", "ing", " ", " ", "->", " ", "Keep", " ", "3", " ", "char", "s", ",", " ", "delete", " ", "2", " ", "char", "s", ",", " ", "insert", " ", "'", "ing", "'.", "\\", "10", ";", " ", " ", " ", " ", "Opera", "tion", "s", " ", "are", " ", "tab", "-", "separate", "d", ".", " ", " ", "Insert", "ed", " ", "text", " ", "is", " ", "escaped", " ", "usi", "ng", " ", "%", "xx", " ", "notation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "diffs", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Del", "ta", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hig", "h", " ", "ascii", " ", "will", " ", "raise", " ", "Unic", "ode", "Decode", "Error", ".", " ", " ", "Us", "e", " ", "Unic", "ode", " ", "inst", "ead", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "data_", "._", "encode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "._", "append_", "(_", "\"+\"_", "+_", "urllib_", "._", "quote_", "(_", "data_", ",_", "\"!", "~", "*'", "();", "/?", ":", "@", "&", "=+", "$", ",#", " ", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "\"-", "%", "d", "\"_", "%_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "\"=", "%", "d", "\"_", "%_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "diff", "\\u", "from", "Delta_", "(_", "self_", ",_", "text1", "_", ",_", "delta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "the", " ", "original", " ", "text1", ",", " ", "and", " ", "an", " ", "encode", "d", " ", "string", " ", "whi", "ch", " ", "descri", "bes", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "operati", "ons", " ", "require", "d", " ", "to", " ", "transform", " ", "text1", " ", "int", "o", " ", "text", "2", ",", " ", "compute", " ", "the", " ", "full", " ", "diff", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text1", ":", " ", "Sou", "rce", " ", "string", " ", "for", " ", "the", " ", "diff", ".", "\\", "10", ";", " ", " ", "delta", ":", " ", "Del", "ta", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "Value", "Error", ":", " ", "If", " ", "invalid", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "delta_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Del", "tas", " ", "shou", "ld", " ", "be", " ", "compose", "d", " ", "of", " ", "a", " ", "subse", "t", " ", "of", " ", "ascii", " ", "char", "s", ",", " ", "Unic", "ode", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "require", "d", ".", " ", " ", "If", " ", "this", " ", "encode", " ", "raise", "s", " ", "Unic", "ode", "Encode", "Error", ",", " ", "delta", " ", "is", " ", "invalid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delta_", "=_", "delta_", "._", "encode_", "(_", "\"", "ascii", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "diffs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "=_", "0_", "#", " ", "Curs", "or", " ", "in", " ", "text1", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "delta_", "._", "split_", "(_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "token_", "in_", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "token_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Blan", "k", " ", "token", "s", " ", "are", " ", "ok", " ", "(", "from", " ", "a", " ", "trail", "ing", " ", "\\\\", "t", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ea", "ch", " ", "token", " ", "begins", " ", "with", " ", "a", " ", "one", " ", "character", " ", "parameter", " ", "whi", "ch", " ", "speci", "fie", "s", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "operati", "on", " ", "of", " ", "this", " ", "token", " ", "(", "delete", ",", " ", "insert", ",", " ", "equality", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "param_", "=_", "token_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token_", "[_", "0_", "]_", "==_", "\"+\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "param_", "=_", "urllib_", "._", "unquote_", "(_", "param_", ")_", "._", "decode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "param_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "token_", "[_", "0_", "]_", "==_", "\"-\"_", "or_", "token_", "[_", "0_", "]_", "==_", "\"=\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "int_", "(_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "number", " ", "in", " ", "diff", "\\u", "from", "Del", "ta", ":", " ", "\"_", "+_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "n_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Nega", "tiv", "e", " ", "number", " ", "in", " ", "diff", "\\u", "from", "Del", "ta", ":", " ", "\"_", "+_", "param_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "text1", "_", "[_", "pointer_", ":_", "pointer_", "+_", "n_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pointer_", "+=_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token_", "[_", "0_", "]_", "==_", "\"=\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "text_", ")_", ")_", "\\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_", "#", " ", "Any", "thing", " ", "else", " ", "is", " ", "an", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "diff", " ", "operati", "on", " ", "in", " ", "diff", "\\u", "from", "Del", "ta", ":", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "token_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pointer_", "!=_", "len_", "(_", "text1", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Del", "ta", " ", "length", " ", "(%", "d", ")", " ", "doe", "s", " ", "not", " ", "equal", " ", "source", " ", "text", " ", "length", " ", "(%", "d", ").\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "pointer_", ",_", "len_", "(_", "text1", "_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match", "\\u", "main_", "(_", "self_", ",_", "text_", ",_", "pattern_", ",_", "loc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Locat", "e", " ", "the", " ", "best", " ", "instance", " ", "of", " ", "'", "pattern", "'", " ", "in", " ", "'", "text", "'", " ", "near", " ", "'", "loc", "'.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text", ":", " ", "The", " ", "text", " ", "to", " ", "search", ".", "\\", "10", ";", " ", " ", "pattern", ":", " ", "The", " ", "pattern", " ", "to", " ", "search", " ", "for", ".", "\\", "10", ";", " ", " ", "loc", ":", " ", "The", " ", "location", " ", "to", " ", "search", " ", "aro", "und", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Bes", "t", " ", "match", " ", "index", " ", "or", " ", "-1", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "null", " ", "inputs", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text_", "==_", "None_", "or_", "pattern_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Null", " ", "inputs", ".", " ", "(", "match", "\\u", "main", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "loc_", "=_", "max_", "(_", "0_", ",_", "min_", "(_", "loc_", ",_", "len_", "(_", "text_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "text_", "==_", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Short", "cut", " ", "(", "potenti", "ally", " ", "not", " ", "guaran", "tee", "d", " ", "by", " ", "the", " ", "algo", "rit", "hm", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "hing", " ", "to", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "text_", "[_", "loc_", ":_", "loc_", "+_", "len_", "(_", "pattern_", ")_", "]_", "==_", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perf", "ect", " ", "match", " ", "at", " ", "the", " ", "perfect", " ", "spot", "!", " ", " ", "(", "Includes", " ", "case", " ", "of", " ", "null", " ", "pattern", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Do", " ", "a", " ", "fuzz", "y", " ", "compare", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "self_", "._", "match", "\\u", "bita", "p_", "(_", "text_", ",_", "pattern_", ",_", "loc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match", "\\u", "bita", "p_", "(_", "self_", ",_", "text_", ",_", "pattern_", ",_", "loc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Locat", "e", " ", "the", " ", "best", " ", "instance", " ", "of", " ", "'", "pattern", "'", " ", "in", " ", "'", "text", "'", " ", "near", " ", "'", "loc", "'", " ", "usi", "ng", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "Bit", "ap", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "text", ":", " ", "The", " ", "text", " ", "to", " ", "search", ".", "\\", "10", ";", " ", " ", "pattern", ":", " ", "The", " ", "pattern", " ", "to", " ", "search", " ", "for", ".", "\\", "10", ";", " ", " ", "loc", ":", " ", "The", " ", "location", " ", "to", " ", "search", " ", "aro", "und", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Bes", "t", " ", "match", " ", "index", " ", "or", " ", "-1", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "doe", "sn", "'", "t", " ", "have", " ", "a", " ", "maxi", "nt", " ", "limit", ",", " ", "so", " ", "ignore", " ", "this", " ", "check", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "self", ".", "Match", "\\u", "Max", "Bit", "s", " ", "!=", " ", "0", " ", "and", " ", "len", "(", "pattern", ")", " ", ">", " ", "self", ".", "Match", "\\u", "Max", "Bit", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "raise", " ", "Value", "Error", "(\"", "Pat", "tern", " ", "too", " ", "long", " ", "for", " ", "this", " ", "applica", "tion", ".\"", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", " ", "the", " ", "alpha", "bet", "._", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "self_", "._", "match", "\\u", "alphabet_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "match", "\\u", "bita", "p", "Score_", "(_", "e_", ",_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", " ", "and", " ", "return", " ", "the", " ", "score", " ", "for", " ", "a", " ", "match", " ", "with", " ", "e", " ", "error", "s", " ", "and", " ", "x", " ", "location", ".", "\\", "10", ";", " ", " ", "Access", "es", " ", "loc", " ", "and", " ", "pattern", " ", "through", " ", "bei", "ng", " ", "a", " ", "clos", "ure", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "e", ":", " ", "Number", " ", "of", " ", "error", "s", " ", "in", " ", "match", ".", "\\", "10", ";", " ", " ", " ", " ", "x", ":", " ", "Locat", "ion", " ", "of", " ", "match", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "Over", "all", " ", "score", " ", "for", " ", "match", " ", "(", "0.", "0", " ", "=", " ", "good", ",", " ", "1.0", " ", "=", " ", "bad", ").", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "accuracy_", "=_", "float_", "(_", "e_", ")_", "/_", "len_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proxim", "ity_", "=_", "abs_", "(_", "loc_", "-_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "Match", "\\u", "Distance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Dod", "ge", " ", "divide", " ", "by", " ", "zero", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "proxim", "ity_", "and_", "1.0_", "or_", "accuracy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "accuracy_", "+_", "(_", "proxim", "ity_", "/_", "float_", "(_", "self_", "._", "Match", "\\u", "Distance_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Highe", "st", " ", "score", " ", "be", "yon", "d", " ", "whi", "ch", " ", "we", " ", "give", " ", "up", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "score", "\\u", "threshold_", "=_", "self_", "._", "Match", "\\u", "Threshold_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Is", " ", "there", " ", "a", " ", "nearby", " ", "exact", " ", "match", "?", " ", "(", "speed", "up", ")_", "\\u\\u\\uNL\\u\\u\\u_", "best", "\\u", "loc_", "=_", "text_", "._", "find_", "(_", "pattern_", ",_", "loc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "best", "\\u", "loc_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score", "\\u", "threshold_", "=_", "min_", "(_", "match", "\\u", "bita", "p", "Score_", "(_", "0_", ",_", "best", "\\u", "loc_", ")_", ",_", "score", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "What", " ", "abo", "ut", " ", "in", " ", "the", " ", "other", " ", "direction", "?", " ", "(", "speed", "up", ")_", "\\u\\u\\uNL\\u\\u\\u_", "best", "\\u", "loc_", "=_", "text_", "._", "rfind_", "(_", "pattern_", ",_", "loc_", "+_", "len_", "(_", "pattern_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "best", "\\u", "loc_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score", "\\u", "threshold_", "=_", "min_", "(_", "match", "\\u", "bita", "p", "Score_", "(_", "0_", ",_", "best", "\\u", "loc_", ")_", ",_", "score", "\\u", "threshold_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", " ", "the", " ", "bit", " ", "arrays", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match", "mask_", "=_", "1_", "<<_", "(_", "len_", "(_", "pattern_", ")_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "loc_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "bin", "\\u", "max_", "=_", "len_", "(_", "pattern_", ")_", "+_", "len_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Emp", "ty", " ", "initialization", " ", "adde", "d", " ", "to", " ", "appe", "ase", " ", "pyche", "cker", "._", "\\u\\u\\uNL\\u\\u\\u_", "last", "\\u", "rd_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d_", "in_", "xrange_", "(_", "len_", "(_", "pattern_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Sca", "n", " ", "for", " ", "the", " ", "best", " ", "match", " ", "each", " ", "iterati", "on", " ", "allow", "s", " ", "for", " ", "one", " ", "more", " ", "error", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "a", " ", "binar", "y", " ", "search", " ", "to", " ", "dete", "rmin", "e", " ", "how", " ", "far", " ", "from", " ", "'", "loc", "'", " ", "we", " ", "can", " ", "stra", "y", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "error", " ", "level", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "\\u", "min_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bin", "\\u", "mid_", "=_", "bin", "\\u", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "bin", "\\u", "min_", "<_", "bin", "\\u", "mid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "match", "\\u", "bita", "p", "Score_", "(_", "d_", ",_", "loc_", "+_", "bin", "\\u", "mid_", ")_", "<=_", "score", "\\u", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "\\u", "min_", "=_", "bin", "\\u", "mid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bin", "\\u", "max_", "=_", "bin", "\\u", "mid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bin", "\\u", "mid_", "=_", "(_", "bin", "\\u", "max_", "-_", "bin", "\\u", "min_", ")_", "//_", "2_", "+_", "bin", "\\u", "min_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "the", " ", "result", " ", "from", " ", "this", " ", "iterati", "on", " ", "as", " ", "the", " ", "maxim", "um", " ", "for", " ", "the", " ", "next", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "bin", "\\u", "max_", "=_", "bin", "\\u", "mid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "max_", "(_", "1_", ",_", "loc_", "-_", "bin", "\\u", "mid_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finish_", "=_", "min_", "(_", "loc_", "+_", "bin", "\\u", "mid_", ",_", "len_", "(_", "text_", ")_", ")_", "+_", "len_", "(_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rd_", "=_", "[_", "0_", "]_", "*_", "(_", "finish_", "+_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rd_", "[_", "finish_", "+_", "1_", "]_", "=_", "(_", "1_", "<<_", "d_", ")_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "finish_", ",_", "start_", "-_", "1_", ",_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "text_", ")_", "<=_", "j_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Out", " ", "of", " ", "range", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "Match_", "=_", "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 ", " _", "char", "Match_", "=_", "s_", "._", "get_", "(_", "text_", "[_", "j_", "-_", "1_", "]_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "==_", "0_", ":_", "#", " ", "Fi", "rst", " ", "pass", ":", " ", "exact", " ", "match", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rd_", "[_", "j_", "]_", "=_", "(_", "(_", "rd_", "[_", "j_", "+_", "1_", "]_", "<<_", "1_", ")_", "|_", "1_", ")_", "&_", "char", "Match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "Subs", "eque", "nt", " ", "pass", "es", ":", " ", "fuzz", "y", " ", "match", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rd_", "[_", "j_", "]_", "=_", "(_", "(_", "(_", "rd_", "[_", "j_", "+_", "1_", "]_", "<<_", "1_", ")_", "|_", "1_", ")_", "&_", "char", "Match_", ")_", "|_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "(_", "last", "\\u", "rd_", "[_", "j_", "+_", "1_", "]_", "|_", "last", "\\u", "rd_", "[_", "j_", "]_", ")_", "<<_", "1_", ")_", "|_", "1_", ")_", "|_", "last", "\\u", "rd_", "[_", "j_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rd_", "[_", "j_", "]_", "&_", "match", "mask_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "match", "\\u", "bita", "p", "Score_", "(_", "d_", ",_", "j_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "match", " ", "will", " ", "alm", "ost", " ", "cert", "ain", "ly", " ", "be", " ", "bett", "er", " ", "than", " ", "any", " ", "exist", "ing", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bu", "t", " ", "check", " ", "anyway", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "score_", "<=_", "score", "\\u", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tol", "d", " ", "you", " ", "so", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score", "\\u", "threshold_", "=_", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "\\u", "loc_", "=_", "j_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "best", "\\u", "loc_", ">_", "loc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "n", " ", "passi", "ng", " ", "loc", ",", " ", "don", "'", "t", " ", "exceed", " ", "our", " ", "current", " ", "distance", " ", "from", " ", "loc", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "max_", "(_", "1_", ",_", "2_", "*_", "loc_", "-_", "best", "\\u", "loc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Al", "read", "y", " ", "pass", "ed", " ", "loc", ",", " ", "down", "hill", " ", "from", " ", "here", " ", "on", " ", "in", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "hop", "e", " ", "for", " ", "a", " ", "(", "bett", "er", ")", " ", "match", " ", "at", " ", "great", "er", " ", "error", " ", "level", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "match", "\\u", "bita", "p", "Score_", "(_", "d_", "+_", "1_", ",_", "loc_", ")_", ">_", "score", "\\u", "threshold_", ":_", "\\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_", "last", "\\u", "rd_", "=_", "rd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "best", "\\u", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "match", "\\u", "alphabet_", "(_", "self_", ",_", "pattern_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initialise", " ", "the", " ", "alpha", "bet", " ", "for", " ", "the", " ", "Bit", "ap", " ", "algo", "rit", "hm", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "pattern", ":", " ", "The", " ", "text", " ", "to", " ", "encode", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Hash", " ", "of", " ", "character", " ", "location", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "char_", "in_", "pattern_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "[_", "char_", "]_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "len_", "(_", "pattern_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "[_", "pattern_", "[_", "i_", "]_", "]_", "|=_", "1_", "<<_", "(_", "len_", "(_", "pattern_", ")_", "-_", "i_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "add", "Context_", "(_", "self_", ",_", "patch_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Increase", " ", "the", " ", "context", " ", "unti", "l", " ", "it", " ", "is", " ", "unique", ",", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "don", "'", "t", " ", "let", " ", "the", " ", "pattern", " ", "expand", " ", "be", "yon", "d", " ", "Match", "\\u", "Max", "Bit", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patch", ":", " ", "The", " ", "patch", " ", "to", " ", "grow", ".", "\\", "10", ";", " ", " ", "text", ":", " ", "Sou", "rce", " ", "text", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "text_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pattern_", "=_", "text_", "[_", "patch_", "._", "start", "2_", ":_", "patch_", "._", "start", "2_", "+_", "patch_", "._", "length", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "padding_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Look", " ", "for", " ", "the", " ", "first", " ", "and", " ", "last", " ", "matche", "s", " ", "of", " ", "pattern", " ", "in", " ", "text", ".", " ", " ", "If", " ", "two", " ", "different", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "matche", "s", " ", "are", " ", "found", ",", " ", "increase", " ", "the", " ", "pattern", " ", "length", "._", "\\u\\u\\uNL\\u\\u\\u_", "while_", "(_", "text_", "._", "find_", "(_", "pattern_", ")_", "!=_", "text_", "._", "rfind_", "(_", "pattern_", ")_", "and_", "(_", "self_", "._", "Match", "\\u", "Max", "Bits_", "==_", "\\u\\u\\uNL\\u\\u\\u_", "0_", "or_", "len_", "(_", "pattern_", ")_", "<_", "self_", "._", "Match", "\\u", "Max", "Bits_", "-_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Pat", "ch", "\\u", "Margin_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "padding_", "+=_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pattern_", "=_", "text_", "[_", "max_", "(_", "0_", ",_", "patch_", "._", "start", "2_", "-_", "padding_", ")_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "patch_", "._", "start", "2_", "+_", "patch_", "._", "length", "1_", "+_", "padding_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "one", " ", "chunk", " ", "for", " ", "good", " ", "luck", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "padding_", "+=_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "prefix", "._", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "text_", "[_", "max_", "(_", "0_", ",_", "patch_", "._", "start", "2_", "-_", "padding_", ")_", ":_", "patch_", "._", "start", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "[_", ":_", "0_", "]_", "=_", "[_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "prefix_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "suff", "ix", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suffix_", "=_", "text_", "[_", "patch_", "._", "start", "2_", "+_", "patch_", "._", "length", "1_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "patch_", "._", "start", "2_", "+_", "patch_", "._", "length", "1_", "+_", "padding_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "suffix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "suffix_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Roll", " ", "back", " ", "the", " ", "start", " ", "points", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "._", "start", "1_", "-=_", "len_", "(_", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "-=_", "len_", "(_", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Extend", " ", "length", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "prefix_", ")_", "+_", "len_", "(_", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "prefix_", ")_", "+_", "len_", "(_", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "make_", "(_", "self_", ",_", "a_", ",_", "b_", "=_", "None_", ",_", "c_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", " ", "a", " ", "list", " ", "of", " ", "patche", "s", " ", "to", " ", "turn", " ", "text1", " ", "int", "o", " ", "text", "2", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "diffs", " ", "if", " ", "provided", ",", " ", "other", "wis", "e", " ", "compute", " ", "it", " ", "ours", "elv", "es", ".", "\\", "10", ";", " ", " ", " ", " ", "There", " ", "are", " ", "four", " ", "way", "s", " ", "to", " ", "call", " ", "this", " ", "function", ",", " ", "depend", "ing", " ", "on", " ", "what", " ", "data", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "avail", "able", " ", "to", " ", "the", " ", "caller", ":", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "1", ":", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "=", " ", "text1", ",", " ", "b", " ", "=", " ", "text", "2", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "2", ":", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "=", " ", "diffs", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "3", " ", "(", "optim", "al", "):", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "=", " ", "text1", ",", " ", "b", " ", "=", " ", "diffs", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "4", " ", "(", "depre", "cated", ",", " ", "use", " ", "method", " ", "3", "):", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "=", " ", "text1", ",", " ", "b", " ", "=", " ", "text", "2", ",", " ", "c", " ", "=", " ", "diffs", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "a", ":", " ", "text1", " ", "(", "method", "s", " ", "1", ",", "3", ",", "4", ")", " ", "or", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", " ", "for", " ", "text1", " ", "to", "\\", "10", ";", " ", " ", "text", "2", " ", "(", "method", " ", "2", ").", "\\", "10", ";", " ", " ", "b", ":", " ", "text", "2", " ", "(", "method", "s", " ", "1", ",", "4", ")", " ", "or", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", " ", "for", " ", "text1", " ", "to", "\\", "10", ";", " ", " ", "text", "2", " ", "(", "method", " ", "3", ")", " ", "or", " ", "undefined", " ", "(", "method", " ", "2", ").", "\\", "10", ";", " ", " ", "c", ":", " ", "Array", " ", "of", " ", "diff", " ", "tuple", "s", " ", "for", " ", "text1", " ", "to", " ", "text", "2", " ", "(", "method", " ", "4", ")", " ", "or", "\\", "10", ";", " ", " ", "undefined", " ", "(", "method", "s", " ", "1", ",", "2", ",", "3", ").", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "texts", " ", "may", " ", "arrive", " ", "as", " ", "'", "str", "'", " ", "or", " ", "'", "unicode", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "a_", ",_", "basestring_", ")_", "and_", "isinstance_", "(_", "b_", ",_", "basestring_", ")_", "and_", "c_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "1", ":", " ", "text1", ",", " ", "text2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "diffs", " ", "from", " ", "text1", " ", "and", " ", "text", "2._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text1", "_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "_", ",_", "b_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "diffs_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "diff", "\\u", "clean", "up", "Semantic", "_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "diff", "\\u", "clean", "up", "Efficien", "cy_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "a_", ",_", "list_", ")_", "and_", "b_", "is_", "None_", "and_", "c_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "2", ":", " ", "diffs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "text1", " ", "from", " ", "diffs", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "self_", "._", "diff", "\\u", "text1", "_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "a_", ",_", "basestring_", ")_", "and_", "isinstance_", "(_", "b_", ",_", "list_", ")_", "and_", "c_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "3", ":", " ", "text1", ",", " ", "diffs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text1", "_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "isinstance_", "(_", "a_", ",_", "basestring_", ")_", "and_", "isinstance_", "(_", "b_", ",_", "basestring_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "c_", ",_", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Meth", "od", " ", "4", ":", " ", "text1", ",", " ", "text", "2", ",", " ", "diffs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "text", "2", " ", "is", " ", "not", " ", "used", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text1", "_", "=_", "a_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "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 ", " _", "raise_", "Value", "Error_", "(_", "\"", "Un", "know", "n", " ", "call", " ", "format", " ", "to", " ", "patch", "\\u", "make", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "#", " ", "Get", " ", "rid", " ", "of", " ", "the", " ", "Non", "e", " ", "case", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "=_", "patch", "\\u", "obj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "\\u", "count", "1_", "=_", "0_", "#", " ", "Number", " ", "of", " ", "character", "s", " ", "int", "o", " ", "the", " ", "text1", " ", "string", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "\\u", "count", "2_", "=_", "0_", "#", " ", "Number", " ", "of", " ", "character", "s", " ", "int", "o", " ", "the", " ", "text", "2", " ", "string", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prep", "atch", "\\u", "text_", "=_", "text1", "_", "#", " ", "Rec", "reate", " ", "the", " ", "patche", "s", " ", "to", " ", "dete", "rmin", "e", " ", "context", " ", "info", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "postp", "atch", "\\u", "text_", "=_", "text1", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "len_", "(_", "diffs_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "diff", "\\u", "type_", ",_", "diff", "\\u", "text_", ")_", "=_", "diffs_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "patch_", "._", "diffs_", ")_", "==_", "0_", "and_", "diff", "\\u", "type_", "!=_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "new", " ", "patch", " ", "starts", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "start", "1_", "=_", "char", "\\u", "count", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "=_", "char", "\\u", "count", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inserti", "on_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "diffs_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "postp", "atch", "\\u", "text_", "=_", "(_", "postp", "atch", "\\u", "text_", "[_", ":_", "char", "\\u", "count", "2_", "]_", "+_", "diff", "\\u", "text_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "postp", "atch", "\\u", "text_", "[_", "char", "\\u", "count", "2_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Deletion", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "diffs_", "._", "append_", "(_", "diffs_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "postp", "atch", "\\u", "text_", "=_", "(_", "postp", "atch", "\\u", "text_", "[_", ":_", "char", "\\u", "count", "2_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "postp", "atch", "\\u", "text_", "[_", "char", "\\u", "count", "2_", "+_", "len_", "(_", "diff", "\\u", "text_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "diff", "\\u", "text_", ")_", "<=_", "2_", "*_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "patch_", "._", "diffs_", ")_", "!=_", "0_", "and_", "len_", "(_", "diffs_", ")_", "!=_", "x_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Small", " ", "equality", " ", "insi", "de", " ", "a", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "diffs_", "[_", "x_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "diff", "\\u", "text_", ")_", ">=_", "2_", "*_", "self_", "._", "Pat", "ch", "\\u", "Margin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Time", " ", "for", " ", "a", " ", "new", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "patch_", "._", "diffs_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "add", "Context_", "(_", "patch_", ",_", "prep", "atch", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "._", "append_", "(_", "patch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "=_", "patch", "\\u", "obj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Unli", "ke", " ", "Uni", "diff", ",", " ", "our", " ", "patch", " ", "lists", " ", "have", " ", "a", " ", "rolling", " ", "context", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "code", ".", "google", ".", "com", "/", "p", "/", "google", "-", "diff", "-", "match", "-", "patch", "/", "wiki", "/", "Uni", "diff_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Update", " ", "prep", "atch", " ", "text", " ", "&", " ", "pos", " ", "to", " ", "reflect", " ", "the", " ", "applica", "tion", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "just", " ", "complete", "d", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "prep", "atch", "\\u", "text_", "=_", "postp", "atch", "\\u", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "char", "\\u", "count", "1_", "=_", "char", "\\u", "count", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Update", " ", "the", " ", "current", " ", "character", " ", "count", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "diff", "\\u", "type_", "!=_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "\\u", "count", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "diff", "\\u", "type_", "!=_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "char", "\\u", "count", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pick", " ", "up", " ", "the", " ", "lefto", "ver", " ", "patch", " ", "if", " ", "not", " ", "empty", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "patch_", "._", "diffs_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "patch", "\\u", "add", "Context_", "(_", "patch_", ",_", "prep", "atch", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "._", "append_", "(_", "patch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "patches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "deep", "Copy_", "(_", "self_", ",_", "patches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "an", " ", "array", " ", "of", " ", "patche", "s", ",", " ", "return", " ", "anot", "her", " ", "array", " ", "tha", "t", " ", "is", " ", "identi", "cal", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patche", "s", ":", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patche", "s", "Copy_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "patch_", "in_", "patches_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch", "Copy_", "=_", "patch", "\\u", "obj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "need", " ", "to", " ", "deep", " ", "copy", " ", "the", " ", "tuple", "s", " ", "sinc", "e", " ", "the", "y", " ", "are", " ", "immutable", "._", "\\u\\u\\uNL\\u\\u\\u_", "patch", "Copy_", "._", "diffs_", "=_", "patch_", "._", "diffs_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "Copy_", "._", "start", "1_", "=_", "patch_", "._", "start", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "Copy_", "._", "start", "2_", "=_", "patch_", "._", "start", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "Copy_", "._", "length", "1_", "=_", "patch_", "._", "length", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "Copy_", "._", "length", "2_", "=_", "patch_", "._", "length", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patche", "s", "Copy_", "._", "append_", "(_", "patch", "Copy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "patche", "s", "Copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "apply_", "(_", "self_", ",_", "patches_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Merge", " ", "a", " ", "set", " ", "of", " ", "patche", "s", " ", "onto", " ", "the", " ", "text", ".", " ", " ", "Return", " ", "a", " ", "patche", "d", " ", "text", ",", " ", "as", " ", "well", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "a", " ", "list", " ", "of", " ", "true", "/", "fal", "se", " ", "values", " ", "indicati", "ng", " ", "whi", "ch", " ", "patche", "s", " ", "wer", "e", " ", "applied", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patche", "s", ":", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", " ", " ", "text", ":", " ", "Old", " ", "text", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Tw", "o", " ", "element", " ", "Array", ",", " ", "contain", "ing", " ", "the", " ", "new", " ", "text", " ", "and", " ", "an", " ", "array", " ", "of", " ", "boolean", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "patches_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "text_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "De", "ep", " ", "copy", " ", "the", " ", "patche", "s", " ", "so", " ", "tha", "t", " ", "no", " ", "change", "s", " ", "are", " ", "made", " ", "to", " ", "original", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patches_", "=_", "self_", "._", "patch", "\\u", "deep", "Copy_", "(_", "patches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "null", "Padding_", "=_", "self_", "._", "patch", "\\u", "add", "Padding_", "(_", "patches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "null", "Padding_", "+_", "text_", "+_", "null", "Padding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "patch", "\\u", "split", "Max_", "(_", "patches_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delta", " ", "keep", "s", " ", "track", " ", "of", " ", "the", " ", "offset", " ", "bet", "ween", " ", "the", " ", "expected", " ", "and", " ", "actual", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "previ", "ous", " ", "patch", ".", " ", " ", "If", " ", "there", " ", "are", " ", "patche", "s", " ", "expected", " ", "at", " ", "position", "s", " ", "10", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "20", ",", " ", "but", " ", "the", " ", "first", " ", "patch", " ", "was", " ", "found", " ", "at", " ", "1", "2", ",", " ", "delta", " ", "is", " ", "2", " ", "and", " ", "the", " ", "second", " ", "patch_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "an", " ", "effective", " ", "expected", " ", "position", " ", "of", " ", "22.", "_", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "patch_", "in_", "patches_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expected", "\\u", "loc_", "=_", "patch_", "._", "start", "2_", "+_", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text1", "_", "=_", "self_", "._", "diff", "\\u", "text1", "_", "(_", "patch_", "._", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "loc_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "text1", "_", ")_", ">_", "self_", "._", "Match", "\\u", "Max", "Bits_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "patch", "\\u", "split", "Max", " ", "will", " ", "only", " ", "provide", " ", "an", " ", "overs", "ize", "d", " ", "pattern", " ", "in", " ", "the", " ", "case", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "monster", " ", "delete", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "loc_", "=_", "self_", "._", "match", "\\u", "main_", "(_", "text_", ",_", "text1", "_", "[_", ":_", "self_", "._", "Match", "\\u", "Max", "Bits_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "loc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start", "\\u", "loc_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "end", "\\u", "loc_", "=_", "self_", "._", "match", "\\u", "main_", "(_", "text_", ",_", "text1", "_", "[_", "-_", "self_", "._", "Match", "\\u", "Max", "Bits_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expected", "\\u", "loc_", "+_", "len_", "(_", "text1", "_", ")_", "-_", "self_", "._", "Match", "\\u", "Max", "Bits_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "end", "\\u", "loc_", "==_", "-_", "1_", "or_", "start", "\\u", "loc_", ">=_", "end", "\\u", "loc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Can", "'", "t", " ", "find", " ", "valid", " ", "trail", "ing", " ", "context", ".", " ", " ", "Drop", " ", "this", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "loc_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "loc_", "=_", "self_", "._", "match", "\\u", "main_", "(_", "text_", ",_", "text1", "_", ",_", "expected", "\\u", "loc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "start", "\\u", "loc_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "match", " ", "found", ".", " ", " ", ":(", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "._", "append_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Subtract", " ", "the", " ", "delta", " ", "for", " ", "this", " ", "fail", "ed", " ", "patch", " ", "from", " ", "subsequen", "t", " ", "patche", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "delta_", "-=_", "patch_", "._", "length", "2_", "-_", "patch_", "._", "length", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Foun", "d", " ", "a", " ", "match", ".", " ", " ", ":)", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "._", "append_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delta_", "=_", "start", "\\u", "loc_", "-_", "expected", "\\u", "loc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "end", "\\u", "loc_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text2_", "=_", "text_", "[_", "start", "\\u", "loc_", ":_", "start", "\\u", "loc_", "+_", "len_", "(_", "text1", "_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text2_", "=_", "text_", "[_", "start", "\\u", "loc_", ":_", "end", "\\u", "loc_", "+_", "self_", "._", "Match", "\\u", "Max", "Bits_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "text1", "_", "==_", "text2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perf", "ect", " ", "match", ",", " ", "just", " ", "sho", "ve", " ", "the", " ", "replace", "ment", " ", "text", " ", "in", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "(_", "text_", "[_", ":_", "start", "\\u", "loc_", "]_", "+_", "self_", "._", "diff", "\\u", "text2_", "(_", "patch_", "._", "diffs_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "[_", "start", "\\u", "loc_", "+_", "len_", "(_", "text1", "_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Impe", "rf", "ect", " ", "match", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Run", " ", "a", " ", "diff", " ", "to", " ", "get", " ", "a", " ", "frame", "work", " ", "of", " ", "equivalent", " ", "indice", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "=_", "self_", "._", "diff", "\\u", "main_", "(_", "text1", "_", ",_", "text2_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "len_", "(_", "text1", "_", ")_", ">_", "self_", "._", "Match", "\\u", "Max", "Bits_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "diff", "\\u", "leve", "nsh", "tein", "_", "(_", "diffs_", ")_", "/_", "float_", "(_", "len_", "(_", "text1", "_", ")_", ")_", ">_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Pat", "ch", "\\u", "Delete", "Threshold_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "end", " ", "points", " ", "match", ",", " ", "but", " ", "the", " ", "content", " ", "is", " ", "una", "cce", "pta", "bly", " ", "bad", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "results_", "[_", "-_", "1_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "diff", "\\u", "clean", "up", "Semantic", "Lo", "ssl", "ess_", "(_", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "patch_", "._", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index2_", "=_", "self_", "._", "diff", "\\u", "x", "Index_", "(_", "diffs_", ",_", "index1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "op_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "#", " ", "Inserti", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "text_", "[_", ":_", "start", "\\u", "loc_", "+_", "index2_", "]_", "+_", "data_", "+_", "text_", "[_", "start", "\\u", "loc_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "index2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "#", " ", "Deletion", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "text_", "[_", ":_", "start", "\\u", "loc_", "+_", "index2_", "]_", "+_", "text_", "[_", "start", "\\u", "loc_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "diff", "\\u", "x", "Index_", "(_", "diffs_", ",_", "index1_", "+_", "len_", "(_", "data_", ")_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "op_", "!=_", "self_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index1_", "+=_", "len_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Strip", " ", "the", " ", "padd", "ing", " ", "off", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "text_", "[_", "len_", "(_", "null", "Padding_", ")_", ":_", "-_", "len_", "(_", "null", "Padding_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "text_", ",_", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "add", "Padding_", "(_", "self_", ",_", "patches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "some", " ", "padd", "ing", " ", "on", " ", "text", " ", "start", " ", "and", " ", "end", " ", "so", " ", "tha", "t", " ", "edge", "s", " ", "can", " ", "match", "\\", "10", ";", " ", " ", " ", " ", "somet", "hing", ".", " ", " ", "Inten", "ded", " ", "to", " ", "be", " ", "call", "ed", " ", "only", " ", "from", " ", "within", " ", "patch", "\\u", "appl", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patche", "s", ":", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "padd", "ing", " ", "string", " ", "adde", "d", " ", "to", " ", "each", " ", "side", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "padd", "ing", "Length_", "=_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "null", "Padding_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "1_", ",_", "padd", "ing", "Length_", "+_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "null", "Padding_", "+=_", "chr_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Bu", "mp", " ", "all", " ", "the", " ", "patche", "s", " ", "forward", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "patch_", "in_", "patches_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "start", "1_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "some", " ", "padd", "ing", " ", "on", " ", "start", " ", "of", " ", "first", " ", "diff", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "=_", "patches_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "patch_", "._", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "diffs_", "or_", "diffs_", "[_", "0_", "]_", "[_", "0_", "]_", "!=_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "null", "Padd", "ing", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "insert_", "(_", "0_", ",_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "null", "Padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "1_", "-=_", "padd", "ing", "Length_", "#", " ", "Sho", "ul", "d", " ", "be", " ", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "-=_", "padd", "ing", "Length_", "#", " ", "Sho", "ul", "d", " ", "be", " ", "0._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "padd", "ing", "Length_", ">_", "len_", "(_", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grow", " ", "first", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "Length_", "=_", "padd", "ing", "Length_", "-_", "len_", "(_", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Text_", "=_", "null", "Padding_", "[_", "len_", "(_", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", ":_", "]_", "+_", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "0_", "]_", "=_", "(_", "diffs_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "new", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "1_", "-=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "-=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "some", " ", "padd", "ing", " ", "on", " ", "end", " ", "of", " ", "last", " ", "diff", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "=_", "patches_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "=_", "patch_", "._", "diffs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "diffs_", "or_", "diffs_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "!=_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "null", "Padd", "ing", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "null", "Padding_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "padd", "ing", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "padd", "ing", "Length_", ">_", "len_", "(_", "diffs_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grow", " ", "last", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "Length_", "=_", "padd", "ing", "Length_", "-_", "len_", "(_", "diffs_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "Text_", "=_", "diffs_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "null", "Padding_", "[_", ":_", "extra", "Length_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "diffs_", "[_", "-_", "1_", "]_", "=_", "(_", "diffs_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", ",_", "new", "Text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "extra", "Length_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "null", "Padding_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "split", "Max_", "(_", "self_", ",_", "patches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Look", " ", "through", " ", "the", " ", "patche", "s", " ", "and", " ", "break", " ", "up", " ", "any", " ", "whi", "ch", " ", "are", " ", "long", "er", " ", "than", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "maxim", "um", " ", "limit", " ", "of", " ", "the", " ", "match", " ", "algo", "rit", "hm", ".", "\\", "10", ";", " ", " ", " ", " ", "Inten", "ded", " ", "to", " ", "be", " ", "call", "ed", " ", "only", " ", "from", " ", "within", " ", "patch", "\\u", "appl", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patche", "s", ":", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch", "\\u", "size_", "=_", "self_", "._", "Match", "\\u", "Max", "Bits_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "patch", "\\u", "size_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "has", " ", "the", " ", "option", " ", "of", " ", "not", " ", "splitting", " ", "string", "s", " ", "due", " ", "to", " ", "its", " ", "ability_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "handle", " ", "integ", "ers", " ", "of", " ", "arbitra", "ry", " ", "preci", "sion", "._", "\\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_", "for_", "x_", "in_", "xrange_", "(_", "len_", "(_", "patches_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "patches_", "[_", "x_", "]_", "._", "length", "1_", "<=_", "patch", "\\u", "size_", ":_", "\\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_", "big", "patch_", "=_", "patches_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Remove", " ", "the", " ", "big", " ", "old", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "del_", "patches_", "[_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "1_", "=_", "big", "patch_", "._", "start", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "2_", "=_", "big", "patch_", "._", "start", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "precon", "text_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "big", "patch_", "._", "diffs_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "one", " ", "of", " ", "sever", "al", " ", "small", "er", " ", "patche", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "=_", "patch", "\\u", "obj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "1_", "=_", "start", "1_", "-_", "len_", "(_", "precon", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "2_", "=_", "start", "2_", "-_", "len_", "(_", "precon", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "precon", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "1_", "=_", "patch_", "._", "length", "2_", "=_", "len_", "(_", "precon", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "precon", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "while_", "(_", "len_", "(_", "big", "patch_", "._", "diffs_", ")_", "!=_", "0_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "patch_", "._", "length", "1_", "<_", "patch", "\\u", "size_", "-_", "self_", "._", "Pat", "ch", "\\u", "Margin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "diff", "\\u", "type_", ",_", "diff", "\\u", "text_", ")_", "=_", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inserti", "ons", " ", "are", " ", "harm", "less", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "diffs_", "._", "append_", "(_", "big", "patch_", "._", "diffs_", "._", "pop_", "(_", "0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "DELETE_", "and_", "len_", "(_", "patch_", "._", "diffs_", ")_", "==_", "1_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "patch_", "._", "diffs_", "[_", "0_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "diff", "\\u", "text_", ")_", ">_", "2_", "*_", "patch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "a", " ", "large", " ", "deletion", ".", " ", " ", "Let", " ", "it", " ", "pass", " ", "in", " ", "one", " ", "chunk", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "empty_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "diff", "\\u", "type_", ",_", "diff", "\\u", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Deletion", " ", "or", " ", "equality", ".", " ", " ", "On", "ly", " ", "take", " ", "as", " ", "muc", "h", " ", "as", " ", "we", " ", "can", " ", "sto", "mach", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diff", "\\u", "text_", "=_", "diff", "\\u", "text_", "[_", ":_", "patch", "\\u", "size_", "-_", "patch_", "._", "length", "1_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "1_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diff", "\\u", "type_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "2_", "+=_", "len_", "(_", "diff", "\\u", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "empty_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "diff", "\\u", "type_", ",_", "diff", "\\u", "text_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diff", "\\u", "text_", "==_", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "big", "patch_", "._", "diffs_", "[_", "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 ", " _", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "=_", "(_", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "big", "patch_", "._", "diffs_", "[_", "0_", "]_", "[_", "1_", "]_", "[_", "len_", "(_", "diff", "\\u", "text_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "the", " ", "head", " ", "context", " ", "for", " ", "the", " ", "next", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "precon", "text_", "=_", "self_", "._", "diff", "\\u", "text2_", "(_", "patch_", "._", "diffs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "precon", "text_", "=_", "precon", "text_", "[_", "-_", "self_", "._", "Pat", "ch", "\\u", "Margin_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Append", " ", "the", " ", "end", " ", "context", " ", "for", " ", "this", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "postc", "onte", "xt_", "=_", "self_", "._", "diff", "\\u", "text1", "_", "(_", "big", "patch_", "._", "diffs_", ")_", "[_", ":_", "self_", "._", "Pat", "ch", "\\u", "Margin_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "postc", "onte", "xt_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "1_", "+=_", "len_", "(_", "postc", "onte", "xt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "+=_", "len_", "(_", "postc", "onte", "xt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "patch_", "._", "diffs_", ")_", "!=_", "0_", "and_", "patch_", "._", "diffs_", "[_", "-_", "1_", "]_", "[_", "0_", "]_", "==_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "[_", "-_", "1_", "]_", "=_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "patch_", "._", "diffs_", "[_", "-_", "1_", "]_", "[_", "1_", "]_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "postc", "onte", "xt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "postc", "onte", "xt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "x_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "._", "insert_", "(_", "x_", ",_", "patch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "to", "Text_", "(_", "self_", ",_", "patches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Tak", "e", " ", "a", " ", "list", " ", "of", " ", "patche", "s", " ", "and", " ", "return", " ", "a", " ", "textu", "al", " ", "represent", "ation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "patche", "s", ":", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Text", " ", "represent", "ation", " ", "of", " ", "patche", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "patch_", "in_", "patches_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "str_", "(_", "patch_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "diff", "\\u", "match", "\\u", "patch_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "patch", "\\u", "from", "Text_", "(_", "self_", ",_", "textl", "ine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pars", "e", " ", "a", " ", "textu", "al", " ", "represent", "ation", " ", "of", " ", "patche", "s", " ", "and", " ", "return", " ", "a", " ", "list", " ", "of", " ", "patch", "\\", "10", ";", " ", " ", " ", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Arg", "s", ":", "\\", "10", ";", " ", " ", "textl", "ine", ":", " ", "Text", " ", "represent", "ation", " ", "of", " ", "patche", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "Array", " ", "of", " ", "Pat", "ch", " ", "object", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Rai", "ses", ":", "\\", "10", ";", " ", " ", "Value", "Error", ":", " ", "If", " ", "invalid", " ", "input", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "textl", "ine_", ")_", "==_", "unicode_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Patche", "s", " ", "shou", "ld", " ", "be", " ", "compose", "d", " ", "of", " ", "a", " ", "subse", "t", " ", "of", " ", "ascii", " ", "char", "s", ",", " ", "Unic", "ode", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "require", "d", ".", " ", " ", "If", " ", "this", " ", "encode", " ", "raise", "s", " ", "Unic", "ode", "Encode", "Error", ",", " ", "patch", " ", "is", " ", "invalid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "textl", "ine_", "=_", "textl", "ine_", "._", "encode_", "(_", "\"", "ascii", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "textl", "ine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "patches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "textl", "ine_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "text_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "re_", "._", "match_", "(_", "\"", "^", "@@", " ", "-(", "\\\\", "d", "+)", ",", "?(", "\\\\", "d", "*)", " ", "\\\\+", "(\\\\", "d", "+)", ",", "?(", "\\\\", "d", "*)", " ", "@@", "$\"_", ",_", "text_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "patch", " ", "string", ":", " ", "\"_", "+_", "text_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "=_", "patch", "\\u", "obj_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patches_", "._", "append_", "(_", "patch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "start", "1_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", "._", "group_", "(_", "2_", ")_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "start", "1_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "m_", "._", "group_", "(_", "2_", ")_", "==_", "'", "0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "1_", "=_", "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 ", " _", "patch_", "._", "start", "1_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "1_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "patch_", "._", "start", "2_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", "._", "group_", "(_", "4_", ")_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "start", "2_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "m_", "._", "group_", "(_", "4_", ")_", "==_", "'", "0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "length", "2_", "=_", "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 ", " _", "patch_", "._", "start", "2_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patch_", "._", "length", "2_", "=_", "int_", "(_", "m_", "._", "group_", "(_", "4_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "text_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "len_", "(_", "text_", ")_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "text_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sign_", "=_", "text_", "[_", "0_", "]_", "[_", "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 ", " _", "sign_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "line_", "=_", "urllib_", "._", "unquote_", "(_", "text_", "[_", "0_", "]_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "line_", "._", "decode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sign_", "==_", "'+'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Inserti", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "INSERT", "_", ",_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sign_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Deletion", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "DELETE_", ",_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sign_", "==_", "'", " ", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Min", "or", " ", "equality", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "patch_", "._", "diffs_", "._", "append_", "(_", "(_", "self_", "._", "DIFF", "\\u", "EQUAL", "_", ",_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sign_", "==_", "'@'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Start", " ", "of", " ", "next", " ", "patch", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "sign_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Blan", "k", " ", "line", "?", " ", " ", "What", "ever", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "WT", "F", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Inva", "lid", " ", "patch", " ", "mode", ":", " ", "'%", "s", "'\\\\", "n", "%", "s", "\"_", "%_", "(_", "sign_", ",_", "line_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "text_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "patches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "patch", "\\u", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Class", " ", "represent", "ing", " ", "one", " ", "patch", " ", "operati", "on", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "patch", "\\u", "obj_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Initializ", "es", " ", "with", " ", "an", " ", "empty", " ", "list", " ", "of", " ", "diffs", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "diffs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "1_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "2_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "length", "1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "length", "2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "patch", "\\u", "obj_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Em", "mul", "ate", " ", "GN", "U", " ", "diff", "'", "s", " ", "format", ".", "\\", "10", ";", " ", " ", " ", " ", "Head", "er", ":", " ", "@@", " ", "-", "382", ",", "8", " ", "+", "481", ",", "9", " ", "@@", "\\", "10", ";", " ", " ", " ", " ", "Indic", "ies", " ", "are", " ", "printed", " ", "as", " ", "1", "-", "based", ",", " ", "not", " ", "0", "-", "based", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", "The", " ", "GN", "U", " ", "diff", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "length", "1_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "1_", "=_", "str_", "(_", "self_", "._", "start", "1_", ")_", "+_", "\",", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "length", "1_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "1_", "=_", "str_", "(_", "self_", "._", "start", "1_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "1_", "=_", "str_", "(_", "self_", "._", "start", "1_", "+_", "1_", ")_", "+_", "\",\"_", "+_", "str_", "(_", "self_", "._", "length", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "length", "2_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "2_", "=_", "str_", "(_", "self_", "._", "start", "2_", ")_", "+_", "\",", "0", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "length", "2_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "2_", "=_", "str_", "(_", "self_", "._", "start", "2_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "coords", "2_", "=_", "str_", "(_", "self_", "._", "start", "2_", "+_", "1_", ")_", "+_", "\",\"_", "+_", "str_", "(_", "self_", "._", "length", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "text_", "=_", "[_", "\"@", "@", " ", "-\"_", ",_", "coords", "1_", ",_", "\"", " ", "+\"_", ",_", "coords", "2_", ",_", "\"", " ", "@@", "\\\\", "n", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Esc", "ape", " ", "the", " ", "body", " ", "of", " ", "the", " ", "patch", " ", "with", " ", "%", "xx", " ", "notation", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "op_", ",_", "data_", ")_", "in_", "self_", "._", "diffs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "op_", "==_", "diff", "\\u", "match", "\\u", "patch_", "._", "DIFF", "\\u", "INSERT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "\"+\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "diff", "\\u", "match", "\\u", "patch_", "._", "DIFF", "\\u", "DELETE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "\"-\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "op_", "==_", "diff", "\\u", "match", "\\u", "patch_", "._", "DIFF", "\\u", "EQUAL", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "._", "append_", "(_", "\"", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Hig", "h", " ", "ascii", " ", "will", " ", "raise", " ", "Unic", "ode", "Decode", "Error", ".", " ", " ", "Us", "e", " ", "Unic", "ode", " ", "inst", "ead", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "data_", "._", "encode_", "(_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "._", "append_", "(_", "urllib_", "._", "quote_", "(_", "data_", ",_", "\"!", "~", "*'", "();", "/?", ":", "@", "&", "=+", "$", ",#", " ", "\"_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "._", "join_", "(_", "text_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
ganeti/ganeti/test/py/ganeti.impexpd_unittest.py
[ { "content": "#!/usr/bin/python\n#\n\n# Copyright (C) 2010 Google Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# 1. Redistributions of source code must retain the above copyright notice,\n# this list of conditions and the following disclaimer.\n#\n# 2. Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n# IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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\"\"\"Script for testing ganeti.impexpd\"\"\"\n\nimport os\nimport sys\nimport re\nimport unittest\nimport socket\n\nfrom ganeti import constants\nfrom ganeti import objects\nfrom ganeti import compat\nfrom ganeti import utils\nfrom ganeti import errors\nfrom ganeti import impexpd\n\nimport testutils\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n testutils.GanetiTestProgram()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class CmdBuilderConfig(objects.ConfigObject):\n __slots__ = [\n \"bind\",\n \"key\",\n \"cert\",\n \"ca\",\n \"host\",\n \"port\",\n \"ipv4\",\n \"ipv6\",\n \"compress\",\n \"magic\",\n \"connect_timeout\",\n \"connect_retries\",\n \"cmd_prefix\",\n \"cmd_suffix\",\n ]", "metadata": "root.CmdBuilderConfig", "header": "['module', '___EOS___']", "index": 48 }, { "content": "def CheckCmdWord(cmd, word):\n wre = re.compile(r\"\\b%s\\b\" % re.escape(word))\n return compat.any(wre.search(i) for i in cmd)", "metadata": "root.CheckCmdWord", "header": "['module', '___EOS___']", "index": 67 }, { "content": "class TestCommandBuilder(unittest.TestCase):\n\n\n\n", "metadata": "root.TestCommandBuilder", "header": "['module', '___EOS___']", "index": 72 }, { "content": " def test(self):\n\n # The commands various compressions should use\n compress_import = {\n constants.IEC_GZIP: \"gzip -d\",\n constants.IEC_GZIP_FAST: \"gzip -d\",\n constants.IEC_GZIP_SLOW: \"gzip -d\",\n constants.IEC_LZOP: \"lzop -d\",\n }\n compress_export = {\n constants.IEC_GZIP: \"gzip -1\",\n constants.IEC_GZIP_FAST: \"gzip -1\",\n constants.IEC_GZIP_SLOW: \"gzip\",\n constants.IEC_LZOP: \"lzop\",\n }\n\n for mode in [constants.IEM_IMPORT, constants.IEM_EXPORT]:\n if mode == constants.IEM_IMPORT:\n compress_dict = compress_import\n elif mode == constants.IEM_EXPORT:\n compress_dict = compress_export\n\n for compress in constants.IEC_ALL:\n for magic in [None, 10 * \"-\", \"HelloWorld\", \"J9plh4nFo2\",\n \"24A02A81-2264-4B51-A882-A2AB9D85B420\"]:\n opts = CmdBuilderConfig(magic=magic, compress=compress)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n\n magic_cmd = builder._GetMagicCommand()\n dd_cmd = builder._GetDdCommand()\n\n if magic:\n self.assert_((\"M=%s\" % magic) in magic_cmd)\n self.assert_((\"M=%s\" % magic) in dd_cmd)\n else:\n self.assertFalse(magic_cmd)\n\n for host in [\"localhost\", \"198.51.100.4\", \"192.0.2.99\"]:\n for port in [0, 1, 1234, 7856, 45452]:\n for cmd_prefix in [None, \"PrefixCommandGoesHere|\",\n \"dd if=/dev/hda bs=1048576 |\"]:\n for cmd_suffix in [None, \"< /some/file/name\",\n \"| dd of=/dev/null\"]:\n opts = CmdBuilderConfig(host=host, port=port, compress=compress,\n cmd_prefix=cmd_prefix,\n cmd_suffix=cmd_suffix)\n\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n\n # Check complete command\n cmd = builder.GetCommand()\n self.assert_(isinstance(cmd, list))\n\n if compress != constants.IEC_NONE:\n self.assert_(CheckCmdWord(cmd, compress_dict[compress]))\n\n if cmd_prefix is not None:\n self.assert_(compat.any(cmd_prefix in i for i in cmd))\n\n if cmd_suffix is not None:\n self.assert_(compat.any(cmd_suffix in i for i in cmd))\n\n # Check socat command\n socat_cmd = builder._GetSocatCommand()\n\n if mode == constants.IEM_IMPORT:\n ssl_addr = socat_cmd[-2].split(\",\")\n self.assert_((\"OPENSSL-LISTEN:%s\" % port) in ssl_addr)\n elif mode == constants.IEM_EXPORT:\n ssl_addr = socat_cmd[-1].split(\",\")\n self.assert_((\"OPENSSL:%s:%s\" % (host, port)) in ssl_addr)\n\n self.assert_(\"verify=1\" in ssl_addr)", "metadata": "root.TestCommandBuilder.test", "header": "['class', 'TestCommandBuilder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 73 }, { "content": " def testIPv6(self):\n for mode in [constants.IEM_IMPORT, constants.IEM_EXPORT]:\n opts = CmdBuilderConfig(host=\"localhost\", port=6789,\n ipv4=False, ipv6=False)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n cmd = builder._GetSocatCommand()\n self.assert_(compat.all(\"pf=\" not in i for i in cmd))\n\n # IPv4\n opts = CmdBuilderConfig(host=\"localhost\", port=6789,\n ipv4=True, ipv6=False)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n cmd = builder._GetSocatCommand()\n self.assert_(compat.any(\",pf=ipv4\" in i for i in cmd))\n\n # IPv6\n opts = CmdBuilderConfig(host=\"localhost\", port=6789,\n ipv4=False, ipv6=True)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n cmd = builder._GetSocatCommand()\n self.assert_(compat.any(\",pf=ipv6\" in i for i in cmd))\n\n # IPv4 and IPv6\n opts = CmdBuilderConfig(host=\"localhost\", port=6789,\n ipv4=True, ipv6=True)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n self.assertRaises(AssertionError, builder._GetSocatCommand)", "metadata": "root.TestCommandBuilder.testIPv6", "header": "['class', 'TestCommandBuilder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def testCommaError(self):\n opts = CmdBuilderConfig(host=\"localhost\", port=1234,\n ca=\"/some/path/with,a/,comma\")\n\n for mode in [constants.IEM_IMPORT, constants.IEM_EXPORT]:\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n self.assertRaises(errors.GenericError, builder.GetCommand)", "metadata": "root.TestCommandBuilder.testCommaError", "header": "['class', 'TestCommandBuilder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 175 }, { "content": " def testOptionLengthError(self):\n testopts = [\n CmdBuilderConfig(bind=\"0.0.0.0\" + (\"A\" * impexpd.SOCAT_OPTION_MAXLEN),\n port=1234, ca=\"/tmp/ca\"),\n CmdBuilderConfig(host=\"localhost\", port=1234,\n ca=\"/tmp/ca\" + (\"B\" * impexpd.SOCAT_OPTION_MAXLEN)),\n CmdBuilderConfig(host=\"localhost\", port=1234,\n key=\"/tmp/key\" + (\"B\" * impexpd.SOCAT_OPTION_MAXLEN)),\n ]\n\n for opts in testopts:\n for mode in [constants.IEM_IMPORT, constants.IEM_EXPORT]:\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n self.assertRaises(errors.GenericError, builder.GetCommand)\n\n opts.host = \"localhost\" + (\"A\" * impexpd.SOCAT_OPTION_MAXLEN)\n builder = impexpd.CommandBuilder(constants.IEM_EXPORT, opts, 1, 2, 3)\n self.assertRaises(errors.GenericError, builder.GetCommand)", "metadata": "root.TestCommandBuilder.testOptionLengthError", "header": "['class', 'TestCommandBuilder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def testModeError(self):\n mode = \"foobarbaz\"\n\n assert mode not in [constants.IEM_IMPORT, constants.IEM_EXPORT]\n\n opts = CmdBuilderConfig(host=\"localhost\", port=1234)\n builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)\n self.assertRaises(errors.GenericError, builder.GetCommand)", "metadata": "root.TestCommandBuilder.testModeError", "header": "['class', 'TestCommandBuilder', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 202 }, { "content": "class TestVerifyListening(unittest.TestCase):\n", "metadata": "root.TestVerifyListening", "header": "['module', '___EOS___']", "index": 212 }, { "content": " def test(self):\n self.assertEqual(impexpd._VerifyListening(socket.AF_INET,\n \"192.0.2.7\", 1234),\n (\"192.0.2.7\", 1234))\n self.assertEqual(impexpd._VerifyListening(socket.AF_INET6, \"::1\", 9876),\n (\"::1\", 9876))\n self.assertEqual(impexpd._VerifyListening(socket.AF_INET6, \"[::1]\", 4563),\n (\"::1\", 4563))\n self.assertEqual(impexpd._VerifyListening(socket.AF_INET6,\n \"[2001:db8::1:4563]\", 4563),\n (\"2001:db8::1:4563\", 4563))", "metadata": "root.TestVerifyListening.test", "header": "['class', 'TestVerifyListening', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 213 }, { "content": " def testError(self):\n for family in [socket.AF_UNIX, socket.AF_INET, socket.AF_INET6]:\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"\", 1234)\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"192\", 999)\n\n for family in [socket.AF_UNIX, socket.AF_INET6]:\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"192.0.2.7\", 1234)\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"[2001:db8::1\", 1234)\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"2001:db8::1]\", 1234)\n\n for family in [socket.AF_UNIX, socket.AF_INET]:\n self.assertRaises(errors.GenericError, impexpd._VerifyListening,\n family, \"::1\", 1234)", "metadata": "root.TestVerifyListening.testError", "header": "['class', 'TestVerifyListening', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 225 }, { "content": "class TestCalcThroughput(unittest.TestCase):", "metadata": "root.TestCalcThroughput", "header": "['module', '___EOS___']", "index": 245 }, { "content": " def test(self):\n self.assertEqual(impexpd._CalcThroughput([]), None)\n self.assertEqual(impexpd._CalcThroughput([(0, 0)]), None)\n\n samples = [\n (0.0, 0.0),\n (10.0, 100.0),\n ]\n self.assertAlmostEqual(impexpd._CalcThroughput(samples), 10.0, 3)\n\n samples = [\n (5.0, 7.0),\n (10.0, 100.0),\n (16.0, 181.0),\n ]\n self.assertAlmostEqual(impexpd._CalcThroughput(samples), 15.818, 3)", "metadata": "root.TestCalcThroughput.test", "header": "['class', 'TestCalcThroughput', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 246 } ]
[ { "span": "import os", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 9 }, { "span": "import sys", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 10 }, { "span": "from ganeti import utils", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 24 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2010", " ", "Goo", "gle", " ", "Inc", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TO", ",", " ", "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", " ", "HOLD", "ER", " ", "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_", "\"\"\"", "Script", " ", "for", " ", "testi", "ng", " ", "gane", "ti", ".", "impe", "xp", "d", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gane", "ti_", "import_", "constants_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gane", "ti_", "import_", "objects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gane", "ti_", "import_", "compat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gane", "ti_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gane", "ti_", "import_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gane", "ti_", "import_", "impe", "xp", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "testutils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "testutils_", "._", "Gan", "eti", "Test", "Program_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Cmd", "Build", "er", "Config_", "(_", "objects_", "._", "Config", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u\\u", "slots\\u\\u_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "bind", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cert", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ca", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "host", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "port", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipv", "4", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ipv", "6", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "compress", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "magic", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "connect", "\\u", "timeo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "connect", "\\u", "retrie", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cmd", "\\u", "prefix", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cmd", "\\u", "suff", "ix", "\"_", ",_", "\\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_", "Check", "Cmd", "Word_", "(_", "cmd_", ",_", "word_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wre", "_", "=_", "re_", "._", "compile_", "(_", "r", "\"\\\\", "b", "%", "s", "\\\\", "b", "\"_", "%_", "re_", "._", "escape_", "(_", "word_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "compat_", "._", "any_", "(_", "wre", "_", "._", "search_", "(_", "i_", ")_", "for_", "i_", "in_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Command", "Builder_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Command", "Builder_", "(_", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "command", "s", " ", "vari", "ous", " ", "compress", "ion", "s", " ", "shou", "ld", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compress", "\\u", "import_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP_", ":_", "\"", "gzip", " ", "-", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP", "\\u", "FAST", "_", ":_", "\"", "gzip", " ", "-", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP", "\\u", "SLO", "W_", ":_", "\"", "gzip", " ", "-", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "LZ", "OP_", ":_", "\"", "lz", "op", " ", "-", "d", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compress", "\\u", "export_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP_", ":_", "\"", "gzip", " ", "-1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP", "\\u", "FAST", "_", ":_", "\"", "gzip", " ", "-1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "GZ", "IP", "\\u", "SLO", "W_", ":_", "\"", "gzip", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "constants_", "._", "IE", "C", "\\u", "LZ", "OP_", ":_", "\"", "lz", "op", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "[_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ",_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mode_", "==_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compress", "\\u", "dict_", "=_", "compress", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mode_", "==_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compress", "\\u", "dict_", "=_", "compress", "\\u", "export_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "compress_", "in_", "constants_", "._", "IE", "C", "\\u", "ALL_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "magic_", "in_", "[_", "None_", ",_", "10_", "*_", "\"-\"_", ",_", "\"", "Hell", "o", "Wor", "ld", "\"_", ",_", "\"", "J", "9", "pl", "h", "4", "n", "Fo", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "24", "A0", "2", "A8", "1", "-", "226", "4", "-", "4", "B5", "1", "-", "A8", "8", "2", "-", "A2", "AB", "9", "D8", "5", "B4", "20", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "magic_", "=_", "magic_", ",_", "compress_", "=_", "compress_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "magic", "\\u", "cmd_", "=_", "builder_", "._", "\\u", "Get", "Mag", "ic", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dd", "\\u", "cmd_", "=_", "builder_", "._", "\\u", "Get", "Dd", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "magic_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "(_", "\"", "M", "=", "%", "s", "\"_", "%_", "magic_", ")_", "in_", "magic", "\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "(_", "\"", "M", "=", "%", "s", "\"_", "%_", "magic_", ")_", "in_", "dd", "\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "False_", "(_", "magic", "\\u", "cmd_", ")_", "\\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_", "host_", "in_", "[_", "\"", "local", "host", "\"_", ",_", "\"", "198", ".5", "1.1", "00", ".4", "\"_", ",_", "\"", "192", ".0", ".2", ".99", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "port_", "in_", "[_", "0_", ",_", "1_", ",_", "1234_", ",_", "785", "6_", ",_", "454", "52_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "cmd", "\\u", "prefix_", "in_", "[_", "None_", ",_", "\"", "Pref", "ix", "Command", "Go", "es", "Her", "e", "|\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "dd", " ", "if", "=", "/", "dev", "/", "hda", " ", "bs", "=", "104857", "6", " ", "|\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "cmd", "\\u", "suffix_", "in_", "[_", "None_", ",_", "\"<", " ", "/", "some", "/", "file", "/", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"|", " ", "dd", " ", "of", "=", "/", "dev", "/", "null", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "host_", ",_", "port_", "=_", "port_", ",_", "compress_", "=_", "compress_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "prefix_", "=_", "cmd", "\\u", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "\\u", "suffix_", "=_", "cmd", "\\u", "suffix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "complete", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "cmd_", "=_", "builder_", "._", "Get", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "isinstance_", "(_", "cmd_", ",_", "list_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "compress_", "!=_", "constants_", "._", "IE", "C", "\\u", "NONE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "Check", "Cmd", "Word_", "(_", "cmd_", ",_", "compress", "\\u", "dict_", "[_", "compress_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cmd", "\\u", "prefix_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "compat_", "._", "any_", "(_", "cmd", "\\u", "prefix_", "in_", "i_", "for_", "i_", "in_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "cmd", "\\u", "suffix_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert\\u_", "(_", "compat_", "._", "any_", "(_", "cmd", "\\u", "suffix_", "in_", "i_", "for_", "i_", "in_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "soc", "at", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "soc", "at", "\\u", "cmd_", "=_", "builder_", "._", "\\u", "Get", "So", "cat", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode_", "==_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ssl", "\\u", "addr_", "=_", "soc", "at", "\\u", "cmd_", "[_", "-_", "2_", "]_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "(_", "\"", "OPENS", "SL", "-", "LISTEN", ":", "%", "s", "\"_", "%_", "port_", ")_", "in_", "ssl", "\\u", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mode_", "==_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ssl", "\\u", "addr_", "=_", "soc", "at", "\\u", "cmd_", "[_", "-_", "1_", "]_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "(_", "\"", "OPENS", "SL", ":", "%", "s", ":", "%", "s", "\"_", "%_", "(_", "host_", ",_", "port_", ")_", ")_", "in_", "ssl", "\\u", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "\"", "verify", "=", "1", "\"_", "in_", "ssl", "\\u", "addr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Command", "Builder_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "IP", "v6_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mode_", "in_", "[_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ",_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "678", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ipv4_", "=_", "False_", ",_", "ipv6_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "builder_", "._", "\\u", "Get", "So", "cat", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "compat_", "._", "all_", "(_", "\"", "pf", "=\"_", "not_", "in_", "i_", "for_", "i_", "in_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IP", "v4_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "678", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ipv4_", "=_", "True_", ",_", "ipv6_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "builder_", "._", "\\u", "Get", "So", "cat", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "compat_", "._", "any_", "(_", "\",", "pf", "=", "ipv", "4", "\"_", "in_", "i_", "for_", "i_", "in_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IP", "v6_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "678", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ipv4_", "=_", "False_", ",_", "ipv6_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd_", "=_", "builder_", "._", "\\u", "Get", "So", "cat", "Command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "compat_", "._", "any_", "(_", "\",", "pf", "=", "ipv", "6", "\"_", "in_", "i_", "for_", "i_", "in_", "cmd_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IP", "v", "4", " ", "and", " ", "IP", "v6_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "678", "9_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ipv4_", "=_", "True_", ",_", "ipv6_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Assert", "ion", "Error_", ",_", "builder_", "._", "\\u", "Get", "So", "cat", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Command", "Builder_", "(_", "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", "Comm", "a", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "1234_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ca_", "=_", "\"/", "some", "/", "path", "/", "with", ",", "a", "/", ",", "comma", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "mode_", "in_", "[_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ",_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "builder_", "._", "Get", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Command", "Builder_", "(_", "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", "Optio", "n", "Length", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "test", "opts_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "Cmd", "Build", "er", "Config_", "(_", "bind_", "=_", "\"", "0.", "0.", "0.", "0", "\"_", "+_", "(_", "\"", "A", "\"_", "*_", "impe", "xp", "d_", "._", "SO", "CAT", "\\u", "OPTION", "\\u", "MAX", "LEN_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port_", "=_", "1234_", ",_", "ca_", "=_", "\"/", "tmp", "/", "ca", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "1234_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ca_", "=_", "\"/", "tmp", "/", "ca", "\"_", "+_", "(_", "\"", "B", "\"_", "*_", "impe", "xp", "d_", "._", "SO", "CAT", "\\u", "OPTION", "\\u", "MAX", "LEN_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "1234_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "\"/", "tmp", "/", "key", "\"_", "+_", "(_", "\"", "B", "\"_", "*_", "impe", "xp", "d_", "._", "SO", "CAT", "\\u", "OPTION", "\\u", "MAX", "LEN_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "opts_", "in_", "test", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "mode_", "in_", "[_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ",_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "builder_", "._", "Get", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts_", "._", "host_", "=_", "\"", "local", "host", "\"_", "+_", "(_", "\"", "A", "\"_", "*_", "impe", "xp", "d_", "._", "SO", "CAT", "\\u", "OPTION", "\\u", "MAX", "LEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "builder_", "._", "Get", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Command", "Builder_", "(_", "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", "Mode", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mode_", "=_", "\"", "fooba", "rba", "z", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "mode_", "not_", "in_", "[_", "constants_", "._", "IE", "M", "\\u", "IMPORT", "_", ",_", "constants_", "._", "IE", "M", "\\u", "EXPORT", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", "=_", "Cmd", "Build", "er", "Config_", "(_", "host_", "=_", "\"", "local", "host", "\"_", ",_", "port_", "=_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "builder_", "=_", "impe", "xp", "d_", "._", "Command", "Builder_", "(_", "mode_", ",_", "opts_", ",_", "1_", ",_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "builder_", "._", "Get", "Command_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Verify", "Listen", "ing_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Verify", "Listen", "ing_", "(_", "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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", "(_", "socket_", "._", "AF", "\\u", "INET_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "192", ".0", ".2", ".7", "\"_", ",_", "1234_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "192", ".0", ".2", ".7", "\"_", ",_", "1234_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", "(_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", ",_", "\":", ":", "1", "\"_", ",_", "9876", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\":", ":", "1", "\"_", ",_", "9876", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", "(_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", ",_", "\"[", "::", "1", "]\"_", ",_", "456", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\":", ":", "1", "\"_", ",_", "456", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", "(_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"[", "200", "1", ":", "db", "8", "::", "1", ":", "456", "3", "]\"_", ",_", "456", "3_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "200", "1", ":", "db", "8", "::", "1", ":", "456", "3", "\"_", ",_", "456", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Verify", "Listen", "ing_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Error_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "family_", "in_", "[_", "socket_", "._", "AF", "\\u", "UNIX", "_", ",_", "socket_", "._", "AF", "\\u", "INET_", ",_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\"\"_", ",_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\"", "192", "\"_", ",_", "999_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "family_", "in_", "[_", "socket_", "._", "AF", "\\u", "UNIX", "_", ",_", "socket_", "._", "AF", "\\u", "INE", "T6", "_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\"", "192", ".0", ".2", ".7", "\"_", ",_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\"[", "200", "1", ":", "db", "8", "::", "1", "\"_", ",_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\"", "200", "1", ":", "db", "8", "::", "1", "]\"_", ",_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "family_", "in_", "[_", "socket_", "._", "AF", "\\u", "UNIX", "_", ",_", "socket_", "._", "AF", "\\u", "INET_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Raises_", "(_", "errors_", "._", "Gene", "ric", "Error_", ",_", "impe", "xp", "d_", "._", "\\u", "Verify", "Listen", "ing_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "family_", ",_", "\":", ":", "1", "\"_", ",_", "1234_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Calc", "Through", "put_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Calc", "Through", "put_", "(_", "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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Calc", "Through", "put_", "(_", "[_", "]_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Calc", "Through", "put_", "(_", "[_", "(_", "0_", ",_", "0_", ")_", "]_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "samples_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "0.0_", ",_", "0.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "10.0_", ",_", "100.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Calc", "Through", "put_", "(_", "samples_", ")_", ",_", "10.0_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "samples_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "5.0_", ",_", "7.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "10.0_", ",_", "100.0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "16.0_", ",_", "181", ".0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Al", "most", "Equal_", "(_", "impe", "xp", "d_", "._", "\\u", "Calc", "Through", "put_", "(_", "samples_", ")_", ",_", "15.", "818", "_", ",_", "3_", ")_", "\\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, 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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, 4, 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 ]
Unused local variable
owtf/owtf/framework/db/poutput_manager.py
[ { "content": " @target_required\n def DeleteAll(self, filter_data, target_id=None):\n \"\"\"\n Here keeping filter_data optional is very risky\n \"\"\"\n query = self.GenerateQueryUsingSession(\n filter_data,\n target_id,\n for_delete=True) # Empty dict will match all results\n # Delete the folders created for these plugins\n for plugin in query.all():\n # First check if path exists in db\n if plugin.output_path:\n output_path = os.path.join(\n self.config.GetOutputDirForTargets(),\n plugin.output_path)\n if os.path.exists(output_path):\n FileOperations.rm_tree(output_path)\n # When folders are removed delete the results from db\n results = query.delete()\n self.db.session.commit()", "metadata": "root.POutputDB.DeleteAll", "header": "['class', 'POutputDB', '(', 'BaseComponent', ',', 'PluginOutputInterface', ')', ':', '___EOS___']", "index": 163 } ]
[ { "span": "results ", "start_line": 182, "start_column": 8, "end_line": 182, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "PO", "ut", "put", "DB_", "(_", "Base", "Component_", ",_", "Plug", "in", "Output", "Interface_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "target", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "Delete", "All_", "(_", "self_", ",_", "filter", "\\u", "data_", ",_", "target", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Her", "e", " ", "keep", "ing", " ", "filter", "\\u", "data", " ", "option", "al", " ", "is", " ", "very", " ", "risk", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "self_", "._", "Generate", "Query", "Us", "ing", "Session_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "data_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "target", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "for", "\\u", "delete_", "=_", "True_", ")_", "#", " ", "Emp", "ty", " ", "dict", " ", "will", " ", "match", " ", "all", " ", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Delete", " ", "the", " ", "folder", "s", " ", "created", " ", "for", " ", "these", " ", "plugins_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "plugin_", "in_", "query_", "._", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "check", " ", "if", " ", "path", " ", "exist", "s", " ", "in", " ", "db_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "plugin_", "._", "output", "\\u", "path_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "config_", "._", "Get", "Output", "Dir", "For", "Targets_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plugin_", "._", "output", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "output", "\\u", "path_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "File", "Operations_", "._", "rm", "\\u", "tree_", "(_", "output", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Whe", "n", " ", "folder", "s", " ", "are", " ", "remove", "d", " ", "delete", " ", "the", " ", "results", " ", "from", " ", "db_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "results_", "=_", "query_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "session_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
First parameter of a method is not named 'self'
adlibre/Adlibre-TMS/adlibre_tms/apps/saasu_client/models/base.py
[ { "content": " def __init__(cls, name, bases, attrs):\n super(ModelBase, cls).__init__(name, bases, attrs)\n if not hasattr(cls, \"_fields\"):\n cls._fields = {}\n for field_name in attrs.keys():\n if isinstance(attrs[field_name], xml_models.BaseField):\n cls._fields[field_name] = attrs[field_name]\n if attrs.has_key(\"finders\"):\n setattr(cls, \"objects\", XmlModelManager(cls, attrs[\"finders\"]))\n else:\n setattr(cls, \"objects\", XmlModelManager(cls, {}))", "metadata": "root.ModelBase.__init__", "header": "['class', 'ModelBase', '(', 'xml_models', '.', 'ModelBase', ')', ':', '___EOS___']", "index": 168 }, { "content": " def __setattr__(cls, attr, value):\n if isinstance(value, (datetime.datetime, datetime.date)) and cls._fields.has_key(attr):\n value = value.strftime(cls._fields[attr].date_format)\n super(ModelBase, cls).__setattr__(attr, value)", "metadata": "root.ModelBase.__setattr__", "header": "['class', 'ModelBase', '(', 'xml_models', '.', 'ModelBase', ')', ':', '___EOS___']", "index": 180 } ]
[ { "span": "def __init__(cls, name, bases, attrs):", "start_line": 168, "start_column": 4, "end_line": 168, "end_column": 42 }, { "span": "def __setattr__(cls, attr, value):", "start_line": 180, "start_column": 4, "end_line": 180, "end_column": 38 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Model", "Base_", "(_", "xml", "\\u", "models_", "._", "Model", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "cls_", ",_", "name_", ",_", "bases_", ",_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Model", "Base_", ",_", "cls_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "name_", ",_", "bases_", ",_", "attrs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "cls_", ",_", "\"\\u", "fields", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "\\u", "fields_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "field", "\\u", "name_", "in_", "attrs_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "attrs_", "[_", "field", "\\u", "name_", "]_", ",_", "xml", "\\u", "models_", "._", "Base", "Field_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "._", "\\u", "fields_", "[_", "field", "\\u", "name_", "]_", "=_", "attrs_", "[_", "field", "\\u", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "attrs_", "._", "has", "\\u", "key_", "(_", "\"", "finde", "rs", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "\"", "object", "s", "\"_", ",_", "Xm", "l", "Model", "Manager_", "(_", "cls_", ",_", "attrs_", "[_", "\"", "finde", "rs", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "setattr_", "(_", "cls_", ",_", "\"", "object", "s", "\"_", ",_", "Xm", "l", "Model", "Manager_", "(_", "cls_", ",_", "{_", "}_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Model", "Base_", "(_", "xml", "\\u", "models_", "._", "Model", "Base_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setattr\\u\\u_", "(_", "cls_", ",_", "attr_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "value_", ",_", "(_", "datetime_", "._", "datetime_", ",_", "datetime_", "._", "date_", ")_", ")_", "and_", "cls_", "._", "\\u", "fields_", "._", "has", "\\u", "key_", "(_", "attr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "value_", "._", "strftime_", "(_", "cls_", "._", "\\u", "fields_", "[_", "attr_", "]_", "._", "date", "\\u", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "super_", "(_", "Model", "Base_", ",_", "cls_", ")_", "._", "\\u\\u", "setattr\\u\\u_", "(_", "attr_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
securitykiss-com/rfw/rfw/rfw.py
[ { "content": "#!/usr/bin/env python\n#\n# Copyrite (c) 2014 SecurityKISS Ltd (http://www.securitykiss.com) \n#\n# This file is part of rfw\n#\n# The MIT License (MIT)\n#\n# Yes, Mr patent attorney, you have nothing to do here. Find a decent job instead. \n# Fight intellectual \"property\".\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n\nfrom __future__ import print_function\nimport sys\npytver = sys.version_info\nif pytver[0] == 2 and pytver[1] >= 7:\n pass\nelse:\n print(\"rfw requires python 2.7\")\n sys.exit(1)\n\n\nimport argparse, logging, re, sys, struct, socket, subprocess, signal, time, json, os\nfrom Queue import Queue, PriorityQueue\nfrom threading import Thread\nimport config, rfwconfig, cmdparse, iputil, rfwthreads, iptables\nfrom sslserver import SSLServer, PlainServer, BasicAuthRequestHandler, CommonRequestHandler\nfrom iptables import Iptables\n\n \nlog = logging.getLogger('rfw')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == \"__main__\":\n main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def perr(msg):\n print(msg, file=sys.stderr)", "metadata": "root.perr", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def create_requesthandlers(rfwconf, cmd_queue, expiry_queue):\n \"\"\"Create RequestHandler type. This is a way to avoid global variables: a closure returning a class type that binds rfwconf and cmd_queue inside. \n \"\"\"\n\n ver = '0.0.0'\n try:\n version_file = os.path.join(os.path.dirname(__file__), '_version.py')\n with open(version_file) as f:\n verline = f.read().strip()\n VSRE = r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\"\n mo = re.search(VSRE, verline, re.M)\n if mo:\n ver = mo.group(1)\n else:\n log.error('Could not find version string in {}'.format(version_file))\n except IOError, e:\n log.error('Could not read {}: {} {}'.format(version_file, e.strerror, e.filename))\n server_ver = 'SecurityKISS rfw/{}'.format(ver)\n\n\n def check_whitelist_conflict(ip, whitelist):\n if ip != '0.0.0.0/0' and iputil.ip_in_list(ip, whitelist):\n msg = 'Ignoring the request conflicting with the whitelist'\n log.warn(msg)\n raise Exception(msg)\n\n\n def process(handler, modify, urlpath):\n # modify should be 'D' for Delete or 'I' for Insert understood as -D and -I iptables flags\n assert modify in ['D', 'I', 'L']\n log.debug('process {} urlpath: {}'.format(modify, urlpath))\n \n try:\n action, rule, directives = cmdparse.parse_command(urlpath)\n log.debug('\\nAction: {}\\nRule: {}\\nDirectives: {}'.format(action, rule, directives))\n if modify == 'L':\n if action == 'help':\n resp = 'TODO usage'\n return handler.http_resp(200, resp)\n elif action == 'list':\n chain = rule\n rules = Iptables.read_simple_rules(chain)\n log.debug('List rfw rules: %s', rules) \n list_of_dict = map(iptables.Rule._asdict, rules) \n resp = json.dumps(list_of_dict)\n return handler.http_resp(200, resp)\n elif rfwconf.is_non_restful():\n mod = directives.get('modify')\n if not mod:\n raise Exception('Unrecognized command. Non-restful enabled, you need to provide modify parameter.'.format(action))\n if mod == 'insert':\n modify = 'I'\n elif mod == 'delete':\n modify = 'D'\n else:\n raise Exception('Unrecognized command. Modify parameter can be \"insert\" or \"delete\".')\n else:\n raise Exception('Unrecognized command. Non-restful disabled.')\n\n if modify in ['D', 'I'] and action.upper() in iptables.RULE_TARGETS:\n # eliminate ignored/whitelisted IP related commands early to prevent propagating them to expiry queue\n check_whitelist_conflict(rule.source, rfwconf.whitelist())\n check_whitelist_conflict(rule.destination, rfwconf.whitelist())\n ctup = (modify, rule, directives)\n log.debug('PUT to Cmd Queue. Tuple: {}'.format(ctup))\n cmd_queue.put_nowait(ctup)\n return handler.http_resp(200, ctup)\n else:\n raise Exception('Unrecognized command.')\n except Exception, e:\n msg = 'ERROR: {}'.format(e.message)\n # logging as error disabled - bad client request is not an error \n # log.exception(msg)\n log.info(msg)\n return handler.http_resp(400, msg) # Bad Request\n \n\n\n class LocalRequestHandler(CommonRequestHandler):\n \n def version_string(self):\n return server_ver\n\n def go(self, modify, urlpath, remote_addr):\n process(self, modify, urlpath)\n\n def do_modify(self, modify):\n self.go(modify, self.path, self.client_address[0])\n\n def do_PUT(self):\n self.go('I', self.path, self.client_address[0])\n \n def do_DELETE(self):\n self.go('D', self.path, self.client_address[0])\n \n def do_GET(self):\n self.go('L', self.path, self.client_address[0])\n \n \n\n class OutwardRequestHandler(BasicAuthRequestHandler):\n \n def version_string(self):\n return server_ver\n\n def creds_check(self, user, password):\n return user == rfwconf.auth_username() and password == rfwconf.auth_password()\n\n def go(self, modify, urlpath, remote_addr):\n # authenticate by checking if client IP is in the whitelist - normally reqests from non-whitelisted IPs should be blocked by firewall beforehand\n if not iputil.ip_in_list(remote_addr, rfwconf.whitelist()):\n log.error('Request from client IP: {} which is not authorized in the whitelist. It should have been blocked by firewall.'.format(remote_addr))\n return self.http_resp(403, '') # Forbidden \n\n process(self, modify, urlpath)\n\n def do_PUT(self):\n self.go('I', self.path, self.client_address[0])\n \n def do_DELETE(self):\n self.go('D', self.path, self.client_address[0])\n \n def do_GET(self):\n self.go('L', self.path, self.client_address[0])\n \n \n return LocalRequestHandler, OutwardRequestHandler", "metadata": "root.create_requesthandlers", "header": "['module', '___EOS___']", "index": 55 }, { "content": "def create_args_parser():\n CONFIG_FILE = '/etc/rfw/rfw.conf'\n # TODO change default log level to INFO\n LOG_LEVEL = 'DEBUG'\n LOG_FILE = '/var/log/rfw.log'\n parser = argparse.ArgumentParser(description='rfw - Remote Firewall')\n parser.add_argument('-f', default=CONFIG_FILE, metavar='CONFIGFILE', dest='configfile', help='rfw config file (default {})'.format(CONFIG_FILE))\n parser.add_argument('--loglevel', default=LOG_LEVEL, help='Log level (default {})'.format(LOG_LEVEL), choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'])\n parser.add_argument('--logfile', default=LOG_FILE, help='Log file (default {})'.format(LOG_FILE))\n parser.add_argument('-v', help='Verbose console output. Sets DEBUG log level for stderr logger (default ERROR)', action='store_true')\n return parser", "metadata": "root.create_args_parser", "header": "['module', '___EOS___']", "index": 187 }, { "content": "def parse_args():\n parser = create_args_parser()\n args = parser.parse_args()\n args.loglevelnum = getattr(logging, args.loglevel)\n return args", "metadata": "root.parse_args", "header": "['module', '___EOS___']", "index": 199 }, { "content": "def startup_sanity_check():\n \"\"\"Check for most common errors to give informative message to the user\n \"\"\"\n try:\n Iptables.verify_install()\n Iptables.verify_permission()\n Iptables.verify_original()\n except Exception, e:\n log.critical(e)\n sys.exit(1)", "metadata": "root.startup_sanity_check", "header": "['module', '___EOS___']", "index": 206 }, { "content": "def __sigTERMhandler(signum, frame):\n log.debug(\"Caught signal {}. Exiting\".format(signum))\n perr('')\n stop()", "metadata": "root.__sigTERMhandler", "header": "['module', '___EOS___']", "index": 218 }, { "content": "def stop():\n logging.shutdown()\n sys.exit(1)", "metadata": "root.stop", "header": "['module', '___EOS___']", "index": 223 }, { "content": "def rfw_init_rules(rfwconf):\n \"\"\"Clean and insert the rfw init rules.\n The rules block all INPUT/OUTPUT traffic on rfw ssl port except for whitelisted IPs.\n Here are the rules that should be created assuming that that the only whitelisted IP is 127.0.0.1:\n Rule(chain='INPUT', num='1', pkts='0', bytes='0', target='ACCEPT', prot='tcp', opt='--', inp='*', out='*', source='127.0.0.1', destination='0.0.0.0/0', extra='tcp dpt:7393')\n Rule(chain='INPUT', num='4', pkts='0', bytes='0', target='DROP', prot='tcp', opt='--', inp='*', out='*', source='0.0.0.0/0', destination='0.0.0.0/0', extra='tcp dpt:7393')\n Rule(chain='OUTPUT', num='1', pkts='0', bytes='0', target='ACCEPT', prot='tcp', opt='--', inp='*', out='*', source='0.0.0.0/0', destination='127.0.0.1', extra='tcp spt:7393')\n Rule(chain='OUTPUT', num='4', pkts='0', bytes='0', target='DROP', prot='tcp', opt='--', inp='*', out='*', source='0.0.0.0/0', destination='0.0.0.0/0', extra='tcp spt:7393')\n \"\"\"\n rfw_port = rfwconf.outward_server_port()\n ipt = Iptables.load()\n\n ###\n log.info('Delete existing init rules')\n # find 'drop all packets to and from rfw port'\n drop_input = ipt.find({'target': ['DROP'], 'chain': ['INPUT'], 'prot': ['tcp'], 'extra': ['tcp dpt:' + rfw_port]})\n log.info(drop_input)\n log.info('Existing drop input to rfw port {} rules:\\n{}'.format(rfw_port, '\\n'.join(map(str, drop_input))))\n for r in drop_input:\n Iptables.exe_rule('D', r)\n drop_output = ipt.find({'target': ['DROP'], 'chain': ['OUTPUT'], 'prot': ['tcp'], 'extra': ['tcp spt:' + rfw_port]})\n log.info('Existing drop output to rfw port {} rules:\\n{}'.format(rfw_port, '\\n'.join(map(str, drop_output))))\n for r in drop_output:\n Iptables.exe_rule('D', r)\n\n ###\n log.info('Insert DROP rfw port init rules')\n Iptables.exe(['-I', 'INPUT', '-p', 'tcp', '--dport', rfw_port, '-j', 'DROP'])\n Iptables.exe(['-I', 'OUTPUT', '-p', 'tcp', '--sport', rfw_port, '-j', 'DROP'])\n\n ###\n log.info('Insert ACCEPT whitelist IP rfw port init rules')\n for ip in rfwconf.whitelist():\n try:\n Iptables.exe(['-D', 'INPUT', '-p', 'tcp', '--dport', rfw_port, '-s', ip, '-j', 'ACCEPT'])\n Iptables.exe(['-D', 'OUTPUT', '-p', 'tcp', '--sport', rfw_port, '-d', ip, '-j', 'ACCEPT'])\n except subprocess.CalledProcessError, e:\n pass # ignore\n Iptables.exe(['-I', 'INPUT', '-p', 'tcp', '--dport', rfw_port, '-s', ip, '-j', 'ACCEPT'])\n Iptables.exe(['-I', 'OUTPUT', '-p', 'tcp', '--sport', rfw_port, '-d', ip, '-j', 'ACCEPT'])", "metadata": "root.rfw_init_rules", "header": "['module', '___EOS___']", "index": 228 }, { "content": "def main():\n\n args = parse_args()\n try:\n config.set_logging(log, args.loglevelnum, args.logfile, args.v)\n except config.ConfigError, e:\n perr(e.message)\n sys.exit(1)\n\n if args.v:\n log.info('Console logging in verbose mode')\n \n log.info(\"Logging to file: {}\".format(args.logfile))\n log.info(\"File log level: {}\".format(args.loglevel))\n\n try:\n rfwconf = rfwconfig.RfwConfig(args.configfile)\n except IOError, e:\n perr(e.message)\n create_args_parser().print_usage()\n sys.exit(1)\n\n # Initialize Iptables with configured path to system iptables \n Iptables.ipt_path = rfwconf.iptables_path()\n startup_sanity_check()\n\n # Install signal handlers\n signal.signal(signal.SIGTERM, __sigTERMhandler)\n signal.signal(signal.SIGINT, __sigTERMhandler)\n # TODO we may also need to ignore signal.SIGHUP in daemon mode\n \n\n\n rules = Iptables.load().rules\n # TODO make logging more efficient by deferring arguments evaluation\n log.debug(\"===== rules =====\\n{}\".format(\"\\n\".join(map(str, rules))))\n\n log.info(\"Starting rfw server\")\n log.info(\"Whitelisted IP addresses that will be ignored:\")\n for a in rfwconf.whitelist():\n log.info(' {}'.format(a))\n\n # recreate rfw init rules related to rfw port\n rfw_init_rules(rfwconf)\n\n expiry_queue = PriorityQueue()\n cmd_queue = Queue()\n\n rfwthreads.CommandProcessor(cmd_queue, \n rfwconf.whitelist(),\n expiry_queue,\n rfwconf.default_expire()).start()\n\n rfwthreads.ExpiryManager(cmd_queue, expiry_queue).start()\n\n # Passing HandlerClass to SSLServer is very limiting, seems like a bad design of BaseServer. \n # In order to pass extra info to RequestHandler without using global variable we have to wrap the class in closure.\n LocalHandlerClass, OutwardHandlerClass = create_requesthandlers(rfwconf, cmd_queue, expiry_queue)\n if rfwconf.is_outward_server():\n server_address = (rfwconf.outward_server_ip(), int(rfwconf.outward_server_port()))\n httpd = SSLServer(\n server_address, \n OutwardHandlerClass, \n rfwconf.outward_server_certfile(), \n rfwconf.outward_server_keyfile())\n rfwthreads.ServerRunner(httpd).start()\n\n if rfwconf.is_local_server():\n server_address = ('127.0.0.1', int(rfwconf.local_server_port()))\n httpd = PlainServer(\n server_address, \n LocalHandlerClass)\n rfwthreads.ServerRunner(httpd).start()\n\n # wait forever\n time.sleep(1e9)", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 270 } ]
[ { "span": "import argparse, logging, re, sys, struct, socket, subprocess, signal, time, json, os", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 85 }, { "span": "from threading import Thread", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "rite", " ", "(", "c", ")", " ", "2014", " ", "Secur", "it", "y", "KI", "SS", " ", "Lt", "d", " ", "(", "http", "://", "www", ".", "security", "kis", "s", ".", "com", ")", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "rf", "w_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "MIT", " ", "License", " ", "(", "MIT", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ye", "s", ",", " ", "Mr", " ", "pate", "nt", " ", "att", "orn", "ey", ",", " ", "you", " ", "have", " ", "not", "hing", " ", "to", " ", "do", " ", "here", ".", " ", "Fin", "d", " ", "a", " ", "dece", "nt", " ", "job", " ", "inst", "ead", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fight", " ", "intel", "lect", "ual", " ", "\"", "property", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", " ", "obtain", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "copy", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", " ", "files", " ", "(", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", " ", "restriction", ",", " ", "inclu", "ding_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights", " ", "to", " ", "use", ",", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", " ", "copie", "s", " ", "of", " ", "the", " ", "Sof", "twa", "re", ",", " ", "and", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "permit", " ", "person", "s", " ", "to", " ", "who", "m", " ", "the", " ", "Sof", "twa", "re", " ", "is", " ", "fur", "nish", "ed", " ", "to", " ", "do", " ", "so", ",", " ", "subject", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "follow", "ing", " ", "condition", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "include", "d", " ", "in", " ", "all", " ", "copie", "s", " ", "or", " ", "substa", "nti", "al", " ", "porti", "ons", " ", "of", " ", "the", " ", "Sof", "twa", "re", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "\"", "AS", " ", "IS", "\",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TY", " ", "OF", " ", "ANY", " ", "KIND", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "AN", " ", "ACTION_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OF", " ", "CONTR", "ACT", ",", " ", "TOR", "T", " ", "OR", " ", "OTHER", "WI", "SE", ",", " ", "ARI", "SIN", "G", " ", "FROM", ",", " ", "OUT", " ", "OF", " ", "OR", " ", "IN", " ", "CONNECTION", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WITH", " ", "THE", " ", "SOFT", "WARE", " ", "OR", " ", "THE", " ", "USE", " ", "OR", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", " ", "SOFT", "WARE", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyt", "ver_", "=_", "sys_", "._", "version", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pyt", "ver_", "[_", "0_", "]_", "==_", "2_", "and_", "pyt", "ver_", "[_", "1_", "]_", ">=_", "7_", ":_", "\\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 ", " _", "print_", "(_", "\"", "rf", "w", " ", "require", "s", " ", "python", " ", "2.7", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "argparse_", ",_", "logging_", ",_", "re_", ",_", "sys_", ",_", "struct_", ",_", "socket_", ",_", "subprocess_", ",_", "signal_", ",_", "time_", ",_", "json_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Queue_", "import_", "Queue_", ",_", "Prior", "it", "y", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "threading_", "import_", "Thread_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "config_", ",_", "rf", "wco", "nfig_", ",_", "cmd", "parse_", ",_", "ip", "util_", ",_", "rf", "wt", "hread", "s_", ",_", "iptables", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ssl", "server_", "import_", "SS", "LS", "erver_", ",_", "Plai", "n", "Server_", ",_", "Basic", "Auth", "Request", "Handler_", ",_", "Common", "Request", "Handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "iptables", "_", "import_", "Ip", "tables_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "rf", "w", "'_", ")_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "\"\\u\\u", "main", "\\u\\u\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "main_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "per", "r_", "(_", "msg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "msg_", ",_", "file_", "=_", "sys_", "._", "stderr_", ")_", "\\u\\u\\uNEWLINE\\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", "request", "handlers_", "(_", "rf", "wco", "nf_", ",_", "cmd", "\\u", "queue_", ",_", "expir", "y", "\\u", "queue_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Creat", "e", " ", "Request", "Handle", "r", " ", "type", ".", " ", "Thi", "s", " ", "is", " ", "a", " ", "way", " ", "to", " ", "avoid", " ", "global", " ", "variab", "les", ":", " ", "a", " ", "clos", "ure", " ", "return", "ing", " ", "a", " ", "class", " ", "type", " ", "tha", "t", " ", "bind", "s", " ", "rf", "wco", "nf", " ", "and", " ", "cmd", "\\u", "queue", " ", "insi", "de", ".", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ver_", "=_", "'", "0.", "0.", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version", "\\u", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'\\u", "version", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "version", "\\u", "file_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ver", "line_", "=_", "f_", "._", "read_", "(_", ")_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "VS", "RE_", "=_", "r", "\"", "^", "\\u\\u", "version", "\\u\\u", " ", "=", " ", "['", "\\\\\"]", "([", "^", "'\\\\\"", "]*)", "['", "\\\\\"]", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mo_", "=_", "re_", "._", "search_", "(_", "VS", "RE_", ",_", "ver", "line_", ",_", "re_", "._", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mo_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ver_", "=_", "mo_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "Cou", "ld", " ", "not", " ", "find", " ", "version", " ", "string", " ", "in", " ", "{}'_", "._", "format_", "(_", "version", "\\u", "file_", ")_", ")_", "\\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_", "IO", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "Cou", "ld", " ", "not", " ", "read", " ", "{}:", " ", "{}", " ", "{}'_", "._", "format_", "(_", "version", "\\u", "file_", ",_", "e_", "._", "strerror_", ",_", "e_", "._", "filename_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "server", "\\u", "ver_", "=_", "'", "Secur", "it", "y", "KI", "SS", " ", "rf", "w", "/{}'_", "._", "format_", "(_", "ver_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "check", "\\u", "whitelist", "\\u", "conflict_", "(_", "ip_", ",_", "whitelist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ip_", "!=_", "'", "0.", "0.", "0.", "0", "/", "0", "'_", "and_", "ip", "util_", "._", "ip", "\\u", "in", "\\u", "list_", "(_", "ip_", ",_", "whitelist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "Ignor", "ing", " ", "the", " ", "request", " ", "conflicting", " ", "with", " ", "the", " ", "whitelist", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "warn_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Exception_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process_", "(_", "handler_", ",_", "modify_", ",_", "urlpa", "th_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "modif", "y", " ", "shou", "ld", " ", "be", " ", "'", "D", "'", " ", "for", " ", "Delete", " ", "or", " ", "'", "I", "'", " ", "for", " ", "Insert", " ", "underst", "oo", "d", " ", "as", " ", "-", "D", " ", "and", " ", "-", "I", " ", "iptables", " ", "flags_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "modify_", "in_", "[_", "'", "D", "'_", ",_", "'", "I", "'_", ",_", "'", "L", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "process", " ", "{}", " ", "urlpa", "th", ":", " ", "{}'_", "._", "format_", "(_", "modify_", ",_", "urlpa", "th_", ")_", ")_", "\\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 ", " _", "action_", ",_", "rule_", ",_", "directives_", "=_", "cmd", "parse_", "._", "parse", "\\u", "command_", "(_", "urlpa", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'\\\\", "n", "Action", ":", " ", "{}", "\\\\", "n", "Rule", ":", " ", "{}", "\\\\", "n", "Directive", "s", ":", " ", "{}'_", "._", "format_", "(_", "action_", ",_", "rule_", ",_", "directives_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "modify_", "==_", "'", "L", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "action_", "==_", "'", "help", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "resp_", "=_", "'", "TOD", "O", " ", "usage", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handler_", "._", "http", "\\u", "resp_", "(_", "200_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "action_", "==_", "'", "list", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "chain_", "=_", "rule_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "Ip", "tables_", "._", "read", "\\u", "simple", "\\u", "rules_", "(_", "chain_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "List", " ", "rf", "w", " ", "rule", "s", ":", " ", "%", "s", "'_", ",_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "of", "\\u", "dict_", "=_", "map_", "(_", "iptables", "_", "._", "Rule_", "._", "\\u", "asd", "ict_", ",_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "json_", "._", "dumps_", "(_", "list", "\\u", "of", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handler_", "._", "http", "\\u", "resp_", "(_", "200_", ",_", "resp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "rf", "wco", "nf_", "._", "is", "\\u", "non", "\\u", "restful", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "mod_", "=_", "directives_", "._", "get_", "(_", "'", "modif", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "mod_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Exception_", "(_", "'", "Unre", "cogni", "zed", " ", "command", ".", " ", "Non", "-", "restful", " ", "enable", "d", ",", " ", "you", " ", "need", " ", "to", " ", "provide", " ", "modif", "y", " ", "parameter", ".'_", "._", "format_", "(_", "action_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mod_", "==_", "'", "insert", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "modify_", "=_", "'", "I", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "mod_", "==_", "'", "delete", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "modify_", "=_", "'", "D", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Exception_", "(_", "'", "Unre", "cogni", "zed", " ", "command", ".", " ", "Modif", "y", " ", "parameter", " ", "can", " ", "be", " ", "\"", "insert", "\"", " ", "or", " ", "\"", "delete", "\".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Exception_", "(_", "'", "Unre", "cogni", "zed", " ", "command", ".", " ", "Non", "-", "restful", " ", "disable", "d", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "modify_", "in_", "[_", "'", "D", "'_", ",_", "'", "I", "'_", "]_", "and_", "action_", "._", "upper_", "(_", ")_", "in_", "iptables", "_", "._", "RULE", "\\u", "TARGET", "S_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "eliminat", "e", " ", "ignore", "d", "/", "whitelist", "ed", " ", "IP", " ", "relate", "d", " ", "command", "s", " ", "ear", "ly", " ", "to", " ", "prevent", " ", "propagat", "ing", " ", "them", " ", "to", " ", "expir", "y", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "\\u", "whitelist", "\\u", "conflict_", "(_", "rule_", "._", "source_", ",_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "check", "\\u", "whitelist", "\\u", "conflict_", "(_", "rule_", "._", "destination_", ",_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctu", "p_", "=_", "(_", "modify_", ",_", "rule_", ",_", "directives_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "debug_", "(_", "'", "PU", "T", " ", "to", " ", "Cmd", " ", "Queue", ".", " ", "Tup", "le", ":", " ", "{}'_", "._", "format_", "(_", "ctu", "p_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "queue_", "._", "put", "\\u", "nowait_", "(_", "ctu", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handler_", "._", "http", "\\u", "resp_", "(_", "200_", ",_", "ctu", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Unre", "cogni", "zed", " ", "command", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "'", "ERROR", ":", " ", "{}'_", "._", "format_", "(_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "logg", "ing", " ", "as", " ", "error", " ", "disable", "d", " ", "-", " ", "bad", " ", "client", " ", "request", " ", "is", " ", "not", " ", "an", " ", "error", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "log", ".", "exception", "(", "msg", ")_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "handler_", "._", "http", "\\u", "resp_", "(_", "400_", ",_", "msg_", ")_", "#", " ", "Ba", "d", " ", "Request_", "\\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_", "class_", "Local", "Request", "Handler_", "(_", "Common", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "version", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "server", "\\u", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "go_", "(_", "self_", ",_", "modify_", ",_", "urlpa", "th_", ",_", "remote", "\\u", "addr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "process_", "(_", "self_", ",_", "modify_", ",_", "urlpa", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "modify_", "(_", "self_", ",_", "modify_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "modify_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "PUT_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "I", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "DELETE_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "D", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "GET_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "L", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\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_", "class_", "Out", "ward", "Request", "Handler_", "(_", "Basic", "Auth", "Request", "Handler_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "version", "\\u", "string_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "server", "\\u", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "creds", "\\u", "check_", "(_", "self_", ",_", "user_", ",_", "password_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "user_", "==_", "rf", "wco", "nf_", "._", "auth", "\\u", "username_", "(_", ")_", "and_", "password_", "==_", "rf", "wco", "nf_", "._", "auth", "\\u", "password_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "go_", "(_", "self_", ",_", "modify_", ",_", "urlpa", "th_", ",_", "remote", "\\u", "addr_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "authenticat", "e", " ", "by", " ", "checking", " ", "if", " ", "client", " ", "IP", " ", "is", " ", "in", " ", "the", " ", "whitelist", " ", "-", " ", "normal", "ly", " ", "req", "ests", " ", "from", " ", "non", "-", "whitelist", "ed", " ", "IP", "s", " ", "shou", "ld", " ", "be", " ", "block", "ed", " ", "by", " ", "firew", "all", " ", "bef", "ore", "hand_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "ip", "util_", "._", "ip", "\\u", "in", "\\u", "list_", "(_", "remote", "\\u", "addr_", ",_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "error_", "(_", "'", "Request", " ", "from", " ", "client", " ", "IP", ":", " ", "{}", " ", "whi", "ch", " ", "is", " ", "not", " ", "authoriz", "ed", " ", "in", " ", "the", " ", "whitelist", ".", " ", "It", " ", "shou", "ld", " ", "have", " ", "bee", "n", " ", "block", "ed", " ", "by", " ", "firew", "all", ".'_", "._", "format_", "(_", "remote", "\\u", "addr_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "http", "\\u", "resp_", "(_", "403_", ",_", "''_", ")_", "#", " ", "For", "bid", "den", " _", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "process_", "(_", "self_", ",_", "modify_", ",_", "urlpa", "th_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "PUT_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "I", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "DELETE_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "D", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "GET_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "go_", "(_", "'", "L", "'_", ",_", "self_", "._", "path_", ",_", "self_", "._", "client", "\\u", "address_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Local", "Request", "Handler_", ",_", "Out", "ward", "Request", "Handler_", "\\u\\u\\uNEWLINE\\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", "args", "\\u", "parser_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "CONFIG", "\\u", "FILE_", "=_", "'/", "etc", "/", "rf", "w", "/", "rf", "w", ".", "conf", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "change", " ", "default", " ", "log", " ", "level", " ", "to", " ", "INFO_", "\\u\\u\\uNL\\u\\u\\u_", "LOG", "\\u", "LEVEL_", "=_", "'", "DEBU", "G", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LOG", "\\u", "FILE_", "=_", "'/", "var", "/", "log", "/", "rf", "w", ".", "log", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "argparse_", "._", "Arg", "ument", "Parser_", "(_", "description_", "=_", "'", "rf", "w", " ", "-", " ", "Remo", "te", " ", "Fire", "wall", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "f", "'_", ",_", "default_", "=_", "CONFIG", "\\u", "FILE_", ",_", "metavar_", "=_", "'", "CONFIG", "FILE", "'_", ",_", "dest_", "=_", "'", "configf", "ile", "'_", ",_", "help_", "=_", "'", "rf", "w", " ", "config", " ", "file", " ", "(", "default", " ", "{})", "'_", "._", "format_", "(_", "CONFIG", "\\u", "FILE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "logl", "evel", "'_", ",_", "default_", "=_", "LOG", "\\u", "LEVEL_", ",_", "help_", "=_", "'", "Log", " ", "level", " ", "(", "default", " ", "{})", "'_", "._", "format_", "(_", "LOG", "\\u", "LEVEL_", ")_", ",_", "choices_", "=_", "[_", "'", "DEBU", "G", "'_", ",_", "'", "INFO", "'_", ",_", "'", "WARN", "ING", "'_", ",_", "'", "ERROR", "'_", ",_", "'", "CRIT", "ICAL", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'--", "logfile", "'_", ",_", "default_", "=_", "LOG", "\\u", "FILE_", ",_", "help_", "=_", "'", "Log", " ", "file", " ", "(", "default", " ", "{})", "'_", "._", "format_", "(_", "LOG", "\\u", "FILE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "add", "\\u", "argument_", "(_", "'-", "v", "'_", ",_", "help_", "=_", "'", "Verbos", "e", " ", "console", " ", "output", ".", " ", "Set", "s", " ", "DEBU", "G", " ", "log", " ", "level", " ", "for", " ", "std", "err", " ", "logg", "er", " ", "(", "default", " ", "ERROR", ")'_", ",_", "action_", "=_", "'", "store", "\\u", "true", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "parser_", "\\u\\u\\uNEWLINE\\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", "args_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parser_", "=_", "create", "\\u", "args", "\\u", "parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "parser_", "._", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "._", "logl", "evel", "num_", "=_", "getattr_", "(_", "logging_", ",_", "args_", "._", "loglevel_", ")_", "\\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_", "start", "up", "\\u", "sanity", "\\u", "check_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", " ", "for", " ", "most", " ", "common", " ", "error", "s", " ", "to", " ", "give", " ", "informati", "ve", " ", "message", " ", "to", " ", "the", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ip", "tables_", "._", "verify", "\\u", "install_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "verify", "\\u", "permission_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "verify", "\\u", "original_", "(_", ")_", "\\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 ", " _", "log_", "._", "critical_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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_", "\\u\\u", "sig", "TERM", "handler_", "(_", "signum_", ",_", "frame_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "debug_", "(_", "\"", "Cau", "ght", " ", "signal", " ", "{}.", " ", "Exi", "ting", "\"_", "._", "format_", "(_", "signum_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "per", "r_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "stop_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "shutdown_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "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_", "rf", "w", "\\u", "init", "\\u", "rules_", "(_", "rf", "wco", "nf_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clean", " ", "and", " ", "insert", " ", "the", " ", "rf", "w", " ", "init", " ", "rule", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "rule", "s", " ", "block", " ", "all", " ", "INPUT", "/", "OUTPU", "T", " ", "traffic", " ", "on", " ", "rf", "w", " ", "ssl", " ", "port", " ", "except", " ", "for", " ", "whitelist", "ed", " ", "IP", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Her", "e", " ", "are", " ", "the", " ", "rule", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "created", " ", "ass", "umi", "ng", " ", "tha", "t", " ", "tha", "t", " ", "the", " ", "only", " ", "whitelist", "ed", " ", "IP", " ", "is", " ", "127", ".0", ".0", ".1", ":", "\\", "10", ";", " ", " ", " ", " ", "Rule", "(", "chain", "='", "INPUT", "',", " ", "num", "='", "1", "',", " ", "pkts", "='", "0", "',", " ", "bytes", "='", "0", "',", " ", "target", "='", "ACCEPT", "',", " ", "prot", "='", "tcp", "',", " ", "opt", "='", "--", "',", " ", "inp", "='", "*'", ",", " ", "out", "='", "*'", ",", " ", "source", "='", "127", ".0", ".0", ".1", "',", " ", "destinat", "ion", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "extra", "='", "tcp", " ", "dp", "t", ":", "739", "3", "')", "\\", "10", ";", " ", " ", " ", " ", "Rule", "(", "chain", "='", "INPUT", "',", " ", "num", "='", "4", "',", " ", "pkts", "='", "0", "',", " ", "bytes", "='", "0", "',", " ", "target", "='", "DROP", "',", " ", "prot", "='", "tcp", "',", " ", "opt", "='", "--", "',", " ", "inp", "='", "*'", ",", " ", "out", "='", "*'", ",", " ", "source", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "destinat", "ion", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "extra", "='", "tcp", " ", "dp", "t", ":", "739", "3", "')", "\\", "10", ";", " ", " ", " ", " ", "Rule", "(", "chain", "='", "OUTPU", "T", "',", " ", "num", "='", "1", "',", " ", "pkts", "='", "0", "',", " ", "bytes", "='", "0", "',", " ", "target", "='", "ACCEPT", "',", " ", "prot", "='", "tcp", "',", " ", "opt", "='", "--", "',", " ", "inp", "='", "*'", ",", " ", "out", "='", "*'", ",", " ", "source", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "destinat", "ion", "='", "127", ".0", ".0", ".1", "',", " ", "extra", "='", "tcp", " ", "spt", ":", "739", "3", "')", "\\", "10", ";", " ", " ", " ", " ", "Rule", "(", "chain", "='", "OUTPU", "T", "',", " ", "num", "='", "4", "',", " ", "pkts", "='", "0", "',", " ", "bytes", "='", "0", "',", " ", "target", "='", "DROP", "',", " ", "prot", "='", "tcp", "',", " ", "opt", "='", "--", "',", " ", "inp", "='", "*'", ",", " ", "out", "='", "*'", ",", " ", "source", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "destinat", "ion", "='", "0.", "0.", "0.", "0", "/", "0", "',", " ", "extra", "='", "tcp", " ", "spt", ":", "739", "3", "')", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "w", "\\u", "port_", "=_", "rf", "wco", "nf_", "._", "out", "ward", "\\u", "server", "\\u", "port_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ipt", "_", "=_", "Ip", "tables_", "._", "load_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Delete", " ", "exist", "ing", " ", "init", " ", "rule", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "find", " ", "'", "drop", " ", "all", " ", "packet", "s", " ", "to", " ", "and", " ", "from", " ", "rf", "w", " ", "port", "'_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "\\u", "input_", "=_", "ipt", "_", "._", "find_", "(_", "{_", "'", "target", "'_", ":_", "[_", "'", "DROP", "'_", "]_", ",_", "'", "chain", "'_", ":_", "[_", "'", "INPUT", "'_", "]_", ",_", "'", "prot", "'_", ":_", "[_", "'", "tcp", "'_", "]_", ",_", "'", "extra", "'_", ":_", "[_", "'", "tcp", " ", "dp", "t", ":'_", "+_", "rf", "w", "\\u", "port_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "drop", "\\u", "input_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Exist", "ing", " ", "drop", " ", "input", " ", "to", " ", "rf", "w", " ", "port", " ", "{}", " ", "rule", "s", ":\\\\", "n", "{}'_", "._", "format_", "(_", "rf", "w", "\\u", "port_", ",_", "'\\\\", "n", "'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "drop", "\\u", "input_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "drop", "\\u", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ip", "tables_", "._", "exe", "\\u", "rule_", "(_", "'", "D", "'_", ",_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "drop", "\\u", "output_", "=_", "ipt", "_", "._", "find_", "(_", "{_", "'", "target", "'_", ":_", "[_", "'", "DROP", "'_", "]_", ",_", "'", "chain", "'_", ":_", "[_", "'", "OUTPU", "T", "'_", "]_", ",_", "'", "prot", "'_", ":_", "[_", "'", "tcp", "'_", "]_", ",_", "'", "extra", "'_", ":_", "[_", "'", "tcp", " ", "spt", ":'_", "+_", "rf", "w", "\\u", "port_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Exist", "ing", " ", "drop", " ", "output", " ", "to", " ", "rf", "w", " ", "port", " ", "{}", " ", "rule", "s", ":\\\\", "n", "{}'_", "._", "format_", "(_", "rf", "w", "\\u", "port_", ",_", "'\\\\", "n", "'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "drop", "\\u", "output_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "drop", "\\u", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Ip", "tables_", "._", "exe", "\\u", "rule_", "(_", "'", "D", "'_", ",_", "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_", "log_", "._", "info_", "(_", "'", "Insert", " ", "DROP", " ", "rf", "w", " ", "port", " ", "init", " ", "rule", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "I", "'_", ",_", "'", "INPUT", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "dport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "j", "'_", ",_", "'", "DROP", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "I", "'_", ",_", "'", "OUTPU", "T", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "sport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "j", "'_", ",_", "'", "DROP", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "'", "Insert", " ", "ACCEPT", " ", "whitelist", " ", "IP", " ", "rf", "w", " ", "port", " ", "init", " ", "rule", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ip_", "in_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ":_", "\\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 ", " _", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "D", "'_", ",_", "'", "INPUT", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "dport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "s", "'_", ",_", "ip_", ",_", "'-", "j", "'_", ",_", "'", "ACCEPT", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "D", "'_", ",_", "'", "OUTPU", "T", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "sport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "d", "'_", ",_", "ip_", ",_", "'-", "j", "'_", ",_", "'", "ACCEPT", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "subprocess_", "._", "Call", "ed", "Process", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "ignore_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "I", "'_", ",_", "'", "INPUT", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "dport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "s", "'_", ",_", "ip_", ",_", "'-", "j", "'_", ",_", "'", "ACCEPT", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Ip", "tables_", "._", "exe_", "(_", "[_", "'-", "I", "'_", ",_", "'", "OUTPU", "T", "'_", ",_", "'-", "p", "'_", ",_", "'", "tcp", "'_", ",_", "'--", "sport", "'_", ",_", "rf", "w", "\\u", "port_", ",_", "'-", "d", "'_", ",_", "ip_", ",_", "'-", "j", "'_", ",_", "'", "ACCEPT", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "=_", "parse", "\\u", "args_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "config_", "._", "set\\u", "logging_", "(_", "log_", ",_", "args_", "._", "logl", "evel", "num_", ",_", "args_", "._", "logfile_", ",_", "args_", "._", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "config_", "._", "Config", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "per", "r_", "(_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "args_", "._", "v_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'", "Cons", "ole", " ", "logg", "ing", " ", "in", " ", "verbo", "se", " ", "mode", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Log", "ging", " ", "to", " ", "file", ":", " ", "{}\"_", "._", "format_", "(_", "args_", "._", "logfile_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "File", " ", "log", " ", "level", ":", " ", "{}\"_", "._", "format_", "(_", "args_", "._", "loglevel_", ")_", ")_", "\\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 ", " _", "rf", "wco", "nf_", "=_", "rf", "wco", "nfig_", "._", "Rf", "w", "Config_", "(_", "args_", "._", "configfile_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "IO", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "per", "r_", "(_", "e_", "._", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "args", "\\u", "parser_", "(_", ")_", "._", "print", "\\u", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "exit_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initializ", "e", " ", "Ip", "tables", " ", "with", " ", "configur", "ed", " ", "path", " ", "to", " ", "system", " ", "iptables", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Ip", "tables_", "._", "ipt", "\\u", "path_", "=_", "rf", "wco", "nf_", "._", "iptables", "\\u", "path_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "up", "\\u", "sanity", "\\u", "check_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Install", " ", "signal", " ", "handlers_", "\\u\\u\\uNL\\u\\u\\u_", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGTERM_", ",_", "\\u\\u", "sig", "TERM", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signal_", "._", "signal_", "(_", "signal_", "._", "SIGINT_", ",_", "\\u\\u", "sig", "TERM", "handler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "we", " ", "may", " ", "als", "o", " ", "need", " ", "to", " ", "ignore", " ", "signal", ".", "SIG", "HU", "P", " ", "in", " ", "daemon", " ", "mode_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rules_", "=_", "Ip", "tables_", "._", "load_", "(_", ")_", "._", "rules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", " ", "make", " ", "logg", "ing", " ", "more", " ", "efficien", "t", " ", "by", " ", "defer", "ring", " ", "argu", "ment", "s", " ", "evaluation_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "debug_", "(_", "\"====", "=", " ", "rule", "s", " ", "=====", "\\\\", "n", "{}\"_", "._", "format_", "(_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "rules_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Start", "ing", " ", "rf", "w", " ", "server", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "White", "liste", "d", " ", "IP", " ", "addresse", "s", " ", "tha", "t", " ", "will", " ", "be", " ", "ignore", "d", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "info_", "(_", "'", " ", " ", " ", " ", "{}'_", "._", "format_", "(_", "a_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "recreate", " ", "rf", "w", " ", "init", " ", "rule", "s", " ", "relate", "d", " ", "to", " ", "rf", "w", " ", "port_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rf", "w", "\\u", "init", "\\u", "rules_", "(_", "rf", "wco", "nf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expir", "y", "\\u", "queue_", "=_", "Prior", "it", "y", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cmd", "\\u", "queue_", "=_", "Queue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wt", "hread", "s_", "._", "Command", "Processor_", "(_", "cmd", "\\u", "queue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wco", "nf_", "._", "whitelist_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "expir", "y", "\\u", "queue_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wco", "nf_", "._", "default", "\\u", "expire_", "(_", ")_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wt", "hread", "s_", "._", "Expir", "y", "Manager_", "(_", "cmd", "\\u", "queue_", ",_", "expir", "y", "\\u", "queue_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Passi", "ng", " ", "Handle", "r", "Class", " ", "to", " ", "SS", "LS", "erver", " ", "is", " ", "very", " ", "limit", "ing", ",", " ", "see", "ms", " ", "like", " ", "a", " ", "bad", " ", "design", " ", "of", " ", "Base", "Server", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", " ", "order", " ", "to", " ", "pass", " ", "extra", " ", "info", " ", "to", " ", "Request", "Handle", "r", " ", "with", "out", " ", "usi", "ng", " ", "global", " ", "variab", "le", " ", "we", " ", "have", " ", "to", " ", "wrap", " ", "the", " ", "class", " ", "in", " ", "clos", "ure", "._", "\\u\\u\\uNL\\u\\u\\u_", "Local", "Handle", "r", "Class_", ",_", "Out", "ward", "Handle", "r", "Class_", "=_", "create", "\\u", "request", "handlers_", "(_", "rf", "wco", "nf_", ",_", "cmd", "\\u", "queue_", ",_", "expir", "y", "\\u", "queue_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "rf", "wco", "nf_", "._", "is", "\\u", "out", "ward", "\\u", "server_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server", "\\u", "address_", "=_", "(_", "rf", "wco", "nf_", "._", "out", "ward", "\\u", "server", "\\u", "ip_", "(_", ")_", ",_", "int_", "(_", "rf", "wco", "nf_", "._", "out", "ward", "\\u", "server", "\\u", "port_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpd_", "=_", "SS", "LS", "erver_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "server", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Out", "ward", "Handle", "r", "Class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wco", "nf_", "._", "out", "ward", "\\u", "server", "\\u", "certfile", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rf", "wco", "nf_", "._", "out", "ward", "\\u", "server", "\\u", "keyfile_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "wt", "hread", "s_", "._", "Server", "Runner_", "(_", "httpd_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rf", "wco", "nf_", "._", "is", "\\u", "local", "\\u", "server_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server", "\\u", "address_", "=_", "(_", "'", "127", ".0", ".0", ".1", "'_", ",_", "int_", "(_", "rf", "wco", "nf_", "._", "local", "\\u", "server", "\\u", "port_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "httpd_", "=_", "Plai", "n", "Server_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "server", "\\u", "address_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Local", "Handle", "r", "Class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf", "wt", "hread", "s_", "._", "Server", "Runner_", "(_", "httpd_", ")_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait", " ", "forever_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time_", "._", "sleep_", "(_", "1e9_", ")_", "\\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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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 ]
Except block handles 'BaseException'
cloudera/ibis/ibis/expr/types.py
[ { "content": " def verify(self):\n \"\"\"\n Returns True if expression can be compiled to its attached client\n \"\"\"\n try:\n self.compile()\n return True\n except:\n return False", "metadata": "root.Expr.verify", "header": "['class', 'Expr', '(', 'object', ')', ':', '___EOS___']", "index": 151 }, { "content": " def _is_valid(self, exprs):\n try:\n self._assert_valid(util.promote_list(exprs))\n return True\n except:\n return False", "metadata": "root.TableExpr._is_valid", "header": "['class', 'TableExpr', '(', 'Expr', ')', ':', '___EOS___']", "index": 533 } ]
[ { "span": "except:", "start_line": 158, "start_column": 8, "end_line": 158, "end_column": 15 }, { "span": "except:", "start_line": 537, "start_column": 8, "end_line": 537, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Expr_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "verify_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "Tru", "e", " ", "if", " ", "express", "ion", " ", "can", " ", "be", " ", "compile", "d", " ", "to", " ", "its", " ", "attache", "d", " ", "client", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "compile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Table", "Expr_", "(_", "Expr_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "is", "\\u", "valid_", "(_", "self_", ",_", "exprs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "assert", "\\u", "valid_", "(_", "util_", "._", "promote", "\\u", "list_", "(_", "exprs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Testing equality to None
khamidou/kite/src/back/kite/kite-adduser.py
[ { "content": "#!/usr/bin/env python\n# add an user to Kite and Postfix\nimport sys\nimport os\nimport getopt\nimport config\nfrom cabinet import DatetimeCabinet\n\n\n \n\ntry:\n opts, args = getopt.getopt(sys.argv[1:], 'u:p:', ['username=', 'password='])\nexcept getopt.GetoptError:\n usage()\n\nusername = None\npassword = None\n\nfor opt, arg in opts:\n if opt in ('-u', '--username'):\n username = arg\n elif opt in ('-p', '--password'):\n password = arg\n\nif username == None or password == None:\n usage()\n\nadd_postfix_user(username)\nadd_kite_user(username, password)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "username == None ", "start_line": 46, "start_column": 3, "end_line": 46, "end_column": 19 }, { "span": "password == None:", "start_line": 46, "start_column": 23, "end_line": 46, "end_column": 39 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "an", " ", "user", " ", "to", " ", "Kit", "e", " ", "and", " ", "Post", "fix_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "getopt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "cab", "inet", "_", "import_", "Date", "time", "Cab", "inet", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", ",_", "args_", "=_", "getopt_", "._", "getopt_", "(_", "sys_", "._", "argv_", "[_", "1_", ":_", "]_", ",_", "'", "u", ":", "p", ":'_", ",_", "[_", "'", "user", "name", "='_", ",_", "'", "password", "='_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "getopt_", "._", "Get", "opt", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "username_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "password_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "opt_", ",_", "arg_", "in_", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "opt_", "in_", "(_", "'-", "u", "'_", ",_", "'--", "user", "name", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "arg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opt_", "in_", "(_", "'-", "p", "'_", ",_", "'--", "password", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "password_", "=_", "arg_", "\\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_", "username_", "==_", "None_", "or_", "password_", "==_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "usage_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "add", "\\u", "postfix", "\\u", "user_", "(_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "kite", "\\u", "user_", "(_", "username_", ",_", "password_", ")_" ]
[ 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, 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 ]
Unnecessary pass
ilastik/ilastik-0.5/ilastik/modules/interactive_console/gui/shellWidget.py
[ { "content": " def write(self, str):\n \"\"\" Emulate write function \"\"\"\n\n if self.guistream.thread() != QThread.currentThread():\n sys_stdout.write(str)\n e = QEvent(QEvent.Type(RedirectionEventId))\n e.txt = str\n QApplication.postEvent(self.guistream,e)\n pass\n else:\n self.guistream.write(str)", "metadata": "root.ThreadedRedirection.write", "header": "['class', 'ThreadedRedirection', ':', '___EOS___']", "index": 67 } ]
[ { "span": "pass", "start_line": 75, "start_column": 12, "end_line": 75, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Thread", "ed", "Redirect", "ion_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Emulat", "e", " ", "write", " ", "function", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "gui", "stream_", "._", "thread_", "(_", ")_", "!=_", "QT", "hread", "_", "._", "current", "Thread_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sys", "\\u", "stdout_", "._", "write_", "(_", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "=_", "QE", "vent_", "(_", "QE", "vent_", "._", "Type_", "(_", "Redirect", "ion", "Event", "Id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "e_", "._", "txt_", "=_", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "QA", "ppl", "ication", "_", "._", "post", "Event_", "(_", "self_", "._", "gui", "stream_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "gui", "stream_", "._", "write_", "(_", "str_", ")_", "\\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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
VisTrails/VisTrails/vistrails/core/modules/module_registry.py
[ { "content": "###############################################################################\n##\n## Copyright (C) 2014-2016, New York University.\n## Copyright (C) 2011-2014, NYU-Poly.\n## Copyright (C) 2006-2011, University of Utah.\n## All rights reserved.\n## Contact: [email protected]\n##\n## This file is part of VisTrails.\n##\n## \"Redistribution and use in source and binary forms, with or without\n## modification, are permitted provided that the following conditions are met:\n##\n## - Redistributions of source code must retain the above copyright notice,\n## this list of conditions and the following disclaimer.\n## - Redistributions in binary form must reproduce the above copyright\n## notice, this list of conditions and the following disclaimer in the\n## documentation and/or other materials provided with the distribution.\n## - Neither the name of the New York University nor the names of its\n## contributors may be used to endorse or promote products derived from\n## this software without specific prior written permission.\n##\n## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n## THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 PROFITS;\n## OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n## OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n## ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n##\n###############################################################################\nfrom __future__ import division\n\nfrom itertools import izip, chain\nfrom ast import literal_eval\nimport collections\nimport copy\nimport os\nimport tempfile\nimport traceback\nimport uuid\nimport warnings\n\nfrom vistrails.core import debug, get_vistrails_application\nfrom vistrails.core.data_structures.graph import Graph\nimport vistrails.core.modules\nfrom vistrails.core.modules.config import ConstantWidgetConfig, \\\n ModuleSettings, InputPort, OutputPort, CompoundInputPort, \\\n CompoundOutputPort, DeprecatedInputPort\nimport vistrails.core.modules.vistrails_module\nfrom vistrails.core.modules.module_descriptor import ModuleDescriptor\nfrom vistrails.core.modules.package import Package\nfrom vistrails.core.requirements import MissingRequirement\nimport vistrails.core.modules.utils\nfrom vistrails.core.modules.utils import create_port_spec_item_string\nfrom vistrails.core.utils import VistrailsInternalError, memo_method, \\\n InvalidModuleClass, ModuleAlreadyExists, append_to_dict_of_lists, \\\n all, profile, versions_increasing, InvalidPipeline, VistrailsDeprecation\nfrom vistrails.core.system import vistrails_root_directory, vistrails_version, \\\n get_vistrails_basic_pkg_id\nfrom vistrails.core.vistrail.port_spec import PortSpec\nfrom vistrails.core.vistrail.port_spec_item import PortSpecItem\nimport vistrails.core.cache.hasher\nfrom vistrails.db.domain import DBRegistry\n\nimport unittest\n\n##############################################################################\n\n# This is used by add_module to make sure the fringe specifications\n# make sense\n\n\n\n\n###############################################################################\n# ModuleRegistrySignals\n\n\n###############################################################################\n# ModuleRegistry\n\n# !!!!!! DEPRECATED !!!!!!\n# Use get_module_registry()\nregistry = None\nadd_module = None\nadd_input_port = None\nhas_input_port = None\nadd_output_port = None\nset_current_package = None\nget_descriptor_by_name = None\nget_module_by_name = None\nget_descriptor = None\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n###############################################################################\n\n# registry = ModuleRegistry()\n# add_module = registry.add_module\n# add_input_port = registry.add_input_port\n# has_input_port = registry.has_input_port\n# add_output_port = registry.add_output_port\n# set_current_package = registry.set_current_package\n# get_descriptor_by_name = registry.get_descriptor_by_name\n# get_module_by_name = registry.get_module_by_name\n# get_descriptor = registry.get_descriptor\n\n\n\n##############################################################################\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _check_fringe(fringe):\n assert isinstance(fringe, list)\n assert len(fringe) >= 1\n for v in fringe:\n assert isinstance(v, tuple)\n assert len(v) == 2\n assert isinstance(v[0], float)\n assert isinstance(v[1], float)", "metadata": "root._check_fringe", "header": "['module', '___EOS___']", "index": 75 }, { "content": "def _toposort_modules(module_list):\n \"\"\"Topologically sorts Python classes.\n\n Takes a list of Python classes and returns them sorted topologically wrt\n the subclass relation, such that if `a` and `b` are both in the list and\n ``issubclass(a, b)``, then `a` will appear before `b` in the result.\n \"\"\"\n\n g = Graph()\n for m in module_list:\n if isinstance(m, tuple):\n g.add_vertex(m[0], m)\n else:\n g.add_vertex(m, m)\n for m in module_list:\n if isinstance(m, tuple):\n m = m[0]\n for subclass in m.mro()[1:]: # skip self\n if subclass in g.vertices:\n g.add_edge(subclass, m)\n return [g.vertices[v] for v in g.vertices_topological_sort()]", "metadata": "root._toposort_modules", "header": "['module', '___EOS___']", "index": 84 }, { "content": "def _parse_abstraction_name(filename):\n # assume only 1 possible prefix or suffix\n prefixes = [\"abstraction_\"]\n suffixes = [\".vt\", \".xml\"]\n name = os.path.basename(filename)\n for prefix in prefixes:\n if name.startswith(prefix):\n name = name[len(prefix):]\n break\n for suffix in suffixes:\n if name.lower().endswith(suffix):\n name = name[:-len(suffix)]\n break\n return name", "metadata": "root._parse_abstraction_name", "header": "['module', '___EOS___']", "index": 106 }, { "content": "def _toposort_abstractions(package, abstraction_list):\n from vistrails.core.modules.sub_module import find_internal_abstraction_refs\n g = Graph()\n for a in abstraction_list:\n if isinstance(a, tuple):\n if isinstance(a[1], dict) and 'name' in a[1]:\n name = (a[1]['name'], a[1].get('namespace', ''))\n else:\n name = (_parse_abstraction_name(a[0]), '')\n g.add_vertex(name, a)\n else:\n g.add_vertex((_parse_abstraction_name(a), ''), a)\n for a in abstraction_list:\n if isinstance(a, tuple):\n a = a[0]\n for ref in find_internal_abstraction_refs(package, a):\n if ref in g.vertices:\n g.add_edge(ref, a)\n return [g.vertices[v] for v in g.vertices_topological_sort()]", "metadata": "root._toposort_abstractions", "header": "['module', '___EOS___']", "index": 121 }, { "content": "class ModuleRegistrySignals(object):\n\n # # new_module_signal is emitted with descriptor of new module\n # new_module_signal = QtCore.SIGNAL(\"new_module\")\n # # new_abstraction_signal is emitted with descriptor of new abstraction\n # new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")\n # # new_package_signal is emitted with identifier of new package (only for abstractions)\n # new_package_signal = QtCore.SIGNAL(\"new_package\")\n # # deleted_module_signal is emitted with descriptor of deleted module\n # deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")\n # # deleted_abstraction_signal is emitted with descriptor of deleted abstraction\n # deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")\n # # deleted_package_signal is emitted with package identifier\n # deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")\n # # new_input_port_signal is emitted with identifier and name of module,\n # # new port and spec\n # new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")\n # # new_output_port_signal is emitted with identifier and name of module,\n # # new port and spec\n # new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")\n\n # show_module_signal = QtCore.SIGNAL(\"show_module\")\n # hide_module_signal = QtCore.SIGNAL(\"hide_module\")\n # module_updated_signal = QtCore.SIGNAL(\"module_updated\")\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ModuleRegistrySignals", "header": "['module', '___EOS___']", "index": 144 }, { "content": " def __init__(self):\n app = get_vistrails_application()\n notifications = [\"reg_new_module\",\n \"reg_new_abstraction\",\n \"reg_new_package\",\n \"reg_deleted_module\",\n \"reg_deleted_abstraction\",\n \"reg_deleted_package\",\n \"reg_new_input_port\",\n \"reg_new_output_port\",\n \"reg_show_module\",\n \"reg_hide_module\",\n \"reg_module_updated\"]\n\n for notification in notifications:\n app.create_notification(notification)", "metadata": "root.ModuleRegistrySignals.__init__", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 169 }, { "content": " def emit_new_module(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_new_module\", descriptor)\n # self.emit(self.new_module_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_new_module", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 186 }, { "content": " def emit_new_abstraction(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_new_abstraction\", descriptor)\n # self.emit(self.new_abstraction_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_new_abstraction", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 191 }, { "content": " def emit_new_package(self, identifier, prepend=False):\n app = get_vistrails_application()\n app.send_notification(\"reg_new_package\", identifier, prepend)\n # self.emit(self.new_package_signal, identifier, prepend)", "metadata": "root.ModuleRegistrySignals.emit_new_package", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 196 }, { "content": " def emit_deleted_module(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_deleted_module\", descriptor)\n # self.emit(self.deleted_module_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_deleted_module", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 201 }, { "content": " def emit_deleted_abstraction(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_deleted_abstraction\", descriptor)\n # self.emit(self.deleted_abstraction_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_deleted_abstraction", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 206 }, { "content": " def emit_deleted_package(self, package):\n app = get_vistrails_application()\n app.send_notification(\"reg_deleted_package\", package)\n # self.emit(self.deleted_package_signal, package)", "metadata": "root.ModuleRegistrySignals.emit_deleted_package", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 211 }, { "content": " def emit_new_input_port(self, identifier, name, port_name, spec):\n app = get_vistrails_application()\n app.send_notification(\"reg_new_input_port\", identifier, name,\n port_name, spec)\n # self.emit(self.new_input_port_signal, identifier, name, port_name,\n # spec)", "metadata": "root.ModuleRegistrySignals.emit_new_input_port", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 216 }, { "content": " def emit_new_output_port(self, identifier, name, port_name, spec):\n app = get_vistrails_application()\n app.send_notification(\"reg_new_output_port\", identifier, name,\n port_name, spec)\n # self.emit(self.new_output_port_signal, identifier, name, port_name,\n # spec)", "metadata": "root.ModuleRegistrySignals.emit_new_output_port", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 223 }, { "content": " def emit_show_module(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_show_module\", descriptor)\n # self.emit(self.show_module_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_show_module", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 230 }, { "content": " def emit_hide_module(self, descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_hide_module\", descriptor)\n # self.emit(self.hide_module_signal, descriptor)", "metadata": "root.ModuleRegistrySignals.emit_hide_module", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 235 }, { "content": " def emit_module_updated(self, old_descriptor, new_descriptor):\n app = get_vistrails_application()\n app.send_notification(\"reg_module_updated\", old_descriptor,\n new_descriptor)\n # self.emit(self.module_updated_signal, old_descriptor, new_descriptor)", "metadata": "root.ModuleRegistrySignals.emit_module_updated", "header": "['class', 'ModuleRegistrySignals', '(', 'object', ')', ':', '___NEWLINE___', '___NL___', '# # new_module_signal is emitted with descriptor of new module', '___NL___', '# new_module_signal = QtCore.SIGNAL(\"new_module\")', '___NL___', '# # new_abstraction_signal is emitted with descriptor of new abstraction', '___NL___', '# new_abstraction_signal = QtCore.SIGNAL(\"new_abstraction\")', '___NL___', '# # new_package_signal is emitted with identifier of new package (only for abstractions)', '___NL___', '# new_package_signal = QtCore.SIGNAL(\"new_package\")', '___NL___', '# # deleted_module_signal is emitted with descriptor of deleted module', '___NL___', '# deleted_module_signal = QtCore.SIGNAL(\"deleted_module\")', '___NL___', '# # deleted_abstraction_signal is emitted with descriptor of deleted abstraction', '___NL___', '# deleted_abstraction_signal = QtCore.SIGNAL(\"deleted_abstraction\")', '___NL___', '# # deleted_package_signal is emitted with package identifier', '___NL___', '# deleted_package_signal = QtCore.SIGNAL(\"deleted_package\")', '___NL___', '# # new_input_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_input_port_signal = QtCore.SIGNAL(\"new_input_port_signal\")', '___NL___', '# # new_output_port_signal is emitted with identifier and name of module,', '___NL___', '# # new port and spec', '___NL___', '# new_output_port_signal = QtCore.SIGNAL(\"new_output_port_signal\")', '___NL___', '___NL___', '# show_module_signal = QtCore.SIGNAL(\"show_module\")', '___NL___', '# hide_module_signal = QtCore.SIGNAL(\"hide_module\")', '___NL___', '# module_updated_signal = QtCore.SIGNAL(\"module_updated\")', '___NL___', '___EOS___']", "index": 240 }, { "content": "class ModuleRegistryException(Exception):\n\n __repr__ = __str__\n\n\n\n _module_name = property(_get_module_name)\n\n _package_name = property(_get_package_name)", "metadata": "root.ModuleRegistryException", "header": "['module', '___EOS___']", "index": 262 }, { "content": " def __init__(self, identifier, name=None, namespace=None,\n package_version=None, module_version=None, module_id=None):\n Exception.__init__(self)\n self._identifier = identifier\n self._name = name\n self._namespace = namespace\n self._package_version = package_version\n self._module_version = module_version\n self._module_id = module_id", "metadata": "root.ModuleRegistryException.__init__", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 263 }, { "content": " def __str__(self):\n p_version_str = \"\"\n m_str = \"\"\n if self._package_version:\n p_version_str = \" (version '%s')\" % self._package_version\n if self._name:\n if self._namespace:\n m_str = \" : %s|%s\" % (self._namespace, self._name)\n else:\n m_str = \" : %s\" % self._name\n if self._module_version:\n m_str += \" (version '%s')\" % self._module_version\n\n return \"RegistryException: %s%s%s\" % (self._identifier,\n p_version_str, m_str)", "metadata": "root.ModuleRegistryException.__str__", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 273 }, { "content": " def __eq__(self, other):\n return type(self) == type(other) and \\\n self._identifier == other._identifier and \\\n self._name == other._name and \\\n self._namespace == other._namespace and \\\n self._package_version == other._package_version and \\\n self._module_version == other._module_version and \\\n self._module_id == other._module_id", "metadata": "root.ModuleRegistryException.__eq__", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 290 }, { "content": " def __hash__(self):\n return (type(self), self._identifier, self._name, self._namespace,\n self._package_version, self._module_version,\n self._module_id).__hash__()", "metadata": "root.ModuleRegistryException.__hash__", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 299 }, { "content": " def _get_module_name(self):\n if self._namespace:\n return \"%s|%s\" % (self._namespace, self._name)\n return self._name", "metadata": "root.ModuleRegistryException._get_module_name", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 304 }, { "content": " def _get_package_name(self):\n if self._package_version:\n return \"%s (version %s)\" % (self._identifier,\n self._package_version)\n return self._identifier", "metadata": "root.ModuleRegistryException._get_package_name", "header": "['class', 'ModuleRegistryException', '(', 'Exception', ')', ':', '___EOS___']", "index": 310 }, { "content": "class MissingPackage(ModuleRegistryException):\n\n __repr__ = __str__\n\n _module_id = property(_get_module_id, _set_module_id)", "metadata": "root.MissingPackage", "header": "['module', '___EOS___']", "index": 317 }, { "content": " def __init__(self, identifier):\n ModuleRegistryException.__init__(self, identifier)", "metadata": "root.MissingPackage.__init__", "header": "['class', 'MissingPackage', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 318 }, { "content": " def __str__(self):\n return \"Missing package: %s\" % self._identifier", "metadata": "root.MissingPackage.__str__", "header": "['class', 'MissingPackage', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 321 }, { "content": " def _get_module_id(self):\n return None", "metadata": "root.MissingPackage._get_module_id", "header": "['class', 'MissingPackage', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 325 }, { "content": " def _set_module_id(self, m_id):\n # do not set\n pass", "metadata": "root.MissingPackage._set_module_id", "header": "['class', 'MissingPackage', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 327 }, { "content": "class MissingModule(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.MissingModule", "header": "['module', '___EOS___']", "index": 332 }, { "content": " def __init__(self, identifier, name, namespace, package_version=None,\n module_id=None):\n ModuleRegistryException.__init__(self, identifier, name, namespace,\n package_version, None, module_id)", "metadata": "root.MissingModule.__init__", "header": "['class', 'MissingModule', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 333 }, { "content": " def __str__(self):\n return \"Missing module %s in package %s\" % (self._module_name,\n self._package_name)", "metadata": "root.MissingModule.__str__", "header": "['class', 'MissingModule', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 338 }, { "content": "class MissingPackageVersion(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.MissingPackageVersion", "header": "['module', '___EOS___']", "index": 343 }, { "content": " def __init__(self, identifier, version):\n ModuleRegistryException.__init__(self, identifier, None, None,\n version)", "metadata": "root.MissingPackageVersion.__init__", "header": "['class', 'MissingPackageVersion', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 344 }, { "content": " def __str__(self):\n return \"Missing version %s of package %s\" % \\\n (self._package_version, self._identifier)", "metadata": "root.MissingPackageVersion.__str__", "header": "['class', 'MissingPackageVersion', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 348 }, { "content": "class MissingModuleVersion(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.MissingModuleVersion", "header": "['module', '___EOS___']", "index": 353 }, { "content": " def __init__(self, identifier, name, namespace, module_version,\n package_version=None, module_id=None):\n ModuleRegistryException.__init__(self, identifier, name, namespace,\n package_version, module_version, module_id)", "metadata": "root.MissingModuleVersion.__init__", "header": "['class', 'MissingModuleVersion', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 354 }, { "content": " def __str__(self):\n return \"Missing version %s of module %s from package %s\" % \\\n (self._module_version, self._module_name, self._package_name)", "metadata": "root.MissingModuleVersion.__str__", "header": "['class', 'MissingModuleVersion', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 359 }, { "content": "class AmbiguousResolution(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.AmbiguousResolution", "header": "['module', '___EOS___']", "index": 364 }, { "content": " def __init__(self, name, namespace, matches):\n ModuleRegistryException.__init__(self, \"<unkown package>\",\n name, namespace)\n self.matches = matches", "metadata": "root.AmbiguousResolution.__init__", "header": "['class', 'AmbiguousResolution', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 365 }, { "content": " def __str__(self):\n return (\"Ambiguous resolution of module %s. Could resolve to:\\n%s\" % \\\n (self._module_name,\n ',\\n'.join(str(m) for m in self.matches)))", "metadata": "root.AmbiguousResolution.__str__", "header": "['class', 'AmbiguousResolution', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 370 }, { "content": "class MissingPort(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.MissingPort", "header": "['module', '___EOS___']", "index": 376 }, { "content": " def __init__(self, descriptor, port_name, port_type):\n ModuleRegistryException.__init__(self,\n descriptor.identifier,\n descriptor.name,\n descriptor.namespace)\n self._port_name = port_name\n self._port_type = port_type", "metadata": "root.MissingPort.__init__", "header": "['class', 'MissingPort', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 377 }, { "content": " def __str__(self):\n return \"Missing %s port %s from module %s in package %s\" % \\\n (self._port_type, self._port_name, self._module_name,\n self._package_name)", "metadata": "root.MissingPort.__str__", "header": "['class', 'MissingPort', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 385 }, { "content": "class PortMismatch(MissingPort):\n\n __repr__ = __str__", "metadata": "root.PortMismatch", "header": "['module', '___EOS___']", "index": 391 }, { "content": " def __init__(self, identifier, name, namespace, port_name, port_type, port_sigstring):\n ModuleRegistryException.__init__(self,\n identifier,\n name,\n namespace)\n\n self._port_name = port_name\n self._port_type = port_type\n self._port_sigstring = port_sigstring", "metadata": "root.PortMismatch.__init__", "header": "['class', 'PortMismatch', '(', 'MissingPort', ')', ':', '___EOS___']", "index": 392 }, { "content": " def __str__(self):\n return (\"%s port '%s' of signature '%s' has bad specification\"\n \" in module %s of package %s\") % \\\n (self._port_type.capitalize(), self._port_name,\n self._port_sigstring, self._module_name, self._package_name)", "metadata": "root.PortMismatch.__str__", "header": "['class', 'PortMismatch', '(', 'MissingPort', ')', ':', '___EOS___']", "index": 402 }, { "content": "class PortsIncompatible(ModuleRegistryException):\n\n\n __repr__ = __str__", "metadata": "root.PortsIncompatible", "header": "['module', '___EOS___']", "index": 409 }, { "content": " def __init__(self, output_identifier, output_name, output_namespace,\n output_port, input_identifier, input_name, input_namespace,\n input_port):\n ModuleRegistryException.__init__(self, output_identifier, output_name,\n output_namespace)\n self._output_port = output_port\n self._input_identifier = input_identifier\n self._input_name = input_name\n self._input_namespace = input_namespace\n self._input_port = input_port", "metadata": "root.PortsIncompatible.__init__", "header": "['class', 'PortsIncompatible', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 411 }, { "content": " def __str__(self):\n if self._namespace:\n out_name = \"%s:%s|%s\" % (self._identifier, self._namespace,\n self._name)\n else:\n out_name = \"%s:%s\" % (self._identifier, self._name)\n if self._input_namespace:\n in_name = \"%s:%s|%s\" % (self._input_identifier,\n self._input_namespace,\n self._input_name)\n else:\n in_name = \"%s:%s\" % (self._input_identifier, self._input_name)\n return ('Output port \"%s\" from module \"%s\" cannot connect to '\n 'input port \"%s\" from module \"%s\".' % (self._output_port,\n out_name,\n self._input_port,\n in_name))", "metadata": "root.PortsIncompatible.__str__", "header": "['class', 'PortsIncompatible', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 422 }, { "content": "class DuplicateModule(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.DuplicateModule", "header": "['module', '___EOS___']", "index": 441 }, { "content": " def __init__(self, old_descriptor, new_identifier, new_name,\n new_namespace):\n ModuleRegistryException.__init__(self,\n new_identifier,\n new_name,\n new_namespace)\n self.old_descriptor = old_descriptor", "metadata": "root.DuplicateModule.__init__", "header": "['class', 'DuplicateModule', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 442 }, { "content": " def __str__(self):\n if self.old_descriptor.namespace:\n old_name = \"%s|%s\" % (self.old_descriptor.namespace,\n self.old_descriptor.name)\n else:\n old_name = self.old_descriptor.name\n return (\"Module %s in package %s already exists as \"\n \"%s in package %s\") % \\\n (self._module_name, self._package_name, old_name,\n self.old_descriptor.identifier)", "metadata": "root.DuplicateModule.__str__", "header": "['class', 'DuplicateModule', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 450 }, { "content": "class DuplicateIdentifier(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.DuplicateIdentifier", "header": "['module', '___EOS___']", "index": 462 }, { "content": " def __init__(self, identifier, name, namespace=None,\n package_version=None, module_version=None):\n ModuleRegistryException.__init__(self, identifier, name, namespace,\n package_version, module_version)", "metadata": "root.DuplicateIdentifier.__init__", "header": "['class', 'DuplicateIdentifier', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 463 }, { "content": " def __str__(self):\n return \"There is already a module %s in package %s\" % \\\n (self._module_name, self._package_name)", "metadata": "root.DuplicateIdentifier.__str__", "header": "['class', 'DuplicateIdentifier', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 468 }, { "content": "class InvalidPortSpec(ModuleRegistryException):\n\n __repr__ = __str__", "metadata": "root.InvalidPortSpec", "header": "['module', '___EOS___']", "index": 473 }, { "content": " def __init__(self, descriptor, port_name, port_type, exc):\n ModuleRegistryException.__init__(self,\n descriptor.identifier,\n descriptor.name,\n descriptor.namespace)\n self._port_name = port_name\n self._port_type = port_type[0].capitalize() + port_type[1:]\n self._exc = exc", "metadata": "root.InvalidPortSpec.__init__", "header": "['class', 'InvalidPortSpec', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 474 }, { "content": " def __str__(self):\n return ('%s port \"%s\" from module %s in package %s '\n 'has bad specification\\n %s' % \\\n (self._port_type, self._port_name, self._module_name,\n self._package_name, str(self._exc)))", "metadata": "root.InvalidPortSpec.__str__", "header": "['class', 'InvalidPortSpec', '(', 'ModuleRegistryException', ')', ':', '___EOS___']", "index": 483 }, { "content": "class MissingBaseClass(Exception):\n\n __repr__ = __str__", "metadata": "root.MissingBaseClass", "header": "['module', '___EOS___']", "index": 490 }, { "content": " def __init__(self, base):\n Exception.__init__(self)\n self._base = base", "metadata": "root.MissingBaseClass.__init__", "header": "['class', 'MissingBaseClass', '(', 'Exception', ')', ':', '___EOS___']", "index": 491 }, { "content": " def __str__(self):\n return \"Base class has not been registered : %s\" % (self._base.__name__)", "metadata": "root.MissingBaseClass.__str__", "header": "['class', 'MissingBaseClass', '(', 'Exception', ')', ':', '___EOS___']", "index": 495 }, { "content": "class ModuleRegistry(DBRegistry):\n \"\"\"Global registry of modules.\n\n This holds all the\n :class:`~vistrails.core.modules.module_descriptor.ModuleDescriptor` objects\n for the VisTrails modules of enabled packages.\n \"\"\"\n\n ##########################################################################\n # Constructor and copy\n\n\n\n\n\n\n\n\n ##########################################################################\n # Properties\n\n package_list = DBRegistry.db_packages\n root_descriptor_id = DBRegistry.db_root_descriptor_id\n\n root_descriptor = property(_get_root_descriptor, _set_root_descriptor)\n\n\n\n\n\n # def has_abs_upgrade(self, descriptor_info):\n # return descriptor_info in self._abs_pkg_upgrades\n\n # def get_abs_upgrade(self, descriptor_info):\n # if self.has_abs_upgrade(descriptor_info):\n # return self._abs_pkg_upgrades[descriptor_info]\n # return None\n\n ##########################################################################\n # Per-module registry functions\n\n\n\n has_module = has_descriptor_with_name\n\n\n\n\n # get_descriptor_from_module is a synonym for get_descriptor\n get_descriptor_from_module = get_descriptor\n\n\n\n\n\n\n ##########################################################################\n # Legacy\n\n\n ##########################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n is_constant = is_method\n\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.ModuleRegistry", "header": "['module', '___EOS___']", "index": 499 }, { "content": " def __init__(self, *args, **kwargs):\n if 'root_descriptor_id' not in kwargs:\n kwargs['root_descriptor_id'] = -1\n DBRegistry.__init__(self, *args, **kwargs)\n\n self._conversions = dict()\n self._converters = set()\n\n self.set_defaults()", "metadata": "root.ModuleRegistry.__init__", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 510 }, { "content": " def __copy__(self):\n ModuleRegistry.do_copy(self)", "metadata": "root.ModuleRegistry.__copy__", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 520 }, { "content": " def set_defaults(self, other=None):\n self._root_descriptor = None\n self.signals = ModuleRegistrySignals()\n self.setup_indices()\n if other is None:\n # _constant_hasher_map stores callables for custom parameter\n # hashers\n self._constant_hasher_map = {}\n basic_pkg = get_vistrails_basic_pkg_id()\n if basic_pkg in self.packages:\n self._default_package = self.packages[basic_pkg]\n self._current_package = self._default_package\n else:\n self._default_package = None\n self._current_package = None\n else:\n self._constant_hasher_map = copy.copy(other._constant_hasher_map)\n self._current_package = \\\n self.packages[other._current_package.identifier]\n self._default_package = \\\n self.packages[other._default_package.identifier]", "metadata": "root.ModuleRegistry.set_defaults", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 523 }, { "content": " def setup_indices(self):\n self.descriptors_by_id = {}\n self.package_versions = self.db_packages_identifier_index\n self.packages = {}\n self._module_key_map = {}\n for pkg in self.package_versions.itervalues():\n for key in chain(pkg.old_identifiers, [pkg.identifier]):\n if key in self.packages:\n old_pkg = self.packages[key]\n if versions_increasing(old_pkg.version, pkg.version):\n self.packages[key] = pkg\n else:\n self.packages[key] = pkg\n for descriptor in pkg.descriptor_list:\n self.descriptors_by_id[descriptor.id] = descriptor\n k = (descriptor.identifier, descriptor.name,\n descriptor.namespace, pkg.version, descriptor.version)\n if descriptor.module is not None:\n self._module_key_map[descriptor.module] = k\n for descriptor in self.descriptors_by_id.itervalues():\n if descriptor.base_descriptor_id in self.descriptors_by_id:\n base_descriptor = \\\n self.descriptors_by_id[descriptor.base_descriptor_id]\n if descriptor not in base_descriptor.children:\n base_descriptor.children.append(descriptor)", "metadata": "root.ModuleRegistry.setup_indices", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 545 }, { "content": " def do_copy(self, new_ids=False, id_scope=None, id_remap=None):\n cp = DBRegistry.do_copy(self, new_ids, id_scope, id_remap)\n cp.__class__ = ModuleRegistry\n cp.set_defaults(self)\n return cp", "metadata": "root.ModuleRegistry.do_copy", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 571 }, { "content": " @staticmethod\n def convert(_reg):\n if _reg.__class__ == ModuleRegistry:\n return\n _reg.__class__ = ModuleRegistry\n for package in _reg.package_list:\n Package.convert(package)\n _reg.set_defaults()", "metadata": "root.ModuleRegistry.convert", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 577 }, { "content": " def set_global(self):\n global registry, add_module, add_input_port, has_input_port, \\\n add_output_port, set_current_package, get_descriptor_by_name, \\\n get_module_by_name, get_descriptor\n\n if registry is not None:\n raise VistrailsInternalError(\"Global registry already set.\")\n\n registry = self\n add_module = self.add_module\n add_input_port = self.add_input_port\n has_input_port = self.has_input_port\n add_output_port = self.add_output_port\n set_current_package = self.set_current_package\n get_descriptor_by_name = self.get_descriptor_by_name\n get_module_by_name = self.get_module_by_name\n get_descriptor = self.get_descriptor", "metadata": "root.ModuleRegistry.set_global", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 586 }, { "content": " def _get_root_descriptor(self):\n if self._root_descriptor is None:\n if self.root_descriptor_id >= 0:\n self._root_descriptor = \\\n self.descriptors_by_id[self.root_descriptor_id]\n return self._root_descriptor", "metadata": "root.ModuleRegistry._get_root_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 610 }, { "content": " def _set_root_descriptor(self, descriptor):\n self._root_descriptor = descriptor\n self.root_descriptor_id = descriptor.id", "metadata": "root.ModuleRegistry._set_root_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 616 }, { "content": " def add_descriptor(self, desc, package=None):\n if package is None:\n package = self._default_package\n # self.descriptors[(desc.package, desc.name, desc.namespace)] = desc\n self.descriptors_by_id[desc.id] = desc\n package.add_descriptor(desc)", "metadata": "root.ModuleRegistry.add_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 621 }, { "content": " def delete_descriptor(self, desc, package=None):\n if package is None:\n try:\n package = self.packages[desc.identifier]\n except KeyError:\n package = self._default_package\n if desc.base_descriptor_id != -1 and desc.base_descriptor:\n desc.base_descriptor.children.remove(desc)\n # del self.descriptors[(desc.package, desc.name, desc.namespace)]\n del self.descriptors_by_id[desc.id]\n package.delete_descriptor(desc)", "metadata": "root.ModuleRegistry.delete_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 627 }, { "content": " def add_package(self, package):\n DBRegistry.db_add_package(self, package)\n for key in chain(package.old_identifiers, [package.identifier]):\n if key in self.packages:\n old_pkg = self.packages[key]\n if versions_increasing(old_pkg.version, package.version):\n self.packages[key] = package\n else:\n self.packages[key] = package", "metadata": "root.ModuleRegistry.add_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 638 }, { "content": " def delete_package(self, package):\n DBRegistry.db_delete_package(self, package)\n # FIXME hard to incremental updates here so we'll just recreate\n # this can be slow\n self.setup_indices()", "metadata": "root.ModuleRegistry.delete_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 648 }, { "content": " def has_abs_upgrade(self, identifier, name, namespace='',\n package_version='', module_version=''):\n\n # if this fails, we want to raise the exception\n try:\n package = self.get_package_by_name(identifier, package_version)\n except MissingPackageVersion:\n package = self.get_package_by_name(identifier)\n return package.has_abs_upgrade(name, namespace, module_version)", "metadata": "root.ModuleRegistry.has_abs_upgrade", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 654 }, { "content": " def get_abs_upgrade(self, identifier, name, namespace='',\n package_version='', module_version=''):\n try:\n package = self.get_package_by_name(identifier, package_version)\n except MissingPackageVersion:\n package = self.get_package_by_name(identifier)\n return package.get_abs_upgrade(name, namespace, module_version)", "metadata": "root.ModuleRegistry.get_abs_upgrade", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 664 }, { "content": " def get_package_by_name(self, identifier, package_version=''):\n package_version = package_version or ''\n package_version_key = (identifier, package_version)\n# if package_version is not None and package_version.strip() == \"\":\n# package_version = None\n try:\n if not package_version:\n return self.packages[identifier]\n else:\n return self.package_versions[package_version_key]\n except KeyError:\n if identifier not in self.packages:\n raise MissingPackage(identifier)\n elif package_version and \\\n package_version_key not in self.package_versions:\n raise MissingPackageVersion(identifier, package_version)", "metadata": "root.ModuleRegistry.get_package_by_name", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 683 }, { "content": " def get_module_by_name(self, identifier, name, namespace=None):\n \"\"\"Gets a module (the class) from its name and package.\n\n :returns: The subclass of\n :class:`~vistrails.core.modules.vistrails_module.Module` registered\n under the given name (**not** the ModuleDescriptor).\n \"\"\"\n return self.get_descriptor_by_name(identifier, name, namespace).module", "metadata": "root.ModuleRegistry.get_module_by_name", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 700 }, { "content": " def has_descriptor_with_name(self, identifier, name, namespace='',\n package_version='', module_version=''):\n namespace = namespace or ''\n package_version = package_version or ''\n module_version = module_version or ''\n\n try:\n if not package_version:\n package = self.packages[identifier]\n else:\n package_version_key = (identifier, package_version)\n package = self.package_versions[package_version_key]\n if not module_version:\n descriptor = package.descriptors[(name, namespace)]\n else:\n descriptor_version_key = (name, namespace, module_version)\n descriptor = \\\n package.descriptor_versions[descriptor_version_key]\n except KeyError:\n return False\n return True", "metadata": "root.ModuleRegistry.has_descriptor_with_name", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 709 }, { "content": " def get_descriptor_by_name(self, identifier, name, namespace='',\n package_version='', module_version=''):\n \"\"\"Gets the specified descriptor from the registry.\n\n If you do not specify package_version, you will get the currently\n loaded version.\n If you do not specify the module_version, you will get the most recent\n version. Note that module_version is currently only used for\n abstractions.\n\n :raises ModuleRegistryException: if lookup fails.\n \"\"\"\n namespace = namespace or ''\n package_version = package_version or ''\n module_version = module_version or ''\n\n try:\n package = self.packages[identifier]\n except KeyError:\n raise MissingPackage(identifier)\n if package_version:\n try:\n package = self.package_versions[(identifier, package_version)]\n except KeyError:\n raise MissingPackageVersion(identifier, package_version)\n try:\n descriptor = package.descriptors[(name, namespace)]\n except KeyError:\n raise MissingModule(identifier, name, namespace,\n package_version)\n if module_version:\n descriptor_version_key = (name, namespace, module_version)\n try:\n descriptor = \\\n package.descriptor_versions[descriptor_version_key]\n except KeyError:\n raise MissingModuleVersion(identifier, name, namespace,\n module_version, package_version)\n return descriptor", "metadata": "root.ModuleRegistry.get_descriptor_by_name", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 732 }, { "content": " def get_similar_descriptor(self, identifier, name, namespace=None,\n package_version=None, module_version=None):\n try:\n return self.get_descriptor_by_name(identifier, name, namespace,\n package_version, module_version)\n except MissingPackageVersion:\n return self.get_similar_descriptor(identifier, name, namespace,\n None, module_version)\n except MissingModuleVersion:\n return self.get_similar_descriptor(identifier, name, namespace,\n package_version, None)", "metadata": "root.ModuleRegistry.get_similar_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 772 }, { "content": " def get_descriptor(self, module):\n \"\"\"Gets a ModuleDescriptor from a given Module subclass.\n \"\"\"\n # assert isinstance(module, type)\n # assert issubclass(module, core.modules.vistrails_module.Module)\n # assert self._module_key_map.has_key(module)\n k = self._module_key_map[module]\n return self.get_descriptor_by_name(*k)", "metadata": "root.ModuleRegistry.get_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 784 }, { "content": " def module_ports(self, p_type, descriptor):\n return [(p.name, p)\n for p in descriptor.port_specs_list\n if p.type == p_type]", "metadata": "root.ModuleRegistry.module_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 796 }, { "content": " def module_source_ports_from_descriptor(self, do_sort, descriptor):\n ports = {}\n for desc in reversed(self.get_module_hierarchy(descriptor)):\n ports.update(self.module_ports('output', desc))\n all_ports = ports.values()\n if do_sort:\n all_ports.sort(key=lambda x: (x.sort_key, x.id))\n return all_ports", "metadata": "root.ModuleRegistry.module_source_ports_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 801 }, { "content": " def module_source_ports(self, do_sort, identifier, module_name,\n namespace=None, version=None):\n descriptor = self.get_descriptor_by_name(identifier, module_name,\n namespace, version)\n return self.module_source_ports_from_descriptor(do_sort, descriptor)", "metadata": "root.ModuleRegistry.module_source_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 810 }, { "content": " def module_destination_ports_from_descriptor(self, do_sort, descriptor):\n ports = {}\n for desc in reversed(self.get_module_hierarchy(descriptor)):\n ports.update(self.module_ports('input', desc))\n all_ports = ports.values()\n if do_sort:\n all_ports.sort(key=lambda x: (x.sort_key, x.id))\n return all_ports", "metadata": "root.ModuleRegistry.module_destination_ports_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 816 }, { "content": " def module_destination_ports(self, do_sort, identifier, module_name,\n namespace=None, version=None):\n descriptor = self.get_descriptor_by_name(identifier, module_name,\n namespace, version)\n return self.module_destination_ports_from_descriptor(do_sort,\n descriptor)", "metadata": "root.ModuleRegistry.module_destination_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 825 }, { "content": " def get_descriptor_from_name_only(self, name):\n \"\"\"Gets a ModuleDescriptor from a name.\n\n This tries to return a descriptor from a name without a\n package. The call should only be used for converting from\n legacy vistrails to new ones. For one, it is slow on misses.\n\n .. deprecated:: 1.0\n This is very unsafe and get_descriptor_by_name should be used\n instead.\n \"\"\"\n matches = []\n for pkg in self.package_list:\n matches.extend((pkg, key) for key in pkg.descriptors.iterkeys()\n if key[0] == name)\n if len(matches) == 0:\n raise MissingModule(\"<unknown package>\", name, None)\n if len(matches) > 1:\n matches_str = [(m[0].identifier, m[1][0], m[1][1],\n m[0].version) for m in matches]\n raise AmbiguousResolution(name, None, matches_str)\n (pkg, key) = matches[0]\n desc = pkg.descriptors[key]\n result = self.get_descriptor_by_name(pkg.identifier, desc.name,\n desc.namespace, pkg.version,\n desc.version)\n return result", "metadata": "root.ModuleRegistry.get_descriptor_from_name_only", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 835 }, { "content": " def module_signature(self, pipeline, module):\n \"\"\"Computes the signature of a Module in a given Pipeline.\n\n This might involve a user-defined hasher.\n \"\"\"\n chm = self._constant_hasher_map\n descriptor = self.get_descriptor_by_name(module.package,\n module.name,\n module.namespace)\n if not descriptor:\n return vistrails.core.cache.hasher.Hasher.module_signature(module, chm)\n c = descriptor.hasher_callable()\n if c:\n return c(pipeline, module, chm)\n else:\n return vistrails.core.cache.hasher.Hasher.module_signature(module, chm)", "metadata": "root.ModuleRegistry.module_signature", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 865 }, { "content": " def get_module_color(self, identifier, name, namespace=None):\n return self.get_descriptor_by_name(identifier, name, namespace).module_color()", "metadata": "root.ModuleRegistry.get_module_color", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 882 }, { "content": " def get_module_fringe(self, identifier, name, namespace=None):\n return self.get_descriptor_by_name(identifier, name, namespace).module_fringe()", "metadata": "root.ModuleRegistry.get_module_fringe", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 885 }, { "content": " def update_registry(self, base_descriptor, module, identifier, name,\n namespace, package_version=None, version=None):\n if namespace is not None and not namespace.strip():\n namespace = None\n\n # add to package list, creating new package if necessary\n if identifier not in self.packages:\n if self._current_package.identifier == identifier:\n package = self._current_package\n else:\n package_id = self.idScope.getNewId(Package.vtType)\n package = Package(id=package_id,\n codepath=\"\",\n load_configuration=False,\n name=\"\",\n identifier=identifier,\n version=package_version,\n )\n self.add_package(package)\n else:\n package = self.package_versions[(identifier, package_version)]\n\n # create descriptor\n descriptor_id = self.idScope.getNewId(ModuleDescriptor.vtType)\n descriptor = ModuleDescriptor(id=descriptor_id,\n module=module,\n package=identifier,\n base_descriptor=base_descriptor,\n name=name,\n namespace=namespace,\n package_version=package_version,\n version=version\n )\n self.add_descriptor(descriptor, package)\n\n # invalidate the map of converters\n if issubclass(module,\n vistrails.core.modules.vistrails_module.Converter):\n self._conversions = dict()\n self._converters.add(descriptor)\n\n if module is not None:\n self._module_key_map[module] = (identifier, name, namespace,\n package_version, version)\n return descriptor", "metadata": "root.ModuleRegistry.update_registry", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 888 }, { "content": " def convert_port_val(self, val, sig=None, cls=None):\n basic_pkg = get_vistrails_basic_pkg_id()\n if sig is None and cls is None:\n raise ValueError(\"One of sig or cls must be set\")\n try:\n if sig is not None:\n desc = self.get_descriptor_by_name(*sig)\n else:\n desc = self.get_descriptor(cls)\n except Exception, e:\n debug.unexpected_exception(e)\n raise VistrailsInternalError(\"Cannot convert value %r due to \"\n \"missing descriptor for port\" % val)\n constant_desc = self.get_descriptor_by_name(basic_pkg, 'Constant')\n if not self.is_descriptor_subclass(desc, constant_desc):\n raise TypeError(\"Cannot convert value for non-constant type\")\n if desc.module is None:\n return None\n\n if not isinstance(val, basestring):\n retval = desc.module.translate_to_string(val)\n else:\n checkval = desc.module.translate_to_python(val)\n retval = desc.module.translate_to_string(checkval)\n if isinstance(checkval, basestring) and retval != val:\n # we have a string -> string conversion that doesn't\n # match\n retval = desc.module.translate_to_string(val)\n return retval", "metadata": "root.ModuleRegistry.convert_port_val", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 934 }, { "content": " def decode_port(self, port_info, simple_t, compound_t, deprecated_t,\n is_input):\n if (not isinstance(port_info, simple_t) and\n not isinstance(port_info, compound_t)):\n port_name = port_info[0]\n port_sig = port_info[1]\n if len(port_info) > 2:\n if isinstance(port_info[2], dict):\n port_info = compound_t(port_info[0],\n port_info[1],\n **port_info[2])\n\n else:\n dep_port_info = deprecated_t(*port_info)\n port_info = \\\n compound_t(**dep_port_info._asdict())\n else:\n port_info = compound_t(*port_info)\n\n # convert simple ports to compound ones\n kwargs = port_info._asdict()\n port_name = kwargs.pop('name')\n port_sig = kwargs.pop('signature')\n if is_input and isinstance(port_info, simple_t):\n kwargs['labels'] = [kwargs.pop('label')]\n kwargs['defaults'] = [kwargs.pop('default')]\n kwargs['values'] = [kwargs.pop('values')]\n kwargs['entry_types'] = [kwargs.pop('entry_type')]\n elif isinstance(port_info, compound_t):\n # have compound port\n port_items = kwargs.pop('items')\n if port_items is not None:\n sig_items = []\n labels = []\n defaults = []\n values = []\n entry_types = []\n for item in port_info.items:\n if not isinstance(item.signature,\n basestring):\n d = self.get_descriptor(item.signature)\n sig_items.append(create_port_spec_item_string(\n d.package, d.name, d.namespace))\n else:\n sig_items.append(item.signature)\n labels.append(item.label)\n defaults.append(item.default)\n values.append(item.values)\n entry_types.append(item.entry_type)\n kwargs['signature'] = ','.join(sig_items)\n if is_input:\n kwargs['labels'] = labels\n kwargs['defaults'] = defaults\n kwargs['values'] = values\n kwargs['entry_types'] = entry_types\n\n return port_name, port_sig, kwargs", "metadata": "root.ModuleRegistry.decode_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 964 }, { "content": " def decode_input_port(self, port_info):\n return self.decode_port(\n port_info,\n InputPort, CompoundInputPort, DeprecatedInputPort,\n True)", "metadata": "root.ModuleRegistry.decode_input_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1022 }, { "content": " def decode_output_port(self, port_info):\n return self.decode_port(\n port_info,\n OutputPort, CompoundOutputPort, OutputPort,\n False)", "metadata": "root.ModuleRegistry.decode_output_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1028 }, { "content": " def auto_add_ports(self, module):\n \"\"\"Add input/output ports to the registry.\n\n This isn't meant to be called directly -- it is used by the\n PackageManager to register modules automatically by inspecting a\n package's contents.\n \"\"\"\n if '_input_ports' in module.__dict__:\n for port_info in module._input_ports:\n name = None\n try:\n name, sig, kwargs = self.decode_input_port(port_info)\n self.add_input_port(module, name, sig, **kwargs)\n except Exception, e:\n debug.unexpected_exception(e)\n debug.critical(\n \"Failed to add input port %s to module '%s'\" % (\n '\"%s\"' % name if name is not None\n else \"(unknown)\", module.__name__),\n e)\n raise\n\n if '_output_ports' in module.__dict__:\n for port_info in module._output_ports:\n name = None\n try:\n name, sig, kwargs = self.decode_output_port(port_info)\n self.add_output_port(module, name, sig, **kwargs)\n except Exception, e:\n debug.unexpected_exception(e)\n debug.critical(\n \"Failed to add output port %s to module '%s'\" % (\n '\"%s\"' % name if name is not None\n else \"(unknown)\", module.__name__),\n e)\n raise", "metadata": "root.ModuleRegistry.auto_add_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1034 }, { "content": " def auto_add_module(self, module):\n \"\"\"Add a module to the regsitry.\n\n Don't call this directly - it is meant to be used by the\n PackageManager, when inspecting a package's contents.\n \"\"\"\n if isinstance(module, type):\n return self.add_module(module)\n elif (isinstance(module, tuple) and\n len(module) == 2 and\n isinstance(module[0], type) and\n isinstance(module[1], dict)):\n descriptor = self.add_module(module[0], **module[1])\n return descriptor\n else:\n raise TypeError(\"Expected module or (module, kwargs)\")", "metadata": "root.ModuleRegistry.auto_add_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1071 }, { "content": " def add_module(self, module, **kwargs):\n \"\"\"Add a module to the registry.\n\n Options are taken from the `_settings` attribute, a\n :class:`~vistrails.core.modules.config.ModuleSettings` instance. All of\n the attributes of that class may also be used as kwargs to\n `add_module()`.\n\n :returns: The new\n :class:`~vistrails.core.modules.module_descriptor.ModuleDescriptor`\n \"\"\"\n def remap_dict(d):\n remap = {'configureWidgetType': 'configure_widget',\n 'constantWidget': 'constant_widget',\n 'constantWidgets': 'constant_widgets',\n 'signatureCallable': 'signature',\n 'constantSignatureCallable': 'constant_signature',\n 'moduleColor': 'color',\n 'moduleFringe': 'fringe',\n 'moduleLeftFringe': 'left_fringe',\n 'moduleRightFringe': 'right_fringe',\n 'is_abstract': 'abstract'}\n remapped_d = {}\n for k, v in d.iteritems():\n if k in remap:\n remapped_d[remap[k]] = v\n else:\n remapped_d[k] = v\n return remapped_d\n\n module_settings = None\n if '_settings' in module.__dict__:\n settings = module.__dict__['_settings']\n if isinstance(settings, ModuleSettings):\n module_settings = settings\n elif isinstance(settings, dict):\n module_settings = ModuleSettings(**remap_dict(settings))\n else:\n raise TypeError(\"Expected module._settings to be \"\n \"ModuleSettings or dict\")\n\n remapped_kwargs = remap_dict(kwargs)\n if module_settings is not None:\n module_settings = module_settings._replace(**remapped_kwargs)\n else:\n module_settings = ModuleSettings(**remapped_kwargs)\n return self.add_module_from_settings(module, module_settings)", "metadata": "root.ModuleRegistry.add_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1088 }, { "content": " def add_module_from_settings(self, module, settings):\n \"\"\"Adds a module to the registry, with an explicit `ModuleSettings`.\n\n See :class:`~vistrails.core.modules.config.ModuleSettings`.\n\n :returns: The new\n :class:`~vistrails.core.modules.module_descriptor.ModuleDescriptor`\n \"\"\"\n\n def get_setting(attr, default_val):\n val = getattr(settings, attr)\n if val is None:\n return default_val\n return val\n\n name = get_setting('name', module.__name__)\n\n default_identifier = None\n default_version = \"\"\n if self._current_package is not None:\n default_identifier = self._current_package.identifier\n default_version = self._current_package.version\n identifier = get_setting('package', default_identifier)\n package_version = get_setting('package_version', default_version)\n namespace = settings.namespace\n version = settings.version\n\n if identifier is None:\n raise VistrailsInternalError(\"No package is currently being \"\n \"loaded and argument 'package' is \"\n \"not specified.\")\n\n package = self.package_versions[(identifier, package_version)]\n desc_key = (name, namespace, version)\n if desc_key in package.descriptor_versions:\n raise ModuleAlreadyExists(identifier, name)\n\n # We allow multiple inheritance as long as only one of the superclasses\n # is a subclass of Module.\n if settings.is_root:\n base_descriptor = None\n else:\n candidates = self.get_subclass_candidates(module)\n if len(candidates) != 1:\n raise InvalidModuleClass(module)\n base_class = candidates[0]\n if base_class not in self._module_key_map:\n raise MissingBaseClass(base_class)\n base_descriptor = self.get_descriptor(base_class)\n\n if module in self._module_key_map:\n # This is really obsolete as having two descriptors\n # pointing to the same module isn't a big deal except to\n # get_descriptor which shouldn't be used often\n if identifier != 'local.abstractions':\n raise DuplicateModule(self.get_descriptor(module), identifier,\n name, namespace)\n elif self.has_descriptor_with_name(identifier, name, namespace,\n package_version, version):\n raise DuplicateIdentifier(identifier, name, namespace,\n package_version, version)\n descriptor = self.update_registry(base_descriptor, module, identifier,\n name, namespace, package_version,\n version)\n if settings.is_root:\n self.root_descriptor = descriptor\n\n descriptor.set_module_abstract(settings.abstract)\n descriptor.set_configuration_widget(settings.configure_widget)\n # descriptor.set_configuration_widget(configureWidget)\n descriptor.is_hidden = settings.hide_descriptor\n descriptor.namespace_hidden = settings.hide_namespace\n\n if settings.signature:\n descriptor.set_hasher_callable(settings.signature)\n\n if settings.constant_signature:\n if not self.is_constant_module(module):\n raise TypeError(\"To set constant_signature, module \"\n \"must be a subclass of Constant\")\n\n # FIXME, currently only allow one per hash, no versioning\n hash_key = (identifier, name, namespace)\n self._constant_hasher_map[hash_key] = settings.constant_signature\n\n constant_widgets = []\n if settings.constant_widget:\n constant_widgets += [settings.constant_widget]\n if settings.constant_widgets is not None:\n constant_widgets += settings.constant_widgets\n if len(constant_widgets) > 0:\n if not self.is_constant_module(module):\n raise TypeError(\"To set constant widgets, module \" +\n \"must be a subclass of Constant\")\n for widget_t in constant_widgets:\n if isinstance(widget_t, tuple):\n widget_t = ConstantWidgetConfig(*widget_t)\n else:\n widget_t = ConstantWidgetConfig(widget_t)\n if widget_t.widget is not None:\n self.set_constant_config_widget(descriptor,\n widget_t.widget,\n widget_t.widget_type,\n widget_t.widget_use)\n\n descriptor.set_module_color(settings.color)\n\n if settings.fringe:\n _check_fringe(settings.fringe)\n left_fringe = list(reversed([(-x, 1.0-y) for (x, y) in \\\n settings.fringe]))\n descriptor.set_module_fringe(left_fringe, settings.fringe)\n elif settings.left_fringe and settings.right_fringe:\n _check_fringe(settings.left_fringe)\n _check_fringe(settings.right_fringe)\n descriptor.set_module_fringe(settings.left_fringe,\n settings.right_fringe)\n\n if settings.ghost_package:\n descriptor.ghost_identifier = settings.ghost_package\n if settings.ghost_package_version:\n descriptor.ghost_package_version = settings.ghost_package_version\n if settings.ghost_namespace:\n descriptor.ghost_namespace = settings.ghost_namespace\n\n self.signals.emit_new_module(descriptor)\n if self.is_abstraction(descriptor):\n self.signals.emit_new_abstraction(descriptor)\n return descriptor", "metadata": "root.ModuleRegistry.add_module_from_settings", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1136 }, { "content": " def auto_add_subworkflow(self, subworkflow):\n if isinstance(subworkflow, str):\n return self.add_subworkflow(subworkflow)\n elif (isinstance(subworkflow, tuple) and\n len(subworkflow) == 2 and\n isinstance(subworkflow[0], str) and\n isinstance(subworkflow[1], dict)):\n descriptor = self.add_subworkflow(subworkflow[0], **subworkflow[1])\n return descriptor\n else:\n raise TypeError(\"Expected filename or (filename, kwargs)\")", "metadata": "root.ModuleRegistry.auto_add_subworkflow", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1266 }, { "content": " def add_subworkflow(self, vt_fname, **kwargs):\n from vistrails.core.modules.sub_module import new_abstraction, read_vistrail, \\\n get_next_abs_annotation_key\n\n # vt_fname is relative to the package path\n if 'package' in kwargs:\n identifier = kwargs['package']\n else:\n identifier = self._current_package.identifier\n if 'package_version' in kwargs:\n package_version = kwargs['package_version']\n else:\n package_version = self._current_package.version\n if 'version' in kwargs:\n version = kwargs['version']\n else:\n version = -1L\n if 'name' in kwargs:\n name = kwargs['name']\n else:\n name = _parse_abstraction_name(vt_fname)\n kwargs['name'] = name\n\n package = self.package_versions[(identifier, package_version)]\n if not os.path.isabs(vt_fname):\n vt_fname = os.path.join(package.package_dir, vt_fname)\n else:\n debug.warning(\"Using absolute path for subworkflow: '%s'\" % \\\n vt_fname)\n\n vistrail = read_vistrail(vt_fname)\n namespace = kwargs.get('namespace', '')\n\n # create module from workflow\n module = None\n is_upgraded_abstraction = False\n try:\n module = new_abstraction(name, vistrail, vt_fname, version)\n except InvalidPipeline, e:\n # This import MUST be delayed until this point or it will fail\n import vistrails.core.vistrail.controller\n from vistrails.core.db.io import save_vistrail_to_xml\n from vistrails.core.modules.abstraction import identifier as \\\n abstraction_pkg, version as abstraction_ver\n # Use a \"dummy\" controller to handle the upgrade\n controller = vistrails.core.vistrail.controller.VistrailController(vistrail)\n if version == -1L:\n version = vistrail.get_latest_version()\n (new_version, new_pipeline) = \\\n controller.handle_invalid_pipeline(e, long(version), vistrail,\n False, True)\n del controller\n vistrail.set_annotation('__abstraction_descriptor_info__',\n (identifier, name, namespace,\n package_version, str(version)))\n vt_save_dir = tempfile.mkdtemp(prefix='vt_upgrade_abs')\n vt_fname = os.path.join(vt_save_dir, os.path.basename(vt_fname))\n\n\n # need to create new namespace for upgraded version\n new_namespace = str(uuid.uuid1())\n annotation_key = get_next_abs_annotation_key(vistrail)\n vistrail.set_annotation(annotation_key, new_namespace)\n\n # FIXME: Should delete this upgrade file when vistrails is exited\n save_vistrail_to_xml(vistrail, vt_fname)\n module = new_abstraction(name, vistrail, vt_fname, new_version,\n new_pipeline)\n # need to set identifier to local.abstractions and its version\n kwargs['package'] = abstraction_pkg\n kwargs['package_version'] = abstraction_ver\n # only want to change the namespace on the new version\n # (the one being added to local.abstractions)\n kwargs['namespace'] = new_namespace\n\n # Set ghost attributes so module palette shows it in\n # package instead of 'My Subworkflows'\n kwargs['ghost_package'] = identifier\n kwargs['ghost_package_version'] = package_version\n kwargs['ghost_namespace'] = namespace\n is_upgraded_abstraction = True\n\n module.internal_version = str(module.internal_version)\n kwargs['version'] = module.internal_version\n descriptor = None\n if kwargs:\n descriptor = self.add_module(module, **kwargs)\n else:\n descriptor = self.add_module(module)\n if is_upgraded_abstraction:\n descriptor_info = (identifier, name, namespace,\n package_version, str(version))\n # print 'adding to upgrades:', descriptor_info\n # print ' ', descriptor.package, descriptor.name, descriptor.namespace, descriptor.version, descriptor.package_version\n if identifier != abstraction_pkg:\n info_exc = ModuleRegistryException(*descriptor_info)\n debug.critical(\"Module %s in package %s is out-of-date. \"\n \"Please check with the package developer for \"\n \"a new version.\" % (info_exc._module_name,\n info_exc._package_name))\n package.add_abs_upgrade(descriptor, name, namespace, str(version))\n self.auto_add_ports(descriptor.module)\n return descriptor", "metadata": "root.ModuleRegistry.add_subworkflow", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1278 }, { "content": " def has_input_port(self, module, portName):\n descriptor = self.get_descriptor(module)\n # return descriptor.input_ports.has_key(portName)\n return (portName, 'input') in descriptor.port_specs", "metadata": "root.ModuleRegistry.has_input_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1382 }, { "content": " def has_output_port(self, module, portName):\n descriptor = self.get_descriptor(module)\n # return descriptor.output_ports.has_key(portName)\n return (portName, 'output') in descriptor.port_specs", "metadata": "root.ModuleRegistry.has_output_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1387 }, { "content": " def create_port_spec(self, name, type, signature=None, sigstring=None,\n optional=False, sort_key=-1, labels=None,\n defaults=None, values=None, entry_types=None,\n docstring=None, shape=None,\n min_conns=0, max_conns=-1, depth=0):\n if signature is None and sigstring is None:\n raise VistrailsInternalError(\"create_port_spec: one of signature \"\n \"and sigstring must be specified\")\n spec_id = self.idScope.getNewId(PortSpec.vtType)\n\n # convert values of defaults and values if necessary\n if defaults is not None or values is not None:\n parse_port_spec_string = \\\n vistrails.core.modules.utils.parse_port_spec_string\n # parse port specs as necessary\n if sigstring is not None:\n sigstrings = parse_port_spec_string(sigstring)\n sig_cls_list = [None,] * len(sigstrings)\n else:\n if isinstance(signature, collections.Sequence):\n sig_cls_list = signature\n sigstrings = [None,] * len(sig_cls_list)\n else:\n sig_cls_list = [signature]\n sigstrings = [None,]\n if defaults is not None:\n new_defaults = []\n if isinstance(defaults, basestring):\n defaults = literal_eval(defaults)\n if not isinstance(defaults, list):\n raise ValueError('Defaults for port \"%s\" must be a list' %\n name)\n for i, default_val in enumerate(defaults):\n if default_val is not None:\n default_conv = self.convert_port_val(default_val,\n sigstrings[i],\n sig_cls_list[i])\n if default_conv is not None:\n new_defaults.append(default_conv)\n else:\n new_defaults.append(None)\n else:\n new_defaults.append(None)\n defaults = new_defaults\n if values is not None:\n new_values = []\n if isinstance(values, basestring):\n values = literal_eval(values)\n if not isinstance(values, list):\n raise ValueError('Values for port \"%s\" must be a list '\n 'of lists' % name)\n for i, values_list in enumerate(values):\n if isinstance(values_list, basestring):\n values_list = literal_eval(values_list)\n if values_list is not None:\n if not isinstance(values_list, list):\n raise ValueError('Values for port \"%s\" must be '\n 'a list of lists' % name)\n new_values_list = []\n for val in values_list:\n if val is not None:\n val_conv = self.convert_port_val(val,\n sigstrings[i],\n sig_cls_list[i])\n if val_conv is not None:\n new_values_list.append(val_conv)\n new_values.append(new_values_list)\n else:\n new_values.append(None)\n values = new_values\n\n spec = PortSpec(id=spec_id,\n name=name,\n type=type,\n signature=signature,\n sigstring=sigstring,\n optional=optional,\n sort_key=sort_key,\n labels=labels,\n defaults=defaults,\n values=values,\n entry_types=entry_types,\n docstring=docstring,\n shape=shape,\n min_conns=min_conns,\n max_conns=max_conns,\n depth=depth)\n\n # don't know how many port spec items are created until after...\n for psi in spec.port_spec_items:\n psi.id = self.idScope.getNewId(PortSpecItem.vtType)\n return spec", "metadata": "root.ModuleRegistry.create_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1392 }, { "content": " def add_port_spec(self, descriptor, spec):\n # check if the spec is valid\n try:\n spec.descriptors()\n except ModuleRegistryException, e:\n raise InvalidPortSpec(descriptor, spec.name, spec.type, e)\n\n descriptor.add_port_spec(spec)\n if spec.type == 'input':\n self.signals.emit_new_input_port(descriptor.identifier,\n descriptor.name, spec.name, spec)\n elif spec.type == 'output':\n self.signals.emit_new_output_port(descriptor.identifier,\n descriptor.name, spec.name, spec)", "metadata": "root.ModuleRegistry.add_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1485 }, { "content": " def get_port_spec_from_descriptor(self, desc, port_name, port_type):\n for d in self.get_module_hierarchy(desc):\n if d.has_port_spec(port_name, port_type):\n return d.get_port_spec(port_name, port_type)\n\n # if we don't find it, raise MissingPort exception\n raise MissingPort(desc, port_name, port_type)", "metadata": "root.ModuleRegistry.get_port_spec_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1500 }, { "content": " def get_port_spec(self, package, module_name, namespace,\n port_name, port_type):\n desc = self.get_descriptor_by_name(package, module_name, namespace)\n return self.get_port_spec_from_descriptor(desc, port_name,\n port_type)", "metadata": "root.ModuleRegistry.get_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1508 }, { "content": " def has_port_spec_from_descriptor(self, desc, port_name, port_type):\n for d in self.get_module_hierarchy(desc):\n if d.has_port_spec(port_name, port_type):\n return True\n return False", "metadata": "root.ModuleRegistry.has_port_spec_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1514 }, { "content": " def has_port_spec(self, package, module_name, namespace,\n port_name, port_type):\n desc = self.get_descriptor_by_name(package, module_name, namespace)\n return self.has_port_spec_from_descriptor(desc, port_name,\n port_type)", "metadata": "root.ModuleRegistry.has_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1520 }, { "content": " def add_port(self, descriptor, port_name, port_type, port_sig=None,\n port_sigstring=None, optional=False, sort_key=-1,\n labels=None, defaults=None, values=None, entry_types=None,\n docstring=None, shape=None, min_conns=0, max_conns=-1,\n depth=0):\n spec = self.create_port_spec(port_name, port_type, port_sig,\n port_sigstring, optional, sort_key,\n labels, defaults, values, entry_types,\n docstring, shape,\n min_conns, max_conns, depth)\n\n self.add_port_spec(descriptor, spec)", "metadata": "root.ModuleRegistry.add_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1526 }, { "content": " def add_input_port(self, module, portName, portSignature, optional=False,\n sort_key=-1, labels=None, defaults=None,\n values=None, entry_types=None, docstring=None,\n shape=None, min_conns=0, max_conns=-1, depth=0):\n \"\"\"Registers a module's input port.\n\n :type module: class\n :type portName: str\n :type portSignature: str\n :type optional: bool\n :type sort_key: int\n :type labels: list[str]\n :type defaults: list[str]\n :type values: list[list[str]]\n :type entry_types: list[str]\n :type docstring: str\n :type shape: list\n :type min_conns: int\n :type max_conns: int\n :type depth: int\n \"\"\"\n descriptor = self.get_descriptor(module)\n if isinstance(portSignature, basestring):\n self.add_port(descriptor, portName, 'input', None, portSignature,\n optional, sort_key, labels, defaults, values,\n entry_types, docstring, shape, min_conns, max_conns,\n depth)\n else:\n self.add_port(descriptor, portName, 'input', portSignature, None,\n optional, sort_key, labels, defaults, values,\n entry_types, docstring, shape, min_conns, max_conns,\n depth)", "metadata": "root.ModuleRegistry.add_input_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1539 }, { "content": " def add_output_port(self, module, portName, portSignature, optional=False,\n sort_key=-1, docstring=None, shape=None,\n min_conns=0, max_conns=-1, depth=0):\n \"\"\"Registers a module's output port.\n\n :type module: class\n :type portName: str\n :type portSignature: str\n :type optional: bool\n :type sort_key: int\n :type docstring: str\n :type shape: list\n :type min_conns: int\n :type max_conns: int\n :type depth: int\n \"\"\"\n descriptor = self.get_descriptor(module)\n if isinstance(portSignature, basestring):\n self.add_port(descriptor, portName, 'output', None, portSignature,\n optional, sort_key, None, None, None, None,\n docstring, shape, min_conns, max_conns, depth)\n else:\n self.add_port(descriptor, portName, 'output', portSignature, None,\n optional, sort_key, None, None, None, None,\n docstring, shape, min_conns, max_conns, depth)", "metadata": "root.ModuleRegistry.add_output_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1573 }, { "content": " def create_package(self, codepath, load_configuration=True, prefix=None):\n package_id = self.idScope.getNewId(Package.vtType)\n package = Package(id=package_id,\n codepath=codepath,\n load_configuration=load_configuration)\n if prefix is not None:\n package.prefix = prefix\n return package", "metadata": "root.ModuleRegistry.create_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1599 }, { "content": " def initialize_package(self, package):\n if package.initialized():\n return\n debug.splashMessage(\"Initializing \" + package.codepath + \"...\")\n debug.log(\"Initializing \" + package.codepath)\n if (package.identifier, package.version) not in self.package_versions:\n self.add_package(package)\n self.set_current_package(package)\n try:\n package.initialize()\n # Perform auto-initialization\n if hasattr(package.module, '_modules'):\n modules = package.module._modules\n if isinstance(modules, dict):\n module_list = []\n for namespace, m_list in modules.iteritems():\n for module in m_list:\n m_dict = {'namespace': namespace}\n if isinstance(module, tuple):\n m_dict.update(module[1])\n module_list.append((module[0], m_dict))\n elif '_settings' in module.__dict__:\n kwargs = module._settings._asdict()\n kwargs.update(m_dict)\n module._settings = ModuleSettings(**kwargs)\n module_list.append(module)\n else:\n module_list.append((module, m_dict))\n else:\n module_list = modules\n modules = _toposort_modules(module_list)\n # We add all modules before adding ports because\n # modules inside package might use each other as ports\n for module in modules:\n self.auto_add_module(module)\n\n # allow all modules to auto_add_ports!\n added_descriptors = set()\n for descriptor in package.descriptor_list:\n if hasattr(descriptor, 'module'):\n self.auto_add_ports(descriptor.module)\n added_descriptors.add(descriptor)\n # Perform auto-initialization of abstractions\n if hasattr(package.module, '_subworkflows'):\n subworkflows = \\\n _toposort_abstractions(package,\n package.module._subworkflows)\n for subworkflow in subworkflows:\n self.auto_add_subworkflow(subworkflow)\n for descriptor in package.descriptor_list:\n if descriptor not in added_descriptors:\n if hasattr(descriptor, 'module'):\n self.auto_add_ports(descriptor.module)\n added_descriptors.add(descriptor)\n except MissingRequirement:\n raise\n except Exception, e:\n raise package.InitializationFailed(package,\n [traceback.format_exc()])\n finally:\n self.set_current_package(None)\n\n # The package might have decided to rename itself, let's store that\n debug.splashMessage(\"Initializing \" + package.codepath + '... done.')\n package._initialized = True", "metadata": "root.ModuleRegistry.initialize_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1608 }, { "content": " def delete_module(self, identifier, module_name, namespace=None):\n \"\"\"Removes a module from the registry.\n \"\"\"\n descriptor = self.get_descriptor_by_name(identifier, module_name,\n namespace)\n assert len(descriptor.children) == 0\n\n # invalidate the map of converters\n converter_desc = self.get_descriptor(\n vistrails.core.modules.vistrails_module.Converter)\n if self.is_descriptor_subclass(descriptor, converter_desc):\n self._conversions = dict()\n self._converters.remove(descriptor)\n\n self.signals.emit_deleted_module(descriptor)\n if self.is_abstraction(descriptor):\n self.signals.emit_deleted_abstraction(descriptor)\n package = self.packages[descriptor.identifier]\n self.delete_descriptor(descriptor, package)\n if descriptor.module is not None:\n del self._module_key_map[descriptor.module]", "metadata": "root.ModuleRegistry.delete_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1674 }, { "content": " def remove_package(self, package):\n \"\"\"Removes an entire package from the registry.\n \"\"\"\n # graph is the class hierarchy graph for this subset\n graph = Graph()\n if package.identifier not in self.packages:\n raise MissingPackage(package.identifier)\n package = self.packages[package.identifier]\n for descriptor in package.descriptor_list:\n graph.add_vertex(descriptor.sigstring)\n for descriptor in package.descriptor_list:\n base_id = descriptor.base_descriptor_id\n if base_id in package.descriptors_by_id:\n base_descriptor = \\\n package.descriptors_by_id[descriptor.base_descriptor_id]\n graph.add_edge(descriptor.sigstring, base_descriptor.sigstring)\n\n top_sort = graph.vertices_topological_sort()\n # set up fast removal of model\n for sigstring in top_sort:\n self.delete_module(\n *vistrails.core.modules.utils.parse_descriptor_string(sigstring))\n\n # Remove upgraded package subworkflows from registry\n for key, version_dict in package._abs_pkg_upgrades.iteritems():\n for version, descriptor in version_dict.iteritems():\n self.delete_module(descriptor.identifier, descriptor.name,\n descriptor.namespace)\n package._abs_pkg_upgrades.clear()\n\n package.unload()\n self.delete_package(package)\n self.signals.emit_deleted_package(package)", "metadata": "root.ModuleRegistry.remove_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1696 }, { "content": " def delete_input_port(self, descriptor, port_name):\n \"\"\"Remove an input port by name.\n \"\"\"\n descriptor.delete_input_port(port_name)", "metadata": "root.ModuleRegistry.delete_input_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1730 }, { "content": " def delete_output_port(self, descriptor, port_name):\n \"\"\"Removes an output port by name.\n \"\"\"\n descriptor.delete_output_port(port_name)", "metadata": "root.ModuleRegistry.delete_output_port", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1735 }, { "content": " def source_ports_from_descriptor(self, descriptor, sorted=True):\n ports = [p[1] for p in self.module_ports('output', descriptor)]\n if sorted:\n ports.sort(key=lambda x: x.name)\n return ports", "metadata": "root.ModuleRegistry.source_ports_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1740 }, { "content": " def destination_ports_from_descriptor(self, descriptor, sorted=True):\n ports = [p[1] for p in self.module_ports('input', descriptor)]\n if sorted:\n ports.sort(key=lambda x: x.name)\n return ports", "metadata": "root.ModuleRegistry.destination_ports_from_descriptor", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1746 }, { "content": " def all_destination_ports(self, descriptor, sorted=True):\n \"\"\"Returns input ports, including inherited, for the given module\"\"\"\n getter = self.destination_ports_from_descriptor\n return [(desc.name, getter(desc, sorted))\n for desc in self.get_module_hierarchy(descriptor)]", "metadata": "root.ModuleRegistry.all_destination_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1752 }, { "content": " def all_source_ports(self, descriptor, sorted=True):\n \"\"\"Returns output ports, including inherited, for the given module.\n \"\"\"\n getter = self.source_ports_from_descriptor\n return [(desc.name, getter(desc, sorted))\n for desc in self.get_module_hierarchy(descriptor)]", "metadata": "root.ModuleRegistry.all_source_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1758 }, { "content": " def get_port_from_all_destinations(self, descriptor, name):\n \"\"\"Gets an input port, possibly inherited, on the given module.\n \"\"\"\n all_ports = self.all_destination_ports(descriptor)\n for (klass, port_list) in all_ports:\n for port in port_list:\n if port.name == name:\n return port\n else:\n return None", "metadata": "root.ModuleRegistry.get_port_from_all_destinations", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1765 }, { "content": " def is_method(self, port_spec):\n basic_pkg = get_vistrails_basic_pkg_id()\n constant_desc = \\\n self.get_descriptor_by_name(basic_pkg, 'Constant')\n return port_spec.type == 'input' and \\\n all(self.is_descriptor_subclass(d, constant_desc)\n for d in port_spec.descriptors())", "metadata": "root.ModuleRegistry.is_method", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1776 }, { "content": " def is_constant_module(self, module):\n basic_pkg = get_vistrails_basic_pkg_id()\n constant_cls = \\\n self.get_descriptor_by_name(basic_pkg, 'Constant').module\n return issubclass(module, constant_cls)", "metadata": "root.ModuleRegistry.is_constant_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1785 }, { "content": " def method_ports(self, module_descriptor):\n \"\"\"Returns port specs that only contain subclasses of Constant.\n\n :rtype: list[PortSpec]\n \"\"\"\n getter = self.module_destination_ports_from_descriptor\n return [spec for spec in sorted(getter(False, module_descriptor),\n key=lambda x: x.name)\n if self.is_method(spec)]", "metadata": "root.ModuleRegistry.method_ports", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1791 }, { "content": " def port_and_port_spec_match(self, port, port_spec):\n \"\"\"Checks whether the ports match, i.e. have the same signature.\n\n They must also have the same type (both input or both output) and name.\n\n :type port: Port | PortSpec\n :type port_spec: PortSpec\n :rtype: bool\n \"\"\"\n if port.type in PortSpec.port_type_map:\n port_type = port.type\n elif port.type in PortSpec.port_type_map.inverse:\n port_type = PortSpec.port_type_map.inverse[port.type]\n else:\n raise TypeError('Port type \"%s\" invalid' % str(port.type))\n if port_type != port_spec.type:\n return False\n if port.name != port_spec.name:\n return False\n if port.sigstring == port_spec.sigstring:\n return True\n return self.are_specs_matched(port, port_spec)", "metadata": "root.ModuleRegistry.port_and_port_spec_match", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1801 }, { "content": " def ports_can_connect(self, sourceModulePort, destinationModulePort,\n allow_conversion=False, out_converters=None):\n \"\"\"Checks whether the given ports can be connected.\n \"\"\"\n if sourceModulePort.type == destinationModulePort.type:\n return False\n return self.are_specs_matched(sourceModulePort, destinationModulePort,\n allow_conversion=allow_conversion,\n out_converters=out_converters)", "metadata": "root.ModuleRegistry.ports_can_connect", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1824 }, { "content": " def is_port_sub_type(self, sub, super):\n \"\"\"Checks whether `sub` is a subclass of `super`.\n\n They must also have the same type (both input or both output) and name.\n \"\"\"\n if sub.type != super.type:\n return False\n if sub.name != super.name:\n return False\n return self.are_specs_matched(sub, super)", "metadata": "root.ModuleRegistry.is_port_sub_type", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1834 }, { "content": " def get_converters(self, sub_descs, super_descs):\n key = (tuple(sub_descs), tuple(super_descs))\n\n # Get the result from the cache\n try:\n return self._conversions[key]\n except KeyError:\n pass\n\n converters = []\n\n # Compute the result\n for converter in self._converters:\n if converter.module is (\n vistrails.core.modules.vistrails_module.Converter):\n continue\n\n if converter.module.can_convert(sub_descs, super_descs):\n converters.append(converter)\n\n # Store in the cache that there was no result\n self._conversions[key] = converters\n return converters", "metadata": "root.ModuleRegistry.get_converters", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1845 }, { "content": " def is_descriptor_list_subclass(self, sub_descs, super_descs):\n basic_pkg = get_vistrails_basic_pkg_id()\n variant_desc = self.get_descriptor_by_name(basic_pkg, 'Variant')\n module_desc = self.get_descriptor_by_name(basic_pkg, 'Module')\n\n for (sub_desc, super_desc) in izip(sub_descs, super_descs):\n if sub_desc == variant_desc or super_desc == variant_desc:\n continue\n if super_desc == module_desc and sub_desc != module_desc:\n warnings.warn(\n \"Connecting any type on a Module input port is \"\n \"deprecated\\nPlease make the output port a Variant to \"\n \"get this behavior.\",\n category=VistrailsDeprecation)\n #return False\n if not self.is_descriptor_subclass(sub_desc, super_desc):\n return False\n return True", "metadata": "root.ModuleRegistry.is_descriptor_list_subclass", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1869 }, { "content": " def are_specs_matched(self, sub, super, allow_conversion=False,\n out_converters=None):\n \"\"\"Checks if specs of `sub` subclass `super`.\n \"\"\"\n # For a connection, this gets called for sub -> super\n basic_pkg = get_vistrails_basic_pkg_id()\n variant_desc = self.get_descriptor_by_name(basic_pkg, 'Variant')\n list_desc = self.get_descriptor_by_name(basic_pkg, 'List')\n # sometimes sub is coming None\n # I don't know if this is expected, so I will put a test here\n sub_descs = []\n if sub:\n sub_descs = sub.descriptors()\n if sub_descs is None:\n return False\n elif sub_descs == [variant_desc]:\n return True\n super_descs = []\n if super:\n super_descs = super.descriptors()\n if super_descs is None:\n return False\n elif super_descs == [variant_desc]:\n return True\n elif [list_desc] in [super_descs, sub_descs]:\n # Allow Lists to connect to anything\n return True\n #elif super_descs == [list_desc] and sub_descs != [list_desc] \\\n # and sub.depth > 0:\n # # List is handled as Variant with depth 1\n # return True\n #elif sub_descs == [list_desc] and super_descs != [list_desc] \\\n # and super.depth > 0:\n # # List is handled as Variant with depth 1\n # return True\n\n if (len(sub_descs) == len(super_descs) and\n self.is_descriptor_list_subclass(sub_descs, super_descs)):\n return True\n\n if allow_conversion:\n converters = self.get_converters(sub_descs, super_descs)\n if converters:\n if out_converters is not None:\n out_converters.extend(converters)\n return True\n\n return False", "metadata": "root.ModuleRegistry.are_specs_matched", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1888 }, { "content": " def get_module_hierarchy(self, descriptor):\n \"\"\"Returns the module and all its parents, in order.\n\n This will return all the modules descriptor from the given one to the\n one for the root Module. It will thus not return mixins (which\n themselves don't subclass Module).\n \"\"\"\n if descriptor.module is None:\n descriptors = [descriptor]\n base_id = descriptor.base_descriptor_id\n while base_id >= 0:\n descriptor = self.descriptors_by_id[base_id]\n descriptors.append(descriptor)\n base_id = descriptor.base_descriptor_id\n return descriptors\n return [self.get_descriptor(klass)\n for klass in descriptor.module.mro()\n if issubclass(klass, vistrails.core.modules.vistrails_module.Module)]", "metadata": "root.ModuleRegistry.get_module_hierarchy", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1937 }, { "content": " def get_descriptor_subclasses(self, descriptor):\n \"\"\"Finds descriptors that subclass the given descriptor.\n \"\"\"\n sub_list = []\n for pkg in self.package_versions.itervalues():\n for d in pkg.descriptor_list:\n if self.is_descriptor_subclass(d, descriptor):\n sub_list.append(d)\n return sub_list", "metadata": "root.ModuleRegistry.get_descriptor_subclasses", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1956 }, { "content": " def get_input_port_spec(self, module, portName):\n \"\"\"Gets a PortSpec from a pipeline module and an input port name.\n\n :type module: vistrails.core.vistrail.module.Module\n :rtype: ModuleDescriptor | None\n \"\"\"\n if module.has_port_spec(portName, 'input'):\n return module.get_port_spec(portName, 'input')\n return None", "metadata": "root.ModuleRegistry.get_input_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1966 }, { "content": " def get_output_port_spec(self, module, portName):\n \"\"\"Gets a PortSpec from a pipeline module and an output port name.\n\n :type module: vistrails.core.vistrail.module.Module\n :rtype: ModuleDescriptor | None\n \"\"\"\n if module.has_port_spec(portName, 'output'):\n return module.get_port_spec(portName, 'output')\n return None", "metadata": "root.ModuleRegistry.get_output_port_spec", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1976 }, { "content": " @staticmethod\n def get_subclass_candidates(module):\n \"\"\"Returns all Module superclasses of the given Module class.\n\n Returns the superclasses of the given Module subclass, but only those\n that are subclasses of Module themselves. This means that mixins won't\n be returned, since they don't subclass Module directly.\n\n :rtype: list[class]\n \"\"\"\n return [klass\n for klass in module.__bases__\n if issubclass(klass, vistrails.core.modules.vistrails_module.Module)]", "metadata": "root.ModuleRegistry.get_subclass_candidates", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 1986 }, { "content": " def set_current_package(self, package):\n \"\"\"Set the current package for all add_module() operations.\n\n This means that all modules added after this call will be assigned to\n the specified package. Set package to None to indicate that VisTrails\n default package should be used instead.\n\n Do not call this directly. The package manager will call this\n with the correct value prior to calling 'initialize' on the\n package.\n \"\"\"\n if package is None:\n package = self._default_package\n self._current_package = package", "metadata": "root.ModuleRegistry.set_current_package", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2000 }, { "content": " def get_configuration_widget(self, identifier, name, namespace):\n descriptor = self.get_descriptor_by_name(identifier, name, namespace)\n package = self.get_package_by_name(identifier)\n prefix = None\n if package.prefix is not None and package.codepath is not None:\n prefix = package.prefix + package.codepath\n cls = descriptor.configuration_widget()\n return vistrails.core.modules.utils.load_cls(cls, prefix)", "metadata": "root.ModuleRegistry.get_configuration_widget", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2015 }, { "content": " def get_constant_config_params(self, widget_type=None, widget_use=None):\n if widget_type is None:\n widget_type = 'default'\n if widget_use is None:\n widget_use = 'default'\n return (widget_type, widget_use)", "metadata": "root.ModuleRegistry.get_constant_config_params", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2024 }, { "content": " def get_constant_config_widget(self, descriptor, widget_type=None,\n widget_use=None):\n widget_type, widget_use = self.get_constant_config_params(widget_type,\n widget_use)\n for desc in self.get_module_hierarchy(descriptor):\n if desc.has_constant_config_widget(widget_use, widget_type):\n return desc.get_constant_config_widget(widget_use, widget_type)\n return None", "metadata": "root.ModuleRegistry.get_constant_config_widget", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2031 }, { "content": " def get_all_constant_config_widgets(self, descriptor, widget_use=None):\n widget_use = self.get_constant_config_params(None, widget_use)[1]\n widgets = {}\n for desc in reversed(self.get_module_hierarchy(descriptor)):\n widgets.update(desc.get_all_constant_config_widgets(widget_use))\n return widgets.values()", "metadata": "root.ModuleRegistry.get_all_constant_config_widgets", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2040 }, { "content": " def set_constant_config_widget(self, descriptor, widget_class,\n widget_type=None, widget_use=None):\n widget_type, widget_use = self.get_constant_config_params(widget_type,\n widget_use)\n basic_pkg = get_vistrails_basic_pkg_id()\n constant_desc = self.get_descriptor_by_name(basic_pkg, 'Constant')\n if not self.is_descriptor_subclass(descriptor, constant_desc):\n raise Exception('Descriptor \"%s\" must be a subclass of Constant '\n 'to use a constant configuration widget.' % \\\n descriptor.sigstring)\n descriptor.set_constant_config_widget(widget_class,\n widget_use, widget_type)", "metadata": "root.ModuleRegistry.set_constant_config_widget", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2047 }, { "content": " def is_descriptor_subclass(self, sub, super):\n \"\"\"Checks whether a descriptor subclasses another.\n \"\"\"\n if sub.module is not None and super.module is not None:\n return issubclass(sub.module, super.module)\n\n # otherwise, use descriptors themselves\n if sub == super:\n return True\n while sub != self.root_descriptor:\n sub = sub.base_descriptor\n if sub == super:\n return True\n\n return False", "metadata": "root.ModuleRegistry.is_descriptor_subclass", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2060 }, { "content": " def find_descriptor_subclass(self, d1, d2):\n if self.is_descriptor_subclass(d1, d2):\n return d1\n elif self.is_descriptor_subclass(d2, d1):\n return d2\n return None", "metadata": "root.ModuleRegistry.find_descriptor_subclass", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2076 }, { "content": " def find_descriptor_superclass(self, d1, d2):\n \"\"\"Finds the lowest common superclass descriptor for `d1` and `d2`\n\n :returns: The ModuleDescriptor or None\n \"\"\"\n if self.is_descriptor_subclass(d1, d2):\n return d2\n elif self.is_descriptor_subclass(d2, d1):\n return d1\n\n d1_list = [d1]\n while d1 != self.root_descriptor:\n d1 = d1.base_descriptor\n d1_list.append(d1)\n d1_idx = -1\n while self.is_descriptor_subclass(d2, d1_list[d1_idx]):\n d1_idx -= 1\n if d1_idx == -1:\n return None\n return d1_list[d1_idx+1]", "metadata": "root.ModuleRegistry.find_descriptor_superclass", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2083 }, { "content": " def is_abstraction(self, descriptor):\n basic_pkg = get_vistrails_basic_pkg_id()\n try:\n abstraction_desc = self.get_descriptor_by_name(basic_pkg,\n 'SubWorkflow')\n except MissingModule:\n # No abstractions can be loaded before the basic\n # SubWorkflow descriptor is initialized\n return False\n return abstraction_desc != descriptor and \\\n self.is_descriptor_subclass(descriptor, abstraction_desc)", "metadata": "root.ModuleRegistry.is_abstraction", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2104 }, { "content": " def show_module(self, descriptor):\n self.signals.emit_show_module(descriptor)", "metadata": "root.ModuleRegistry.show_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2116 }, { "content": " def hide_module(self, descriptor):\n self.signals.emit_hide_module(descriptor)", "metadata": "root.ModuleRegistry.hide_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2118 }, { "content": " def update_module(self, old_descriptor, new_descriptor):\n self.signals.emit_module_updated(old_descriptor, new_descriptor)", "metadata": "root.ModuleRegistry.update_module", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2120 }, { "content": " def expand_port_spec_string(self, p_string, cur_package=None,\n old_style=False):\n return vistrails.core.modules.utils.expand_port_spec_string(p_string, cur_package,\n old_style)", "metadata": "root.ModuleRegistry.expand_port_spec_string", "header": "['class', 'ModuleRegistry', '(', 'DBRegistry', ')', ':', '___EOS___']", "index": 2123 }, { "content": "def get_module_registry():\n if not registry:\n raise VistrailsInternalError(\"Registry not constructed yet.\")\n return registry", "metadata": "root.get_module_registry", "header": "['module', '___EOS___']", "index": 2140 }, { "content": "def module_registry_loaded():\n return registry is not None", "metadata": "root.module_registry_loaded", "header": "['module', '___EOS___']", "index": 2145 }, { "content": "class TestModuleRegistry(unittest.TestCase):\n", "metadata": "root.TestModuleRegistry", "header": "['module', '___EOS___']", "index": 2151 }, { "content": " def test_portspec_construction(self):\n from vistrails.core.modules.basic_modules import Float, Integer\n t1 = PortSpec(signature=Float)\n t2 = PortSpec(signature=[Float])\n self.assertEquals(t1, t2)\n\n t1 = PortSpec(signature=[Float, Integer])\n t2 = PortSpec(signature=[Integer, Float])\n self.assertNotEquals(t1, t2)", "metadata": "root.TestModuleRegistry.test_portspec_construction", "header": "['class', 'TestModuleRegistry', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 2153 } ]
[ { "span": "from vistrails.core.utils import VistrailsInternalError, memo_method, \\\n InvalidModuleClass, ModuleAlreadyExists, append_to_dict_of_lists, \\\n all, profile, versions_increasing, InvalidPipeline, VistrailsDeprecation", "start_line": 59, "start_column": 0, "end_line": 61, "end_column": 76 }, { "span": "from vistrails.core.system import vistrails_root_directory, vistrails_version, \\\n get_vistrails_basic_pkg_id", "start_line": 62, "start_column": 0, "end_line": 63, "end_column": 30 } ]
[]
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", "-", "2016", ",", " ", "New", " ", "Yo", "rk", " ", "Univers", "it", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Copy", "right", " ", "(", "C", ")", " ", "2011", "-", "2014", ",", " ", "NY", "U", "-", "Poly", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Copy", "right", " ", "(", "C", ")", " ", "2006", "-", "2011", ",", " ", "Univers", "it", "y", " ", "of", " ", "Ut", "ah", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Conta", "ct", ":", " ", "contact", "@", "vist", "rail", "s", ".", "org_", "\\u\\u\\uNL\\u\\u\\u_", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Thi", "s", " ", "file", " ", "is", " ", "part", " ", "of", " ", "Vis", "Trail", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "\"", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "-", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "-", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", "-", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "New", " ", "Yo", "rk", " ", "Univers", "it", "y", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products", " ", "derive", "d", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", " ", " ", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\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", " ", "HOLD", "ER", " ", "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", " ", "PROF", "IT", "S", ";_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "division_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "itertools_", "import_", "izip_", ",_", "chain_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ast_", "import_", "literal", "\\u", "eval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "import_", "debug_", ",_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "data\\u", "structures_", "._", "graph_", "import_", "Graph_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "config_", "import_", "Const", "ant", "Wid", "get", "Config_", ",_", "Modul", "e", "Settings_", ",_", "Inp", "ut", "Port_", ",_", "Output", "Port_", ",_", "Compo", "und", "Inp", "ut", "Port_", ",_", "Compo", "und", "Output", "Port_", ",_", "Dep", "reca", "ted", "Inp", "ut", "Port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "module", "\\u", "descriptor_", "import_", "Modul", "e", "Descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "package_", "import_", "Package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "requirements_", "import_", "Missing", "Requirement", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "import_", "create", "\\u", "port", "\\u", "spec", "\\u", "item", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "utils_", "import_", "Vis", "trail", "s", "Intern", "al", "Error_", ",_", "memo", "\\u", "method_", ",_", "Inva", "lid", "Modul", "e", "Class_", ",_", "Modul", "e", "Al", "read", "y", "Exists_", ",_", "append", "\\u", "to", "\\u", "dict", "\\u", "of", "\\u", "lists_", ",_", "all_", ",_", "profile_", ",_", "version", "s", "\\u", "incr", "easi", "ng_", ",_", "Inva", "lid", "Pipeline_", ",_", "Vis", "trail", "s", "Dep", "reca", "tion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "system_", "import_", "vist", "rail", "s", "\\u", "root", "\\u", "directory_", ",_", "vist", "rail", "s", "\\u", "version_", ",_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "vist", "rail", "_", "._", "port", "\\u", "spec_", "import_", "Port", "Spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "vist", "rail", "_", "._", "port", "\\u", "spec", "\\u", "item_", "import_", "Port", "Spec", "Item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "vist", "rail", "s_", "._", "core_", "._", "cache_", "._", "hasher_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "db_", "._", "domain_", "import_", "DB", "Registry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "used", " ", "by", " ", "add", "\\u", "module", " ", "to", " ", "make", " ", "sure", " ", "the", " ", "fri", "nge", " ", "specifica", "tions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sense_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Modul", "e", "Regi", "stry", "Signals_", "\\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_", "#", " ", "Modul", "e", "Registry_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "!!!!!!", " ", "DEP", "RECA", "TED", " ", "!!!!!!", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "e", " ", "get", "\\u", "module", "\\u", "registr", "y", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "registry_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "module_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "input", "\\u", "port_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "input", "\\u", "port_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "output", "\\u", "port_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "current", "\\u", "package_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "module", "\\u", "by", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "descriptor_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "registr", "y", " ", " ", " ", " ", " ", "=", " ", "Modul", "e", "Regi", "stry", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", "\\u", "module", " ", " ", " ", "=", " ", "registr", "y", ".", "add", "\\u", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", "\\u", "input", "\\u", "port", " ", " ", " ", "=", " ", "registr", "y", ".", "add", "\\u", "input", "\\u", "port_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", "\\u", "input", "\\u", "port", " ", " ", " ", "=", " ", "registr", "y", ".", "has", "\\u", "input", "\\u", "port_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", "\\u", "output", "\\u", "port", " ", " ", "=", " ", "registr", "y", ".", "add", "\\u", "output", "\\u", "port_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set\\u", "current", "\\u", "package", " ", " ", "=", " ", "registr", "y", ".", "set\\u", "current", "\\u", "package_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name", " ", " ", " ", "=", " ", "registr", "y", ".", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "module", "\\u", "by", "\\u", "name", " ", " ", " ", "=", " ", "registr", "y", ".", "get", "\\u", "module", "\\u", "by", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "descrip", "tor", " ", " ", " ", "=", " ", "registr", "y", ".", "get", "\\u", "descriptor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "check", "\\u", "fri", "nge_", "(_", "fri", "nge_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "isinstance_", "(_", "fri", "nge_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "fri", "nge_", ")_", ">=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "v_", "in_", "fri", "nge_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "isinstance_", "(_", "v_", ",_", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "v_", ")_", "==_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "v_", "[_", "0_", "]_", ",_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "isinstance_", "(_", "v_", "[_", "1_", "]_", ",_", "float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "topo", "sort", "\\u", "modules_", "(_", "module", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Topo", "logical", "ly", " ", "sorts", " ", "Pyth", "on", " ", "classe", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Tak", "es", " ", "a", " ", "list", " ", "of", " ", "Pyth", "on", " ", "classe", "s", " ", "and", " ", "return", "s", " ", "them", " ", "sorte", "d", " ", "topologi", "call", "y", " ", "wrt", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "subclass", " ", "relation", ",", " ", "suc", "h", " ", "tha", "t", " ", "if", " ", "`", "a", "`", " ", "and", " ", "`", "b", "`", " ", "are", " ", "bot", "h", " ", "in", " ", "the", " ", "list", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "``", "issu", "bc", "lass", "(", "a", ",", " ", "b", ")`", "`", ",", " ", "then", " ", "`", "a", "`", " ", "will", " ", "appear", " ", "bef", "ore", " ", "`", "b", "`", " ", "in", " ", "the", " ", "result", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "=_", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "module", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "m_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "add", "\\u", "vertex_", "(_", "m_", "[_", "0_", "]_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "add", "\\u", "vertex_", "(_", "m_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "m_", "in_", "module", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "m_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "m_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "subclass_", "in_", "m_", "._", "mro", "_", "(_", ")_", "[_", "1_", ":_", "]_", ":_", "#", " ", "skip", " ", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "subclass_", "in_", "g_", "._", "vertices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "add", "\\u", "edge_", "(_", "subclass_", ",_", "m_", ")_", "\\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_", "[_", "g_", "._", "vertices_", "[_", "v_", "]_", "for_", "v_", "in_", "g_", "._", "vertice", "s", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "parse", "\\u", "abstract", "ion", "\\u", "name_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assume", " ", "only", " ", "1", " ", "possib", "le", " ", "prefix", " ", "or", " ", "suffix_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefixes_", "=_", "[_", "\"", "abstract", "ion", "\\u\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suffixes_", "=_", "[_", "\".", "vt", "\"_", ",_", "\".", "xml", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "prefix_", "in_", "prefixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "startswith_", "(_", "prefix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "name_", "[_", "len_", "(_", "prefix_", ")_", ":_", "]_", "\\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_", "for_", "suffix_", "in_", "suffixes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "._", "lower_", "(_", ")_", "._", "endswith_", "(_", "suffix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "name_", "[_", ":_", "-_", "len_", "(_", "suffix_", ")_", "]_", "\\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_", "return_", "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_", "\\u", "topo", "sort", "\\u", "abstract", "ions_", "(_", "package_", ",_", "abstract", "ion", "\\u", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "sub\\u", "module_", "import_", "find", "\\u", "internal", "\\u", "abstract", "ion", "\\u", "refs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "=_", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "a_", "in_", "abstract", "ion", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "a_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "a_", "[_", "1_", "]_", ",_", "dict_", ")_", "and_", "'", "name", "'_", "in_", "a_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "(_", "a_", "[_", "1_", "]_", "[_", "'", "name", "'_", "]_", ",_", "a_", "[_", "1_", "]_", "._", "get_", "(_", "'", "namespace", "'_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "(_", "\\u", "parse", "\\u", "abstract", "ion", "\\u", "name_", "(_", "a_", "[_", "0_", "]_", ")_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "g_", "._", "add", "\\u", "vertex_", "(_", "name_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "add", "\\u", "vertex_", "(_", "(_", "\\u", "parse", "\\u", "abstract", "ion", "\\u", "name_", "(_", "a_", ")_", ",_", "''_", ")_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "a_", "in_", "abstract", "ion", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "a_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "a_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ref_", "in_", "find", "\\u", "internal", "\\u", "abstract", "ion", "\\u", "refs_", "(_", "package_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ref_", "in_", "g_", "._", "vertices_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "g_", "._", "add", "\\u", "edge_", "(_", "ref_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "g_", "._", "vertices_", "[_", "v_", "]_", "for_", "v_", "in_", "g_", "._", "vertice", "s", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "notifications_", "=_", "[_", "\"", "reg", "\\u", "new", "\\u", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "new", "\\u", "abstract", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "new", "\\u", "package", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "delete", "d\\u", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "delete", "d\\u", "abstract", "ion", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "delete", "d\\u", "package", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "new", "\\u", "input", "\\u", "port", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "new", "\\u", "output", "\\u", "port", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "show", "\\u", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "hide", "\\u", "module", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "reg", "\\u", "module", "\\u", "update", "d", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "notification_", "in_", "notifications_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "._", "create", "\\u", "notification_", "(_", "notification_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit", "\\u", "new", "\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "new", "\\u", "module", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "new", "\\u", "module", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "new", "\\u", "abstract", "ion_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "new", "\\u", "abstract", "ion", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "new", "\\u", "abstract", "ion", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "new", "\\u", "package_", "(_", "self_", ",_", "identifier_", ",_", "prepend", "_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "new", "\\u", "package", "\"_", ",_", "identifier_", ",_", "prepend", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "new", "\\u", "package", "\\u", "signal", ",", " ", "identifi", "er", ",", " ", "prepend", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "delete", "d\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "delete", "d\\u", "module", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "delete", "d\\u", "module", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "delete", "d\\u", "abstract", "ion_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "delete", "d\\u", "abstract", "ion", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "delete", "d\\u", "abstract", "ion", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "delete", "d\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "delete", "d\\u", "package", "\"_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "delete", "d\\u", "package", "\\u", "signal", ",", " ", "package", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "new", "\\u", "input", "\\u", "port_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "port", "\\u", "name_", ",_", "spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "new", "\\u", "input", "\\u", "port", "\"_", ",_", "identifier_", ",_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "name_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "new", "\\u", "input", "\\u", "port", "\\u", "signal", ",", " ", "identifi", "er", ",", " ", "name", ",", " ", "port", "\\u", "name", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "spec", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "new", "\\u", "output", "\\u", "port_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "port", "\\u", "name_", ",_", "spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "new", "\\u", "output", "\\u", "port", "\"_", ",_", "identifier_", ",_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "name_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "new", "\\u", "output", "\\u", "port", "\\u", "signal", ",", " ", "identifi", "er", ",", " ", "name", ",", " ", "port", "\\u", "name", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "spec", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "show", "\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "show", "\\u", "module", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "show", "\\u", "module", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "hide", "\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "hide", "\\u", "module", "\"_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "hide", "\\u", "module", "\\u", "signal", ",", " ", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Signals_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "new", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "of", " ", "new", " ", "package", " ", "(", "only", " ", "for", " ", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "descrip", "tor", " ", "of", " ", "delete", "d", " ", "abstract", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "abstract", "ion", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "abstract", "ion", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "package", " ", "identifier_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "delete", "d\\u", "package", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "delete", "d\\u", "package", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "input", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "input", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "is", " ", "emitte", "d", " ", "with", " ", "identifi", "er", " ", "and", " ", "name", " ", "of", " ", "module", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "new", " ", "port", " ", "and", " ", "spec_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "new", "\\u", "output", "\\u", "port", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "new", "\\u", "output", "\\u", "port", "\\u", "signal", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "show", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "show", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hide", "\\u", "module", "\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "hide", "\\u", "module", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "\\u", "update", "d\\u", "signal", " ", "=", " ", "Qt", "Core", ".", "SIGN", "AL", "(\"", "module", "\\u", "update", "d", "\")", "_", "\\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_", "emit", "\\u", "module", "\\u", "updated_", "(_", "self_", ",_", "old", "\\u", "descriptor_", ",_", "new", "\\u", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "application_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "send", "\\u", "notification_", "(_", "\"", "reg", "\\u", "module", "\\u", "update", "d", "\"_", ",_", "old", "\\u", "descriptor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "emit", "(", "self", ".", "module", "\\u", "update", "d\\u", "signal", ",", " ", "old", "\\u", "descrip", "tor", ",", " ", "new", "\\u", "descrip", "tor", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "module", "\\u", "name_", "=_", "property_", "(_", "\\u", "get", "\\u", "module", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "package", "\\u", "name_", "=_", "property_", "(_", "\\u", "get", "\\u", "package", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", "=_", "None_", ",_", "namespace_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "None_", ",_", "module", "\\u", "version_", "=_", "None_", ",_", "module", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "identifier_", "=_", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "namespace_", "=_", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "package", "\\u", "version_", "=_", "package", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "module", "\\u", "version_", "=_", "module", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "module", "\\u", "id_", "=_", "module", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p", "\\u", "version", "\\u", "str_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m", "\\u", "str_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "package", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p", "\\u", "version", "\\u", "str_", "=_", "\"", " ", "(", "version", " ", "'%", "s", "')\"_", "%_", "self_", "._", "\\u", "package", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "str_", "=_", "\"", " ", ":", " ", "%", "s", "|", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "namespace_", ",_", "self_", "._", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "str_", "=_", "\"", " ", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "module", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m", "\\u", "str_", "+=_", "\"", " ", "(", "version", " ", "'%", "s", "')\"_", "%_", "self_", "._", "\\u", "module", "\\u", "version_", "\\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_", "\"", "Regi", "stry", "Except", "ion", ":", " ", "%", "s", "%", "s", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p", "\\u", "version", "\\u", "str_", ",_", "m", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "eq\\u\\u_", "(_", "self_", ",_", "other_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "type_", "(_", "self_", ")_", "==_", "type_", "(_", "other_", ")_", "and_", "self_", "._", "\\u", "identifier_", "==_", "other_", "._", "\\u", "identifier_", "and_", "self_", "._", "\\u", "name_", "==_", "other_", "._", "\\u", "name_", "and_", "self_", "._", "\\u", "namespace_", "==_", "other_", "._", "\\u", "namespace_", "and_", "self_", "._", "\\u", "package", "\\u", "version_", "==_", "other_", "._", "\\u", "package", "\\u", "version_", "and_", "self_", "._", "\\u", "module", "\\u", "version_", "==_", "other_", "._", "\\u", "module", "\\u", "version_", "and_", "self_", "._", "\\u", "module", "\\u", "id_", "==_", "other_", "._", "\\u", "module", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "hash\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "type_", "(_", "self_", ")_", ",_", "self_", "._", "\\u", "identifier_", ",_", "self_", "._", "\\u", "name_", ",_", "self_", "._", "\\u", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "package", "\\u", "version_", ",_", "self_", "._", "\\u", "module", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "module", "\\u", "id_", ")_", "._", "\\u\\u", "hash\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "module", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "|", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "namespace_", ",_", "self_", "._", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "package", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "package", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", " ", "(", "version", " ", "%", "s", ")\"_", "%_", "(_", "self_", "._", "\\u", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "identifier_", "\\u\\u\\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_", "Missing", "Package_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "module", "\\u", "id_", "=_", "property_", "(_", "\\u", "get", "\\u", "module", "\\u", "id_", ",_", "\\u", "set\\u", "module", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Package_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Package_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Missing", " ", "package", ":", " ", "%", "s", "\"_", "%_", "self_", "._", "\\u", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Package_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "module", "\\u", "id_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Package_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "module", "\\u", "id_", "(_", "self_", ",_", "m", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "do", " ", "not", " ", "set_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Missing", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "package", "\\u", "version_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "None_", ",_", "module", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Missing", " ", "module", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "package", "\\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_", "class_", "Missing", "Packa", "ge", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Packa", "ge", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "None_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Packa", "ge", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Missing", " ", "version", " ", "%", "s", " ", "of", " ", "package", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "package", "\\u", "version_", ",_", "self_", "._", "\\u", "identifier_", ")_", "\\u\\u\\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_", "Missing", "Modul", "e", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Modul", "e", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "module", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "None_", ",_", "module", "\\u", "id_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "module", "\\u", "version_", ",_", "module", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Modul", "e", "Version_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Missing", " ", "version", " ", "%", "s", " ", "of", " ", "module", " ", "%", "s", " ", "from", " ", "package", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "module", "\\u", "version_", ",_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "self_", "._", "\\u", "package", "\\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_", "class_", "Ambi", "guous", "Resolution_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ambi", "guous", "Resolution_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "namespace_", ",_", "matches_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\"<", "unk", "own", " ", "package", ">\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "matches_", "=_", "matches_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ambi", "guous", "Resolution_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\"", "Ambi", "guous", " ", "resolu", "tion", " ", "of", " ", "module", " ", "%", "s", ".", " ", " ", "Cou", "ld", " ", "resolve", " ", "to", ":\\\\", "n", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "',", "\\\\", "n", "'_", "._", "join_", "(_", "str_", "(_", "m_", ")_", "for_", "m_", "in_", "self_", "._", "matches_", ")_", ")_", ")_", "\\u\\u\\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_", "Missing", "Port_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Port_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "descriptor_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "name_", "=_", "port", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "type_", "=_", "port", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Port_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Missing", " ", "%", "s", " ", "port", " ", "%", "s", " ", "from", " ", "module", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "port", "\\u", "type_", ",_", "self_", "._", "\\u", "port", "\\u", "name_", ",_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "package", "\\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_", "class_", "Port", "Mismatch", "_", "(_", "Missing", "Port_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "Mismatch", "_", "(_", "Missing", "Port_", ")_", ":_", "\\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_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ",_", "port", "\\u", "sig", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "name_", "=_", "port", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "type_", "=_", "port", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "sig", "string_", "=_", "port", "\\u", "sig", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "Mismatch", "_", "(_", "Missing", "Port_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "\"%", "s", " ", "port", " ", "'%", "s", "'", " ", "of", " ", "signa", "ture", " ", "'%", "s", "'", " ", "has", " ", "bad", " ", "specifica", "tion", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "in", " ", "module", " ", "%", "s", " ", "of", " ", "package", " ", "%", "s", "\"_", ")_", "%_", "(_", "self_", "._", "\\u", "port", "\\u", "type_", "._", "capitalize_", "(_", ")_", ",_", "self_", "._", "\\u", "port", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "sig", "string_", ",_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "self_", "._", "\\u", "package", "\\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_", "class_", "Port", "s", "Incomp", "atible", "_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "s", "Incomp", "atible", "_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "output", "\\u", "identifier_", ",_", "output", "\\u", "name_", ",_", "output", "\\u", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "port_", ",_", "input", "\\u", "identifier_", ",_", "input", "\\u", "name_", ",_", "input", "\\u", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input", "\\u", "port_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "output", "\\u", "identifier_", ",_", "output", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "output", "\\u", "port_", "=_", "output", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "identifier_", "=_", "input", "\\u", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "name_", "=_", "input", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "namespace_", "=_", "input", "\\u", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "port_", "=_", "input", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Port", "s", "Incomp", "atible", "_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "name_", "=_", "\"%", "s", ":", "%", "s", "|", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "identifier_", ",_", "self_", "._", "\\u", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out", "\\u", "name_", "=_", "\"%", "s", ":", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "identifier_", ",_", "self_", "._", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "input", "\\u", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "in", "\\u", "name_", "=_", "\"%", "s", ":", "%", "s", "|", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "input", "\\u", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "in", "\\u", "name_", "=_", "\"%", "s", ":", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "input", "\\u", "identifier_", ",_", "self_", "._", "\\u", "input", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "'", "Output", " ", "port", " ", "\"%", "s", "\"", " ", "from", " ", "module", " ", "\"%", "s", "\"", " ", "cann", "ot", " ", "connect", " ", "to", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "input", " ", "port", " ", "\"%", "s", "\"", " ", "from", " ", "module", " ", "\"%", "s", "\".'_", "%_", "(_", "self_", "._", "\\u", "output", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "out", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "input", "\\u", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "in", "\\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_", "class_", "Duplicate", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Duplicate", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "old", "\\u", "descriptor_", ",_", "new", "\\u", "identifier_", ",_", "new", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "namespace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "old", "\\u", "descriptor_", "=_", "old", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Duplicate", "Module_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "old", "\\u", "descriptor_", "._", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "name_", "=_", "\"%", "s", "|", "%", "s", "\"_", "%_", "(_", "self_", "._", "old", "\\u", "descriptor_", "._", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "old", "\\u", "descriptor_", "._", "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 ", " _", "old", "\\u", "name_", "=_", "self_", "._", "old", "\\u", "descriptor_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "\"", "Modul", "e", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", " ", "alr", "ead", "y", " ", "exist", "s", " ", "as", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "s", " ", "in", " ", "package", " ", "%", "s", "\"_", ")_", "%_", "(_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "self_", "._", "\\u", "package", "\\u", "name_", ",_", "old", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "old", "\\u", "descriptor_", "._", "identifier_", ")_", "\\u\\u\\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_", "Duplicate", "Identifier_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Duplicate", "Identifier_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "None_", ",_", "module", "\\u", "version_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Duplicate", "Identifier_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "There", " ", "is", " ", "alr", "ead", "y", " ", "a", " ", "module", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "self_", "._", "\\u", "package", "\\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_", "class_", "Inva", "lid", "Port", "Spec_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Inva", "lid", "Port", "Spec_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "descriptor_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ",_", "exc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Regi", "stry", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "name_", "=_", "port", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "port", "\\u", "type_", "=_", "port", "\\u", "type_", "[_", "0_", "]_", "._", "capitalize_", "(_", ")_", "+_", "port", "\\u", "type_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "exc_", "=_", "exc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Inva", "lid", "Port", "Spec_", "(_", "Modul", "e", "Regi", "stry", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "(_", "'%", "s", " ", "port", " ", "\"%", "s", "\"", " ", "from", " ", "module", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "has", " ", "bad", " ", "specifica", "tion", "\\\\", "n", " ", " ", "%", "s", "'_", "%_", "(_", "self_", "._", "\\u", "port", "\\u", "type_", ",_", "self_", "._", "\\u", "port", "\\u", "name_", ",_", "self_", "._", "\\u", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "package", "\\u", "name_", ",_", "str_", "(_", "self_", "._", "\\u", "exc_", ")_", ")_", ")_", "\\u\\u\\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_", "Missing", "Base", "Class_", "(_", "Exception_", ")_", ":_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u", "repr\\u\\u_", "=_", "\\u\\u", "str\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Base", "Class_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "base_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Exception_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "base_", "=_", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Missing", "Base", "Class_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "Base", " ", "class", " ", "has", " ", "not", " ", "bee", "n", " ", "register", "ed", " ", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u", "base_", "._", "\\u\\u", "name\\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_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Global", " ", "registr", "y", " ", "of", " ", "module", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "hold", "s", " ", "all", " ", "the", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "module", "\\u", "descrip", "tor", ".", "Modul", "e", "Descrip", "tor", "`", " ", "object", "s", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "the", " ", "Vis", "Trail", "s", " ", "module", "s", " ", "of", " ", "enable", "d", " ", "package", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Constructor", " ", "and", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Properties_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package", "\\u", "list_", "=_", "DB", "Registry_", "._", "db", "\\u", "packages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "\\u", "descrip", "tor", "\\u", "id_", "=_", "DB", "Registry_", "._", "db", "\\u", "root", "\\u", "descrip", "tor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "\\u", "descriptor_", "=_", "property_", "(_", "\\u", "get", "\\u", "root", "\\u", "descriptor_", ",_", "\\u", "set\\u", "root", "\\u", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", " ", "has", "\\u", "abs", "\\u", "upgrade", "(", "self", ",", " ", "descrip", "tor", "\\u", "info", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "descrip", "tor", "\\u", "info", " ", "in", " ", "self", ".\\u", "abs", "\\u", "pkg", "\\u", "upgrade", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "def", " ", "get", "\\u", "abs", "\\u", "upgrade", "(", "self", ",", " ", "descrip", "tor", "\\u", "info", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "self", ".", "has", "\\u", "abs", "\\u", "upgrade", "(", "descrip", "tor", "\\u", "info", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "return", " ", "self", ".\\u", "abs", "\\u", "pkg", "\\u", "upgrade", "s", "[", "descrip", "tor", "\\u", "info", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "return", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Per", "-", "module", " ", "registr", "y", " ", "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\\uDEDENT\\u\\u\\u_", "has", "\\u", "module_", "=_", "has", "\\u", "descrip", "tor", "\\u", "with", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "descrip", "tor", "\\u", "from", "\\u", "module", " ", "is", " ", "a", " ", "synonym", " ", "for", " ", "get", "\\u", "descriptor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "get", "\\u", "descrip", "tor", "\\u", "from", "\\u", "module_", "=_", "get", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leg", "ac", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_",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\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "is", "\\u", "constant_", "=_", "is", "\\u", "method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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 ", " _", "if_", "'", "root", "\\u", "descrip", "tor", "\\u", "id", "'_", "not_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "root", "\\u", "descrip", "tor", "\\u", "id", "'_", "]_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "DB", "Registry_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "conversions", "_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "converters_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "set\\u", "defaults_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "copy", "\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Modul", "e", "Registry_", "._", "do", "\\u", "copy_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "defaults_", "(_", "self_", ",_", "other_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "root", "\\u", "descriptor_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "signals_", "=_", "Modul", "e", "Regi", "stry", "Signals_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "setup", "\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "other_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map", " ", "store", "s", " ", "calla", "bles", " ", "for", " ", "custom", " ", "parameter_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "hashe", "rs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "basic", "\\u", "pkg_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "default", "\\u", "package_", "=_", "self_", "._", "packages_", "[_", "basic", "\\u", "pkg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "current", "\\u", "package_", "=_", "self_", "._", "\\u", "default", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "default", "\\u", "package_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "current", "\\u", "package_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map_", "=_", "copy_", "._", "copy_", "(_", "other_", "._", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "current", "\\u", "package_", "=_", "self_", "._", "packages_", "[_", "other_", "._", "\\u", "current", "\\u", "package_", "._", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "default", "\\u", "package_", "=_", "self_", "._", "packages_", "[_", "other_", "._", "\\u", "default", "\\u", "package_", "._", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\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", "indices_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "package", "\\u", "versions_", "=_", "self_", "._", "db", "\\u", "package", "s", "\\u", "identifi", "er", "\\u", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "packages_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pkg_", "in_", "self_", "._", "package", "\\u", "versions_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "chain_", "(_", "pkg_", "._", "old", "\\u", "identifiers_", ",_", "[_", "pkg_", "._", "identifier_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "old", "\\u", "pkg_", "=_", "self_", "._", "packages_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version", "s", "\\u", "incr", "easi", "ng_", "(_", "old", "\\u", "pkg_", "._", "version_", ",_", "pkg_", "._", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "packages_", "[_", "key_", "]_", "=_", "pkg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "packages_", "[_", "key_", "]_", "=_", "pkg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "descriptor_", "in_", "pkg_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "descriptor_", "._", "id_", "]_", "=_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "(_", "descriptor_", "._", "identifier_", ",_", "descriptor_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "namespace_", ",_", "pkg_", "._", "version_", ",_", "descriptor_", "._", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descriptor_", "._", "module_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", "[_", "descriptor_", "._", "module_", "]_", "=_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "descriptor_", "in_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "in_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "descriptor_", "=_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descriptor_", "not_", "in_", "base", "\\u", "descriptor_", "._", "children_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "base", "\\u", "descriptor_", "._", "children_", "._", "append_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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_", "do", "\\u", "copy_", "(_", "self_", ",_", "new", "\\u", "ids_", "=_", "False_", ",_", "id", "\\u", "scope_", "=_", "None_", ",_", "id", "\\u", "remap", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cp_", "=_", "DB", "Registry_", "._", "do", "\\u", "copy_", "(_", "self_", ",_", "new", "\\u", "ids_", ",_", "id", "\\u", "scope_", ",_", "id", "\\u", "remap", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cp_", "._", "\\u\\u", "class\\u\\u_", "=_", "Modul", "e", "Registry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cp_", "._", "set\\u", "defaults_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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_", "convert_", "(_", "\\u", "reg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "\\u", "reg_", "._", "\\u\\u", "class\\u\\u_", "==_", "Modul", "e", "Registry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "reg_", "._", "\\u\\u", "class\\u\\u_", "=_", "Modul", "e", "Registry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "package_", "in_", "\\u", "reg_", "._", "package", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Package_", "._", "convert_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "reg_", "._", "set\\u", "defaults_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "global_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "registry_", ",_", "add", "\\u", "module_", ",_", "add", "\\u", "input", "\\u", "port_", ",_", "has", "\\u", "input", "\\u", "port_", ",_", "add", "\\u", "output", "\\u", "port_", ",_", "set\\u", "current", "\\u", "package_", ",_", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", ",_", "get", "\\u", "module", "\\u", "by", "\\u", "name_", ",_", "get", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "registry_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Vis", "trail", "s", "Intern", "al", "Error_", "(_", "\"", "Global", " ", "registr", "y", " ", "alr", "ead", "y", " ", "set", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "registry_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "module_", "=_", "self_", "._", "add", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "input", "\\u", "port_", "=_", "self_", "._", "add", "\\u", "input", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "input", "\\u", "port_", "=_", "self_", "._", "has", "\\u", "input", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "add", "\\u", "output", "\\u", "port_", "=_", "self_", "._", "add", "\\u", "output", "\\u", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "current", "\\u", "package_", "=_", "self_", "._", "set\\u", "current", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "module", "\\u", "by", "\\u", "name_", "=_", "self_", "._", "get", "\\u", "module", "\\u", "by", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "get", "\\u", "root", "\\u", "descriptor_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "root", "\\u", "descriptor_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "root", "\\u", "descrip", "tor", "\\u", "id_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "root", "\\u", "descriptor_", "=_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "self_", "._", "root", "\\u", "descrip", "tor", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "\\u", "root", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "set\\u", "root", "\\u", "descriptor_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "root", "\\u", "descriptor_", "=_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "root", "\\u", "descrip", "tor", "\\u", "id_", "=_", "descriptor_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "add", "\\u", "descriptor_", "(_", "self_", ",_", "desc_", ",_", "package_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "package_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "\\u", "default", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "self", ".", "descrip", "tors", "[(", "desc", ".", "package", ",", " ", "desc", ".", "name", ",", " ", "desc", ".", "namespace", ")]", " ", "=", " ", "desc_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "desc_", "._", "id_", "]_", "=_", "desc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "._", "add", "\\u", "descriptor_", "(_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "descriptor_", "(_", "self_", ",_", "desc_", ",_", "package_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "package_", "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 ", " _", "package_", "=_", "self_", "._", "packages_", "[_", "desc_", "._", "identifier_", "]_", "\\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 ", " _", "package_", "=_", "self_", "._", "\\u", "default", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "desc_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "!=_", "-_", "1_", "and_", "desc_", "._", "base", "\\u", "descriptor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "._", "base", "\\u", "descriptor_", "._", "children_", "._", "remove_", "(_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "del", " ", "self", ".", "descrip", "tors", "[(", "desc", ".", "package", ",", " ", "desc", ".", "name", ",", " ", "desc", ".", "namespace", ")]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "desc_", "._", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "._", "delete", "\\u", "descriptor_", "(_", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DB", "Registry_", "._", "db", "\\u", "add", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", "in_", "chain_", "(_", "package_", "._", "old", "\\u", "identifiers_", ",_", "[_", "package_", "._", "identifier_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "pkg_", "=_", "self_", "._", "packages_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version", "s", "\\u", "incr", "easi", "ng_", "(_", "old", "\\u", "pkg_", "._", "version_", ",_", "package_", "._", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "packages_", "[_", "key_", "]_", "=_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "packages_", "[_", "key_", "]_", "=_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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_", "delete", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "DB", "Registry_", "._", "db", "\\u", "delete", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", " ", "hard", " ", "to", " ", "incremental", " ", "update", "s", " ", "here", " ", "so", " ", "we", "'", "ll", " ", "just", " ", "recreate", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "can", " ", "be", " ", "slow_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "setup", "\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "abs", "\\u", "upgrade_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "''_", ",_", "module", "\\u", "version_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "this", " ", "fail", "s", ",", " ", "we", " ", "want", " ", "to", " ", "raise", " ", "the", " ", "exception_", "\\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 ", " _", "package_", "=_", "self_", "._", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Missing", "Packa", "ge", "Version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "package_", "._", "has", "\\u", "abs", "\\u", "upgrade_", "(_", "name_", ",_", "namespace_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "abs", "\\u", "upgrade_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "''_", ",_", "module", "\\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 ", " _", "package_", "=_", "self_", "._", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Missing", "Packa", "ge", "Version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "package_", "._", "get", "\\u", "abs", "\\u", "upgrade_", "(_", "name_", ",_", "namespace_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "identifier_", ",_", "package", "\\u", "version_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package", "\\u", "version_", "=_", "package", "\\u", "version_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "version", "\\u", "key_", "=_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "if", " ", "package", "\\u", "version", " ", "is", " ", "not", " ", "Non", "e", " ", "and", " ", "package", "\\u", "version", ".", "strip", "()", " ", "==", " ", "\"\"", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "package", "\\u", "version", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "package", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "packages_", "[_", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "package", "\\u", "versions_", "[_", "package", "\\u", "version", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "identifier_", "not_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Package_", "(_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "package", "\\u", "version_", "and_", "package", "\\u", "version", "\\u", "key_", "not_", "in_", "self_", "._", "package", "\\u", "versions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Packa", "ge", "Version_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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", "module", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "a", " ", "module", " ", "(", "the", " ", "class", ")", " ", "from", " ", "its", " ", "name", " ", "and", " ", "package", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "subclass", " ", "of", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "vist", "rail", "s", "\\u", "module", ".", "Modul", "e", "`", " ", "register", "ed", "\\", "10", ";", " ", " ", " ", " ", "under", " ", "the", " ", "give", "n", " ", "name", " ", "(*", "*", "not", "**", " ", "the", " ", "Modul", "e", "Descrip", "tor", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", "._", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "descrip", "tor", "\\u", "with", "\\u", "name_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "''_", ",_", "module", "\\u", "version_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "namespace_", "=_", "namespace_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "version_", "=_", "package", "\\u", "version_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "version_", "=_", "module", "\\u", "version_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "package", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "packages_", "[_", "identifier_", "]_", "\\u\\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", "\\u", "version", "\\u", "key_", "=_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "self_", "._", "package", "\\u", "versions_", "[_", "package", "\\u", "version", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "module", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "package_", "._", "descriptors_", "[_", "(_", "name_", ",_", "namespace_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descrip", "tor", "\\u", "version", "\\u", "key_", "=_", "(_", "name_", ",_", "namespace_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "package_", "._", "descrip", "tor", "\\u", "versions_", "[_", "descrip", "tor", "\\u", "version", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "''_", ",_", "module", "\\u", "version_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "the", " ", "specified", " ", "descrip", "tor", " ", "from", " ", "the", " ", "registr", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "do", " ", "not", " ", "speci", "fy", " ", "package", "\\u", "version", ",", " ", "you", " ", "will", " ", "get", " ", "the", " ", "currentl", "y", "\\", "10", ";", " ", " ", " ", " ", "load", "ed", " ", "version", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", " ", "do", " ", "not", " ", "speci", "fy", " ", "the", " ", "module", "\\u", "version", ",", " ", "you", " ", "will", " ", "get", " ", "the", " ", "most", " ", "recent", "\\", "10", ";", " ", " ", " ", " ", "version", ".", " ", " ", "Not", "e", " ", "tha", "t", " ", "module", "\\u", "version", " ", "is", " ", "currentl", "y", " ", "only", " ", "used", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "abstract", "ion", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "raise", "s", " ", "Modul", "e", "Regi", "stry", "Except", "ion", ":", " ", "if", " ", "look", "up", " ", "fail", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "namespace_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "version_", "=_", "package", "\\u", "version_", "or_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "version_", "=_", "module", "\\u", "version_", "or_", "''_", "\\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 ", " _", "package_", "=_", "self_", "._", "packages_", "[_", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Package_", "(_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "package", "\\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 ", " _", "package_", "=_", "self_", "._", "package", "\\u", "versions_", "[_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Packa", "ge", "Version_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "\\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 ", " _", "descriptor_", "=_", "package_", "._", "descriptors_", "[_", "(_", "name_", ",_", "namespace_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Module_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descrip", "tor", "\\u", "version", "\\u", "key_", "=_", "(_", "name_", ",_", "namespace_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "package_", "._", "descrip", "tor", "\\u", "versions_", "[_", "descrip", "tor", "\\u", "version", "\\u", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Modul", "e", "Version_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "version_", ",_", "package", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "similar", "\\u", "descriptor_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "None_", ",_", "module", "\\u", "version_", "=_", "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 ", " _", "return_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Missing", "Packa", "ge", "Version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "similar", "\\u", "descriptor_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "None_", ",_", "module", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Missing", "Modul", "e", "Version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "similar", "\\u", "descriptor_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\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", "descriptor_", "(_", "self_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "a", " ", "Modul", "e", "Descrip", "tor", " ", "from", " ", "a", " ", "give", "n", " ", "Modul", "e", " ", "subclass", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assert", " ", "isin", "stance", "(", "module", ",", " ", "type", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "issu", "bc", "lass", "(", "module", ",", " ", "core", ".", "module", "s", ".", "vist", "rail", "s", "\\u", "module", ".", "Modul", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "self", ".\\u", "module", "\\u", "key", "\\u", "map", ".", "has", "\\u", "key", "(", "module", ")_", "\\u\\u\\uNL\\u\\u\\u_", "k_", "=_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", "[_", "module_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "*_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "module", "\\u", "ports_", "(_", "self_", ",_", "p", "\\u", "type_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "(_", "p_", "._", "name_", ",_", "p_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "p_", "in_", "descriptor_", "._", "port", "\\u", "spec", "s", "\\u", "list_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "p_", "._", "type_", "==_", "p", "\\u", "type_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "source", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "do", "\\u", "sort_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "desc_", "in_", "reversed_", "(_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "._", "update_", "(_", "self_", "._", "module", "\\u", "ports_", "(_", "'", "output", "'_", ",_", "desc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "ports_", "=_", "ports_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "do", "\\u", "sort_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "ports_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "(_", "x_", "._", "sort", "\\u", "key_", ",_", "x_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "all", "\\u", "ports_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "source", "\\u", "ports_", "(_", "self_", ",_", "do", "\\u", "sort_", ",_", "identifier_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "=_", "None_", ",_", "version_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "module", "\\u", "source", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "do", "\\u", "sort_", ",_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "destinat", "ion", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "do", "\\u", "sort_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "desc_", "in_", "reversed_", "(_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "._", "update_", "(_", "self_", "._", "module", "\\u", "ports_", "(_", "'", "input", "'_", ",_", "desc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "ports_", "=_", "ports_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "do", "\\u", "sort_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "ports_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "(_", "x_", "._", "sort", "\\u", "key_", ",_", "x_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "all", "\\u", "ports_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "destinat", "ion", "\\u", "ports_", "(_", "self_", ",_", "do", "\\u", "sort_", ",_", "identifier_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "=_", "None_", ",_", "version_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "module", "\\u", "destinat", "ion", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "do", "\\u", "sort_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "descrip", "tor", "\\u", "from", "\\u", "name", "\\u", "only_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "a", " ", "Modul", "e", "Descrip", "tor", " ", "from", " ", "a", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "trie", "s", " ", "to", " ", "return", " ", "a", " ", "descrip", "tor", " ", "from", " ", "a", " ", "name", " ", "with", "out", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "package", ".", " ", "The", " ", "call", " ", "shou", "ld", " ", "only", " ", "be", " ", "used", " ", "for", " ", "convert", "ing", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "lega", "cy", " ", "vist", "rail", "s", " ", "to", " ", "new", " ", "ones", ".", " ", "For", " ", "one", ",", " ", "it", " ", "is", " ", "slow", " ", "on", " ", "misses", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "..", " ", " ", "depre", "cated", "::", " ", "1.0", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "very", " ", "unsafe", " ", "and", " ", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name", " ", "shou", "ld", " ", "be", " ", "used", "\\", "10", ";", " ", " ", " ", " ", "inst", "ead", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matches_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pkg_", "in_", "self_", "._", "package", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matches_", "._", "extend_", "(_", "(_", "pkg_", ",_", "key_", ")_", "for_", "key_", "in_", "pkg_", "._", "descriptors_", "._", "iterkeys_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "key_", "[_", "0_", "]_", "==_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "matches_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Module_", "(_", "\"<", "unknown", " ", "package", ">\"_", ",_", "name_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "matches_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "matche", "s", "\\u", "str_", "=_", "[_", "(_", "m_", "[_", "0_", "]_", "._", "identifier_", ",_", "m_", "[_", "1_", "]_", "[_", "0_", "]_", ",_", "m_", "[_", "1_", "]_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "[_", "0_", "]_", "._", "version_", ")_", "for_", "m_", "in_", "matches_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Ambi", "guous", "Resolution_", "(_", "name_", ",_", "None_", ",_", "matche", "s", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "pkg_", ",_", "key_", ")_", "=_", "matches_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc_", "=_", "pkg_", "._", "descriptors_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "pkg_", "._", "identifier_", ",_", "desc_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc_", "._", "namespace_", ",_", "pkg_", "._", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc_", "._", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "signature_", "(_", "self_", ",_", "pipeline_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Compute", "s", " ", "the", " ", "signa", "ture", " ", "of", " ", "a", " ", "Modul", "e", " ", "in", " ", "a", " ", "give", "n", " ", "Pipe", "line", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "mig", "ht", " ", "involv", "e", " ", "a", " ", "user", "-", "defin", "ed", " ", "hashe", "r", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chm", "_", "=_", "self_", "._", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "module_", "._", "package_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module_", "._", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "descriptor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "vist", "rail", "s_", "._", "core_", "._", "cache_", "._", "hasher_", "._", "Hasher", "_", "._", "module", "\\u", "signature_", "(_", "module_", ",_", "chm", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "descriptor_", "._", "hashe", "r", "\\u", "callable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "c_", "(_", "pipeline_", ",_", "module_", ",_", "chm", "_", ")_", "\\u\\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_", "vist", "rail", "s_", "._", "core_", "._", "cache_", "._", "hasher_", "._", "Hasher", "_", "._", "module", "\\u", "signature_", "(_", "module_", ",_", "chm", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\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", "module", "\\u", "color_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", "._", "module", "\\u", "color_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "module", "\\u", "fri", "nge_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", "._", "module", "\\u", "fri", "nge_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "registry_", "(_", "self_", ",_", "base", "\\u", "descriptor_", ",_", "module_", ",_", "identifier_", ",_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", ",_", "package", "\\u", "version_", "=_", "None_", ",_", "version_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "namespace_", "is_", "not_", "None_", "and_", "not_", "namespace_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "namespace_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "to", " ", "package", " ", "list", ",", " ", "creati", "ng", " ", "new", " ", "package", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "identifier_", "not_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "current", "\\u", "package_", "._", "identifier_", "==_", "identifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "\\u", "current", "\\u", "package_", "\\u\\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", "\\u", "id_", "=_", "self_", "._", "id", "Scope_", "._", "get", "New", "Id_", "(_", "Package_", "._", "vt", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "Package_", "(_", "id_", "=_", "package", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "code", "path_", "=_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "\\u", "configuration_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "identifier_", "=_", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "package", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "add", "\\u", "package_", "(_", "package_", ")_", "\\u\\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_", "=_", "self_", "._", "package", "\\u", "versions_", "[_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "descriptor_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descrip", "tor", "\\u", "id_", "=_", "self_", "._", "id", "Scope_", "._", "get", "New", "Id_", "(_", "Modul", "e", "Descriptor_", "._", "vt", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "Modul", "e", "Descriptor_", "(_", "id_", "=_", "descrip", "tor", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "module_", "=_", "module_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package_", "=_", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "base", "\\u", "descriptor_", "=_", "base", "\\u", "descriptor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", "=_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", "=_", "package", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "version_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "descriptor_", "(_", "descriptor_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "invalidate", " ", "the", " ", "map", " ", "of", " ", "converters_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "issubclass_", "(_", "module_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "._", "Converter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "conversions", "_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "converters_", "._", "add_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", "[_", "module_", "]_", "=_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "convert", "\\u", "port", "\\u", "val_", "(_", "self_", ",_", "val_", ",_", "sig_", "=_", "None_", ",_", "cls_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sig_", "is_", "None_", "and_", "cls_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "One", " ", "of", " ", "sig", " ", "or", " ", "cls", " ", "must", " ", "be", " ", "set", "\"_", ")_", "\\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_", "sig_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "*_", "sig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "._", "unexpected", "\\u", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Vis", "trail", "s", "Intern", "al", "Error_", "(_", "\"", "Cann", "ot", " ", "convert", " ", "value", " ", "%", "r", " ", "due", " ", "to", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "missi", "ng", " ", "descrip", "tor", " ", "for", " ", "port", "\"_", "%_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "constant", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Const", "ant", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "desc_", ",_", "constant", "\\u", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "Cann", "ot", " ", "convert", " ", "value", " ", "for", " ", "non", "-", "constant", " ", "type", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "desc_", "._", "module_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "val_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "desc_", "._", "module_", "._", "translat", "e\\u", "to", "\\u", "string_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "check", "val_", "=_", "desc_", "._", "module_", "._", "translat", "e\\u", "to", "\\u", "python_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retval_", "=_", "desc_", "._", "module_", "._", "translat", "e\\u", "to", "\\u", "string_", "(_", "check", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "check", "val_", ",_", "basestring_", ")_", "and_", "retval_", "!=_", "val_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "have", " ", "a", " ", "string", " ", "->", " ", "string", " ", "conve", "rsi", "on", " ", "tha", "t", " ", "doe", "sn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "match_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retval_", "=_", "desc_", "._", "module_", "._", "translat", "e\\u", "to", "\\u", "string_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "retval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "port_", "(_", "self_", ",_", "port", "\\u", "info_", ",_", "simple", "\\u", "t_", ",_", "compo", "und", "\\u", "t_", ",_", "depre", "cated", "\\u", "t_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "is", "\\u", "input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "isinstance_", "(_", "port", "\\u", "info_", ",_", "simple", "\\u", "t_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "port", "\\u", "info_", ",_", "compo", "und", "\\u", "t_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port", "\\u", "name_", "=_", "port", "\\u", "info_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "\\u", "sig_", "=_", "port", "\\u", "info_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "port", "\\u", "info_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "port", "\\u", "info_", "[_", "2_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "port", "\\u", "info_", "=_", "compo", "und", "\\u", "t_", "(_", "port", "\\u", "info_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "info_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "port", "\\u", "info_", "[_", "2_", "]_", ")_", "\\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 ", " ", "_", "dep", "\\u", "port", "\\u", "info_", "=_", "depre", "cated", "\\u", "t_", "(_", "*_", "port", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "\\u", "info_", "=_", "compo", "und", "\\u", "t_", "(_", "**_", "dep", "\\u", "port", "\\u", "info_", "._", "\\u", "asd", "ict_", "(_", ")_", ")_", "\\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 ", " _", "port", "\\u", "info_", "=_", "compo", "und", "\\u", "t_", "(_", "*_", "port", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "simple", " ", "port", "s", " ", "to", " ", "compo", "und", " ", "ones_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "=_", "port", "\\u", "info_", "._", "\\u", "asd", "ict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "\\u", "name_", "=_", "kwargs_", "._", "pop_", "(_", "'", "name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port", "\\u", "sig_", "=_", "kwargs_", "._", "pop_", "(_", "'", "signa", "ture", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "input_", "and_", "isinstance_", "(_", "port", "\\u", "info_", ",_", "simple", "\\u", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "[_", "'", "labels", "'_", "]_", "=_", "[_", "kwargs_", "._", "pop_", "(_", "'", "label", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "default", "s", "'_", "]_", "=_", "[_", "kwargs_", "._", "pop_", "(_", "'", "default", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "values", "'_", "]_", "=_", "[_", "kwargs_", "._", "pop_", "(_", "'", "values", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "entry", "\\u", "types", "'_", "]_", "=_", "[_", "kwargs_", "._", "pop_", "(_", "'", "entry", "\\u", "type", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "port", "\\u", "info_", ",_", "compo", "und", "\\u", "t_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "have", " ", "compo", "und", " ", "port_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port", "\\u", "items_", "=_", "kwargs_", "._", "pop_", "(_", "'", "items", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "port", "\\u", "items_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sig", "\\u", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry", "\\u", "types_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "port", "\\u", "info_", "._", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "isinstance_", "(_", "item_", "._", "signature_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "d_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "item_", "._", "signature_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sig", "\\u", "items_", "._", "append_", "(_", "create", "\\u", "port", "\\u", "spec", "\\u", "item", "\\u", "string_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "package_", ",_", "d_", "._", "name_", ",_", "d_", "._", "namespace_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "sig", "\\u", "items_", "._", "append_", "(_", "item_", "._", "signature_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "labels_", "._", "append_", "(_", "item_", "._", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "defaults_", "._", "append_", "(_", "item_", "._", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "values_", "._", "append_", "(_", "item_", "._", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entry", "\\u", "types_", "._", "append_", "(_", "item_", "._", "entry", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "'", "signa", "ture", "'_", "]_", "=_", "','_", "._", "join_", "(_", "sig", "\\u", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "input_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kwargs_", "[_", "'", "labels", "'_", "]_", "=_", "labels_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "default", "s", "'_", "]_", "=_", "defaults_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "values", "'_", "]_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "entry", "\\u", "types", "'_", "]_", "=_", "entry", "\\u", "types_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "port", "\\u", "name_", ",_", "port", "\\u", "sig_", ",_", "kwargs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "input", "\\u", "port_", "(_", "self_", ",_", "port", "\\u", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "decode", "\\u", "port_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Inp", "ut", "Port_", ",_", "Compo", "und", "Inp", "ut", "Port_", ",_", "Dep", "reca", "ted", "Inp", "ut", "Port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "decode", "\\u", "output", "\\u", "port_", "(_", "self_", ",_", "port", "\\u", "info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "decode", "\\u", "port_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Output", "Port_", ",_", "Compo", "und", "Output", "Port_", ",_", "Output", "Port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "auto", "\\u", "add", "\\u", "ports_", "(_", "self_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "input", "/", "output", " ", "port", "s", " ", "to", " ", "the", " ", "registr", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "isn", "'", "t", " ", "mean", "t", " ", "to", " ", "be", " ", "call", "ed", " ", "direct", "ly", " ", "--", " ", "it", " ", "is", " ", "used", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "Packa", "ge", "Manager", " ", "to", " ", "register", " ", "module", "s", " ", "automati", "call", "y", " ", "by", " ", "inspect", "ing", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "package", "'", "s", " ", "content", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'\\u", "input", "\\u", "port", "s", "'_", "in_", "module_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "port", "\\u", "info_", "in_", "module_", "._", "\\u", "input", "\\u", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", ",_", "sig_", ",_", "kwargs_", "=_", "self_", "._", "decode", "\\u", "input", "\\u", "port_", "(_", "port", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "input", "\\u", "port_", "(_", "module_", ",_", "name_", ",_", "sig_", ",_", "**_", "kwargs_", ")_", "\\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 ", " ", "_", "debug_", "._", "unexpected", "\\u", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "._", "critical_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fail", "ed", " ", "to", " ", "add", " ", "input", " ", "port", " ", "%", "s", " ", "to", " ", "module", " ", "'%", "s", "'\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "%", "s", "\"'_", "%_", "name_", "if_", "name_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\"(", "unknown", ")\"_", ",_", "module_", "._", "\\u\\u", "name\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'\\u", "output", "\\u", "port", "s", "'_", "in_", "module_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "port", "\\u", "info_", "in_", "module_", "._", "\\u", "output", "\\u", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "name_", ",_", "sig_", ",_", "kwargs_", "=_", "self_", "._", "decode", "\\u", "output", "\\u", "port_", "(_", "port", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "output", "\\u", "port_", "(_", "module_", ",_", "name_", ",_", "sig_", ",_", "**_", "kwargs_", ")_", "\\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 ", " ", "_", "debug_", "._", "unexpected", "\\u", "exception_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "._", "critical_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Fail", "ed", " ", "to", " ", "add", " ", "output", " ", "port", " ", "%", "s", " ", "to", " ", "module", " ", "'%", "s", "'\"_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "%", "s", "\"'_", "%_", "name_", "if_", "name_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "\"(", "unknown", ")\"_", ",_", "module_", "._", "\\u\\u", "name\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\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_", "auto", "\\u", "add", "\\u", "module_", "(_", "self_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "a", " ", "module", " ", "to", " ", "the", " ", "regs", "itr", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Don", "'", "t", " ", "call", " ", "this", " ", "direct", "ly", " ", "-", " ", "it", " ", "is", " ", "mean", "t", " ", "to", " ", "be", " ", "used", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "Packa", "ge", "Manager", ",", " ", "whe", "n", " ", "inspect", "ing", " ", "a", " ", "package", "'", "s", " ", "content", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "module_", ",_", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "add", "\\u", "module_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "isinstance_", "(_", "module_", ",_", "tuple_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "module_", ")_", "==_", "2_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "module_", "[_", "0_", "]_", ",_", "type_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "module_", "[_", "1_", "]_", ",_", "dict_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "add", "\\u", "module_", "(_", "module_", "[_", "0_", "]_", ",_", "**_", "module_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "Expect", "ed", " ", "module", " ", "or", " ", "(", "module", ",", " ", "kwarg", "s", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "module_", "(_", "self_", ",_", "module_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", " ", "a", " ", "module", " ", "to", " ", "the", " ", "registr", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optio", "ns", " ", "are", " ", "take", "n", " ", "from", " ", "the", " ", "`\\u", "settings", "`", " ", "attribute", ",", " ", "a", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "config", ".", "Modul", "e", "Sett", "ings", "`", " ", "instance", ".", " ", "All", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "attribute", "s", " ", "of", " ", "tha", "t", " ", "class", " ", "may", " ", "als", "o", " ", "be", " ", "used", " ", "as", " ", "kwarg", "s", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "`", "add", "\\u", "module", "()`", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "new", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "module", "\\u", "descrip", "tor", ".", "Modul", "e", "Descrip", "tor", "`", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "remap", "\\u", "dict_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "remap", "_", "=_", "{_", "'", "configur", "e", "Wid", "get", "Type", "'_", ":_", "'", "configur", "e\\u", "widget", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "constant", "Wid", "get", "'_", ":_", "'", "constant", "\\u", "widget", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "constant", "Wid", "gets", "'_", ":_", "'", "constant", "\\u", "widget", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "signa", "ture", "Call", "able", "'_", ":_", "'", "signa", "ture", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "constant", "Sign", "ature", "Call", "able", "'_", ":_", "'", "constant", "\\u", "signa", "ture", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "Color", "'_", ":_", "'", "color", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "Fri", "nge", "'_", ":_", "'", "fri", "nge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "Le", "ft", "Fri", "nge", "'_", ":_", "'", "left", "\\u", "fri", "nge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "Rig", "ht", "Fri", "nge", "'_", ":_", "'", "right", "\\u", "fri", "nge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "abstract", "'_", ":_", "'", "abstract", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remap", "ped", "\\u", "d_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "d_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "in_", "remap", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "remap", "ped", "\\u", "d_", "[_", "remap", "_", "[_", "k_", "]_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "remap", "ped", "\\u", "d_", "[_", "k_", "]_", "=_", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "remap", "ped", "\\u", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "module", "\\u", "settings_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'\\u", "settings", "'_", "in_", "module_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "=_", "module_", "._", "\\u\\u", "dict\\u\\u_", "[_", "'\\u", "settings", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "settings_", ",_", "Modul", "e", "Settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "settings_", "=_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "settings_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "settings_", "=_", "Modul", "e", "Settings_", "(_", "**_", "remap", "\\u", "dict_", "(_", "settings_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "Expect", "ed", " ", "module", ".\\u", "settings", " ", "to", " ", "be", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Modul", "e", "Sett", "ings", " ", "or", " ", "dict", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "remap", "ped", "\\u", "kwargs_", "=_", "remap", "\\u", "dict_", "(_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module", "\\u", "settings_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "settings_", "=_", "module", "\\u", "settings_", "._", "\\u", "replace_", "(_", "**_", "remap", "ped", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module", "\\u", "settings_", "=_", "Modul", "e", "Settings_", "(_", "**_", "remap", "ped", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "add", "\\u", "module", "\\u", "from", "\\u", "settings_", "(_", "module_", ",_", "module", "\\u", "settings_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "module", "\\u", "from", "\\u", "settings_", "(_", "self_", ",_", "module_", ",_", "settings_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Add", "s", " ", "a", " ", "module", " ", "to", " ", "the", " ", "registr", "y", ",", " ", "with", " ", "an", " ", "explicit", " ", "`", "Modul", "e", "Sett", "ings", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "See", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "config", ".", "Modul", "e", "Sett", "ings", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "new", "\\", "10", ";", " ", " ", " ", " ", ":", "class", ":`", "~", "vist", "rail", "s", ".", "core", ".", "module", "s", ".", "module", "\\u", "descrip", "tor", ".", "Modul", "e", "Descrip", "tor", "`", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "setting_", "(_", "attr_", ",_", "default", "\\u", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "getattr_", "(_", "settings_", ",_", "attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "default", "\\u", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "val_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "name_", "=_", "get", "\\u", "setting_", "(_", "'", "name", "'_", ",_", "module_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "identifier_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "version_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "current", "\\u", "package_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "default", "\\u", "identifier_", "=_", "self_", "._", "\\u", "current", "\\u", "package_", "._", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "default", "\\u", "version_", "=_", "self_", "._", "\\u", "current", "\\u", "package_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "identifier_", "=_", "get", "\\u", "setting_", "(_", "'", "package", "'_", ",_", "default", "\\u", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package", "\\u", "version_", "=_", "get", "\\u", "setting_", "(_", "'", "package", "\\u", "version", "'_", ",_", "default", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "settings_", "._", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "settings_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "identifier_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Vis", "trail", "s", "Intern", "al", "Error_", "(_", "\"", "No", " ", "package", " ", "is", " ", "currentl", "y", " ", "bei", "ng", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "ed", " ", "and", " ", "argu", "ment", " ", "'", "package", "'", " ", "is", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "not", " ", "specified", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "=_", "self_", "._", "package", "\\u", "versions_", "[_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "desc", "\\u", "key_", "=_", "(_", "name_", ",_", "namespace_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "desc", "\\u", "key_", "in_", "package_", "._", "descrip", "tor", "\\u", "versions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Modul", "e", "Al", "read", "y", "Exists_", "(_", "identifier_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "allow", " ", "multiple", " ", "inherita", "nce", " ", "as", " ", "long", " ", "as", " ", "only", " ", "one", " ", "of", " ", "the", " ", "superclass", "es_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "subclass", " ", "of", " ", "Modul", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "is", "\\u", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "descriptor_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "candidates_", "=_", "self_", "._", "get", "\\u", "subclass", "\\u", "candidates_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "candidates_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Inva", "lid", "Modul", "e", "Class_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "base", "\\u", "class_", "=_", "candidates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "base", "\\u", "class_", "not_", "in_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Base", "Class_", "(_", "base", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "base", "\\u", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "base", "\\u", "class_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "module_", "in_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "reall", "y", " ", "obsolete", " ", "as", " ", "hav", "ing", " ", "two", " ", "descriptors_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pointi", "ng", " ", "to", " ", "the", " ", "same", " ", "module", " ", "isn", "'", "t", " ", "a", " ", "big", " ", "deal", " ", "except", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", "\\u", "descrip", "tor", " ", "whi", "ch", " ", "shou", "ld", "n", "'", "t", " ", "be", " ", "used", " ", "oft", "en_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "identifier_", "!=_", "'", "local", ".", "abstract", "ion", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Duplicate", "Module_", "(_", "self_", "._", "get", "\\u", "descriptor_", "(_", "module_", ")_", ",_", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "has", "\\u", "descrip", "tor", "\\u", "with", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "version_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Duplicate", "Identifier_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descriptor_", "=_", "self_", "._", "update", "\\u", "registry_", "(_", "base", "\\u", "descriptor_", ",_", "module_", ",_", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ",_", "namespace_", ",_", "package", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "._", "is", "\\u", "root_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "root", "\\u", "descriptor_", "=_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descriptor_", "._", "set\\u", "module", "\\u", "abstract_", "(_", "settings_", "._", "abstract_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "set\\u", "configura", "tion", "\\u", "widget_", "(_", "settings_", "._", "configur", "e\\u", "widget_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "descrip", "tor", ".", "set\\u", "configura", "tion", "\\u", "widget", "(", "configur", "e", "Wid", "get", ")_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "is", "\\u", "hidden_", "=_", "settings_", "._", "hide", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "namespace", "\\u", "hidden_", "=_", "settings_", "._", "hide", "\\u", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "settings_", "._", "signature_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "._", "set\\u", "hashe", "r", "\\u", "callable_", "(_", "settings_", "._", "signature_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "constant", "\\u", "signature_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "is", "\\u", "constant", "\\u", "module_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "To", " ", "set", " ", "constant", "\\u", "signa", "ture", ",", " ", "module", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "be", " ", "a", " ", "subclass", " ", "of", " ", "Const", "ant", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ",", " ", "currentl", "y", " ", "only", " ", "allow", " ", "one", " ", "per", " ", "hash", ",", " ", "no", " ", "versioning", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "hash", "\\u", "key_", "=_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "constant", "\\u", "hashe", "r", "\\u", "map_", "[_", "hash", "\\u", "key_", "]_", "=_", "settings_", "._", "constant", "\\u", "signature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "constant", "\\u", "widgets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "._", "constant", "\\u", "widget_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "constant", "\\u", "widgets_", "+=_", "[_", "settings_", "._", "constant", "\\u", "widget_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "constant", "\\u", "widgets_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "constant", "\\u", "widgets_", "+=_", "settings_", "._", "constant", "\\u", "widgets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "constant", "\\u", "widgets_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "is", "\\u", "constant", "\\u", "module_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "To", " ", "set", " ", "constant", " ", "widget", "s", ",", " ", "module", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "must", " ", "be", " ", "a", " ", "subclass", " ", "of", " ", "Const", "ant", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "widget", "\\u", "t_", "in_", "constant", "\\u", "widgets_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "widget", "\\u", "t_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "widget", "\\u", "t_", "=_", "Const", "ant", "Wid", "get", "Config_", "(_", "*_", "widget", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "widget", "\\u", "t_", "=_", "Const", "ant", "Wid", "get", "Config_", "(_", "widget", "\\u", "t_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "widget", "\\u", "t_", "._", "widget_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "set\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "descriptor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "t_", "._", "widget_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "t_", "._", "widget", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "t_", "._", "widget", "\\u", "use_", ")_", "\\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_", "descriptor_", "._", "set\\u", "module", "\\u", "color_", "(_", "settings_", "._", "color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "settings_", "._", "fri", "nge_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "check", "\\u", "fri", "nge_", "(_", "settings_", "._", "fri", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "fri", "nge_", "=_", "list_", "(_", "reversed_", "(_", "[_", "(_", "-_", "x_", ",_", "1.0_", "-_", "y_", ")_", "for_", "(_", "x_", ",_", "y_", ")_", "in_", "settings_", "._", "fri", "nge_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "set\\u", "module", "\\u", "fri", "nge_", "(_", "left", "\\u", "fri", "nge_", ",_", "settings_", "._", "fri", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "settings_", "._", "left", "\\u", "fri", "nge_", "and_", "settings_", "._", "right", "\\u", "fri", "nge_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "check", "\\u", "fri", "nge_", "(_", "settings_", "._", "left", "\\u", "fri", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "check", "\\u", "fri", "nge_", "(_", "settings_", "._", "right", "\\u", "fri", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "set\\u", "module", "\\u", "fri", "nge_", "(_", "settings_", "._", "left", "\\u", "fri", "nge_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "right", "\\u", "fri", "nge_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "ghost", "\\u", "package_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "._", "ghost", "\\u", "identifier_", "=_", "settings_", "._", "ghost", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "ghost", "\\u", "package", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "._", "ghost", "\\u", "package", "\\u", "version_", "=_", "settings_", "._", "ghost", "\\u", "package", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "settings_", "._", "ghost", "\\u", "namespace_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "._", "ghost", "\\u", "namespace_", "=_", "settings_", "._", "ghost", "\\u", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "signals_", "._", "emit", "\\u", "new", "\\u", "module_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "abstract", "ion_", "(_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "new", "\\u", "abstract", "ion_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "auto", "\\u", "add", "\\u", "subw", "ork", "flow_", "(_", "self_", ",_", "subw", "ork", "flow_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "subw", "ork", "flow_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "add", "\\u", "subw", "ork", "flow_", "(_", "subw", "ork", "flow_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "isinstance_", "(_", "subw", "ork", "flow_", ",_", "tuple_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "len_", "(_", "subw", "ork", "flow_", ")_", "==_", "2_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "subw", "ork", "flow_", "[_", "0_", "]_", ",_", "str_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "isinstance_", "(_", "subw", "ork", "flow_", "[_", "1_", "]_", ",_", "dict_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "add", "\\u", "subw", "ork", "flow_", "(_", "subw", "ork", "flow_", "[_", "0_", "]_", ",_", "**_", "subw", "ork", "flow_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "\"", "Expect", "ed", " ", "filename", " ", "or", " ", "(", "filename", ",", " ", "kwarg", "s", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "subw", "ork", "flow_", "(_", "self_", ",_", "vt", "\\u", "fname_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "sub\\u", "module_", "import_", "new", "\\u", "abstract", "ion_", ",_", "read", "\\u", "vist", "rail", "_", ",_", "get", "\\u", "next", "\\u", "abs", "\\u", "annot", "ation", "\\u", "key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vt", "\\u", "fname", " ", "is", " ", "relative", " ", "to", " ", "the", " ", "package", " ", "path_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "package", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "identifier_", "=_", "kwargs_", "[_", "'", "package", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "identifier_", "=_", "self_", "._", "\\u", "current", "\\u", "package_", "._", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "package", "\\u", "version", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package", "\\u", "version_", "=_", "kwargs_", "[_", "'", "package", "\\u", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package", "\\u", "version_", "=_", "self_", "._", "\\u", "current", "\\u", "package_", "._", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "version", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "kwargs_", "[_", "'", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "-_", "1_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "name", "'_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "kwargs_", "[_", "'", "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 ", " _", "name_", "=_", "\\u", "parse", "\\u", "abstract", "ion", "\\u", "name_", "(_", "vt", "\\u", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "name", "'_", "]_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "=_", "self_", "._", "package", "\\u", "versions_", "[_", "(_", "identifier_", ",_", "package", "\\u", "version_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isabs_", "(_", "vt", "\\u", "fname_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vt", "\\u", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "package_", "._", "package", "\\u", "dir_", ",_", "vt", "\\u", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug_", "._", "warning_", "(_", "\"", "Us", "ing", " ", "abs", "olute", " ", "path", " ", "for", " ", "subw", "ork", "flow", ":", " ", "'%", "s", "'\"_", "%_", "vt", "\\u", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "vist", "rail", "_", "=_", "read", "\\u", "vist", "rail", "_", "(_", "vt", "\\u", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "namespace_", "=_", "kwargs_", "._", "get_", "(_", "'", "namespace", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "module", " ", "from", " ", "workflow_", "\\u\\u\\uNL\\u\\u\\u_", "module_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "upgrade", "d\\u", "abstract", "ion_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "module_", "=_", "new", "\\u", "abstract", "ion_", "(_", "name_", ",_", "vist", "rail", "_", ",_", "vt", "\\u", "fname_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Inva", "lid", "Pipeline_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "import", " ", "MUS", "T", " ", "be", " ", "delayed", " ", "unti", "l", " ", "this", " ", "point", " ", "or", " ", "it", " ", "will", " ", "fail_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "vist", "rail", "s_", "._", "core_", "._", "vist", "rail", "_", "._", "controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "db_", "._", "io_", "import_", "save", "\\u", "vist", "rail", "\\u", "to", "\\u", "xml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "abstract", "ion_", "import_", "identifier_", "as_", "abstract", "ion", "\\u", "pkg_", ",_", "version_", "as_", "abstract", "ion", "\\u", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Us", "e", " ", "a", " ", "\"", "dummy", "\"", " ", "controlle", "r", " ", "to", " ", "handle", " ", "the", " ", "upgrade_", "\\u\\u\\uNL\\u\\u\\u_", "controller_", "=_", "vist", "rail", "s_", "._", "core_", "._", "vist", "rail", "_", "._", "controller_", "._", "Vis", "trail", "Controller_", "(_", "vist", "rail", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "version_", "==_", "-_", "1_", "L_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "version_", "=_", "vist", "rail", "_", "._", "get", "\\u", "late", "st", "\\u", "version_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "new", "\\u", "version_", ",_", "new", "\\u", "pipeline_", ")_", "=_", "controller_", "._", "handle", "\\u", "invalid", "\\u", "pipeline_", "(_", "e_", ",_", "long_", "(_", "version_", ")_", ",_", "vist", "rail", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "False_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "controller_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vist", "rail", "_", "._", "set\\u", "annotation_", "(_", "'\\u", "\\u", "abstract", "ion", "\\u", "descrip", "tor", "\\u", "info", "\\u\\u'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "str_", "(_", "version_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vt", "\\u", "save", "\\u", "dir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", "prefix_", "=_", "'", "vt", "\\u", "upgrade", "\\u", "abs", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vt", "\\u", "fname_", "=_", "os_", "._", "path_", "._", "join_", "(_", "vt", "\\u", "save", "\\u", "dir_", ",_", "os_", "._", "path_", "._", "basename_", "(_", "vt", "\\u", "fname_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "create", " ", "new", " ", "namespace", " ", "for", " ", "upgrade", "d", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "namespace_", "=_", "str_", "(_", "uuid_", "._", "uuid1_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "annot", "ation", "\\u", "key_", "=_", "get", "\\u", "next", "\\u", "abs", "\\u", "annot", "ation", "\\u", "key_", "(_", "vist", "rail", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vist", "rail", "_", "._", "set\\u", "annotation_", "(_", "annot", "ation", "\\u", "key_", ",_", "new", "\\u", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "Sho", "ul", "d", " ", "delete", " ", "this", " ", "upgrade", " ", "file", " ", "whe", "n", " ", "vist", "rail", "s", " ", "is", " ", "exit", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "save", "\\u", "vist", "rail", "\\u", "to", "\\u", "xml_", "(_", "vist", "rail", "_", ",_", "vt", "\\u", "fname_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "=_", "new", "\\u", "abstract", "ion_", "(_", "name_", ",_", "vist", "rail", "_", ",_", "vt", "\\u", "fname_", ",_", "new", "\\u", "version_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "pipeline_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "set", " ", "identifi", "er", " ", "to", " ", "local", ".", "abstract", "ion", "s", " ", "and", " ", "its", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "[_", "'", "package", "'_", "]_", "=_", "abstract", "ion", "\\u", "pkg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "package", "\\u", "version", "'_", "]_", "=_", "abstract", "ion", "\\u", "ver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "only", " ", "want", " ", "to", " ", "change", " ", "the", " ", "namespace", " ", "on", " ", "the", " ", "new", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "the", " ", "one", " ", "bei", "ng", " ", "adde", "d", " ", "to", " ", "local", ".", "abstract", "ion", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "[_", "'", "namespace", "'_", "]_", "=_", "new", "\\u", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "ghost", " ", "attribute", "s", " ", "so", " ", "module", " ", "palette", " ", "show", "s", " ", "it", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "package", " ", "inst", "ead", " ", "of", " ", "'", "My", " ", "Sub", "workf", "lows", "'_", "\\u\\u\\uNL\\u\\u\\u_", "kwargs_", "[_", "'", "ghost", "\\u", "package", "'_", "]_", "=_", "identifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "ghost", "\\u", "package", "\\u", "version", "'_", "]_", "=_", "package", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "ghost", "\\u", "namespace", "'_", "]_", "=_", "namespace_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "upgrade", "d\\u", "abstract", "ion_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "module_", "._", "internal", "\\u", "version_", "=_", "str_", "(_", "module_", "._", "internal", "\\u", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "[_", "'", "version", "'_", "]_", "=_", "module_", "._", "internal", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "add", "\\u", "module_", "(_", "module_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "add", "\\u", "module_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "is", "\\u", "upgrade", "d\\u", "abstract", "ion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descrip", "tor", "\\u", "info_", "=_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package", "\\u", "version_", ",_", "str_", "(_", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", "addin", "g", " ", "to", " ", "upgrade", "s", ":'", ",", " ", "descrip", "tor", "\\u", "info_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "'", " ", " ", "',", " ", "descrip", "tor", ".", "package", ",", " ", "descrip", "tor", ".", "name", ",", " ", "descrip", "tor", ".", "namespace", ",", " ", "descrip", "tor", ".", "version", ",", " ", "descrip", "tor", ".", "package", "\\u", "version_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "identifier_", "!=_", "abstract", "ion", "\\u", "pkg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info", "\\u", "exc_", "=_", "Modul", "e", "Regi", "stry", "Exception_", "(_", "*_", "descrip", "tor", "\\u", "info_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "._", "critical_", "(_", "\"", "Modul", "e", " ", "%", "s", " ", "in", " ", "package", " ", "%", "s", " ", "is", " ", "out", "-", "of", "-", "date", ".", " ", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Ple", "ase", " ", "check", " ", "with", " ", "the", " ", "package", " ", "developer", " ", "for", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "a", " ", "new", " ", "version", ".\"_", "%_", "(_", "info", "\\u", "exc_", "._", "\\u", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "info", "\\u", "exc_", "._", "\\u", "package", "\\u", "name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "._", "add", "\\u", "abs", "\\u", "upgrade_", "(_", "descriptor_", ",_", "name_", ",_", "namespace_", ",_", "str_", "(_", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auto", "\\u", "add", "\\u", "ports_", "(_", "descriptor_", "._", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "input", "\\u", "port_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "descrip", "tor", ".", "input", "\\u", "port", "s", ".", "has", "\\u", "key", "(", "port", "Name", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "port", "Name_", ",_", "'", "input", "'_", ")_", "in_", "descriptor_", "._", "port", "\\u", "specs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "output", "\\u", "port_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "return", " ", "descrip", "tor", ".", "output", "\\u", "port", "s", ".", "has", "\\u", "key", "(", "port", "Name", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "(_", "port", "Name_", ",_", "'", "output", "'_", ")_", "in_", "descriptor_", "._", "port", "\\u", "specs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "name_", ",_", "type_", ",_", "signature_", "=_", "None_", ",_", "sig", "string_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", "=_", "False_", ",_", "sort", "\\u", "key_", "=_", "-_", "1_", ",_", "labels_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defaults_", "=_", "None_", ",_", "values_", "=_", "None_", ",_", "entry", "\\u", "types_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", "=_", "None_", ",_", "shape_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "conns_", "=_", "0_", ",_", "max", "\\u", "conns_", "=_", "-_", "1_", ",_", "depth_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "signature_", "is_", "None_", "and_", "sig", "string_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Vis", "trail", "s", "Intern", "al", "Error_", "(_", "\"", "create", "\\u", "port", "\\u", "spec", ":", " ", "one", " ", "of", " ", "signa", "ture", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "and", " ", "sig", "string", " ", "must", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "spec", "\\u", "id_", "=_", "self_", "._", "id", "Scope_", "._", "get", "New", "Id_", "(_", "Port", "Spec_", "._", "vt", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "values", " ", "of", " ", "default", "s", " ", "and", " ", "values", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "defaults_", "is_", "not_", "None_", "or_", "values_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parse", "\\u", "port", "\\u", "spec", "\\u", "string_", "=_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "._", "parse", "\\u", "port", "\\u", "spec", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "parse", " ", "port", " ", "spec", "s", " ", "as", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sig", "string_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sig", "strings_", "=_", "parse", "\\u", "port", "\\u", "spec", "\\u", "string_", "(_", "sig", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sig", "\\u", "cls", "\\u", "list_", "=_", "[_", "None_", ",_", "]_", "*_", "len_", "(_", "sig", "strings_", ")_", "\\u\\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_", "isinstance_", "(_", "signature_", ",_", "collections_", "._", "Sequence_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sig", "\\u", "cls", "\\u", "list_", "=_", "signature_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sig", "strings_", "=_", "[_", "None_", ",_", "]_", "*_", "len_", "(_", "sig", "\\u", "cls", "\\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 ", " ", "_", "sig", "\\u", "cls", "\\u", "list_", "=_", "[_", "signature_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sig", "strings_", "=_", "[_", "None_", ",_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "defaults_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "defaults_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "defaults_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "defaults_", "=_", "literal", "\\u", "eval_", "(_", "defaults_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "defaults_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Value", "Error_", "(_", "'", "Default", "s", " ", "for", " ", "port", " ", "\"%", "s", "\"", " ", "must", " ", "be", " ", "a", " ", "list", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "default", "\\u", "val_", "in_", "enumerate_", "(_", "defaults_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "default", "\\u", "val_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "default", "\\u", "conv_", "=_", "self_", "._", "convert", "\\u", "port", "\\u", "val_", "(_", "default", "\\u", "val_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "strings_", "[_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "\\u", "cls", "\\u", "list_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "default", "\\u", "conv_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "defaults_", "._", "append_", "(_", "default", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "defaults_", "._", "append_", "(_", "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 ", " ", " _", "new", "\\u", "defaults_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "defaults_", "=_", "new", "\\u", "defaults_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "\\u", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "values_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "values_", "=_", "literal", "\\u", "eval_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "values_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Value", "Error_", "(_", "'", "Value", "s", " ", "for", " ", "port", " ", "\"%", "s", "\"", " ", "must", " ", "be", " ", "a", " ", "list", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "of", " ", "lists", "'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "values", "\\u", "list_", "in_", "enumerate_", "(_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "values", "\\u", "list_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "values", "\\u", "list_", "=_", "literal", "\\u", "eval_", "(_", "values", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "values", "\\u", "list_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "isinstance_", "(_", "values", "\\u", "list_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "raise_", "Value", "Error_", "(_", "'", "Value", "s", " ", "for", " ", "port", " ", "\"%", "s", "\"", " ", "must", " ", "be", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", " ", "list", " ", "of", " ", "lists", "'_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "values", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "val_", "in_", "values", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "val_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val", "\\u", "conv_", "=_", "self_", "._", "convert", "\\u", "port", "\\u", "val_", "(_", "val_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "strings_", "[_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "\\u", "cls", "\\u", "list_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "val", "\\u", "conv_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "new", "\\u", "values", "\\u", "list_", "._", "append_", "(_", "val", "\\u", "conv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "values_", "._", "append_", "(_", "new", "\\u", "values", "\\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 ", " ", " _", "new", "\\u", "values_", "._", "append_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "values_", "=_", "new", "\\u", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "spec_", "=_", "Port", "Spec_", "(_", "id_", "=_", "spec", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "type_", "=_", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signature_", "=_", "signature_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sig", "string_", "=_", "sig", "string_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", "=_", "optional_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "key_", "=_", "sort", "\\u", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "labels_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "defaults_", "=_", "defaults_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "=_", "values_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "types_", "=_", "entry", "\\u", "types_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", "=_", "docstring_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape_", "=_", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "conns_", "=_", "min", "\\u", "conns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "conns_", "=_", "max", "\\u", "conns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", "=_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "don", "'", "t", " ", "know", " ", "how", " ", "many", " ", "port", " ", "spec", " ", "items", " ", "are", " ", "created", " ", "unti", "l", " ", "after", "..._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "psi_", "in_", "spec_", "._", "port", "\\u", "spec", "\\u", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "psi_", "._", "id_", "=_", "self_", "._", "id", "Scope_", "._", "get", "New", "Id_", "(_", "Port", "Spec", "Item_", "._", "vt", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "descriptor_", ",_", "spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "the", " ", "spec", " ", "is", " ", "valid_", "\\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 ", " _", "spec_", "._", "descriptors_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Modul", "e", "Regi", "stry", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Inva", "lid", "Port", "Spec_", "(_", "descriptor_", ",_", "spec_", "._", "name_", ",_", "spec_", "._", "type_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descriptor_", "._", "add", "\\u", "port", "\\u", "spec_", "(_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "spec_", "._", "type_", "==_", "'", "input", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "new", "\\u", "input", "\\u", "port_", "(_", "descriptor_", "._", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "name_", ",_", "spec_", "._", "name_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "spec_", "._", "type_", "==_", "'", "output", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "new", "\\u", "output", "\\u", "port_", "(_", "descriptor_", "._", "identifier_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "name_", ",_", "spec_", "._", "name_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\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", "port", "\\u", "spec", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "desc_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "._", "has", "\\u", "port", "\\u", "spec_", "(_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d_", "._", "get", "\\u", "port", "\\u", "spec_", "(_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "don", "'", "t", " ", "find", " ", "it", ",", " ", "raise", " ", "Missing", "Port", " ", "exception_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Missing", "Port_", "(_", "desc_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "package_", ",_", "module", "\\u", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "package_", ",_", "module", "\\u", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "get", "\\u", "port", "\\u", "spec", "\\u", "from", "\\u", "descriptor_", "(_", "desc_", ",_", "port", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "port", "\\u", "spec", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "desc_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "d_", "._", "has", "\\u", "port", "\\u", "spec_", "(_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "has", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "package_", ",_", "module", "\\u", "name_", ",_", "namespace_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "package_", ",_", "module", "\\u", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "has", "\\u", "port", "\\u", "spec", "\\u", "from", "\\u", "descriptor_", "(_", "desc_", ",_", "port", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "port_", "(_", "self_", ",_", "descriptor_", ",_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ",_", "port", "\\u", "sig_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "sig", "string_", "=_", "None_", ",_", "optional_", "=_", "False_", ",_", "sort", "\\u", "key_", "=_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", "=_", "None_", ",_", "defaults_", "=_", "None_", ",_", "values_", "=_", "None_", ",_", "entry", "\\u", "types_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", "=_", "None_", ",_", "shape_", "=_", "None_", ",_", "min", "\\u", "conns_", "=_", "0_", ",_", "max", "\\u", "conns_", "=_", "-_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spec_", "=_", "self_", "._", "create", "\\u", "port", "\\u", "spec_", "(_", "port", "\\u", "name_", ",_", "port", "\\u", "type_", ",_", "port", "\\u", "sig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "port", "\\u", "sig", "string_", ",_", "optional_", ",_", "sort", "\\u", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "labels_", ",_", "defaults_", ",_", "values_", ",_", "entry", "\\u", "types_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", ",_", "shape_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "conns_", ",_", "max", "\\u", "conns_", ",_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add", "\\u", "port", "\\u", "spec_", "(_", "descriptor_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "input", "\\u", "port_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ",_", "port", "Signature_", ",_", "optional_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "key_", "=_", "-_", "1_", ",_", "labels_", "=_", "None_", ",_", "defaults_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "=_", "None_", ",_", "entry", "\\u", "types_", "=_", "None_", ",_", "docstring_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shape_", "=_", "None_", ",_", "min", "\\u", "conns_", "=_", "0_", ",_", "max", "\\u", "conns_", "=_", "-_", "1_", ",_", "depth_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Registers", " ", "a", " ", "module", "'", "s", " ", "input", " ", "port", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "module", ":", " ", "class", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", "Name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", "Sign", "ature", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "option", "al", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "sort", "\\u", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "labels", ":", " ", "list", "[", "str", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "default", "s", ":", " ", "list", "[", "str", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "values", ":", " ", "list", "[", "list", "[", "str", "]]", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "entry", "\\u", "types", ":", " ", "list", "[", "str", "]", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "docstr", "ing", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "shape", ":", " ", "list", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "min", "\\u", "conn", "s", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "max", "\\u", "conn", "s", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "depth", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "port", "Signature_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "port_", "(_", "descriptor_", ",_", "port", "Name_", ",_", "'", "input", "'_", ",_", "None_", ",_", "port", "Signature_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", ",_", "sort", "\\u", "key_", ",_", "labels_", ",_", "defaults_", ",_", "values_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "types_", ",_", "docstring_", ",_", "shape_", ",_", "min", "\\u", "conns_", ",_", "max", "\\u", "conns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", ")_", "\\u\\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_", "._", "add", "\\u", "port_", "(_", "descriptor_", ",_", "port", "Name_", ",_", "'", "input", "'_", ",_", "port", "Signature_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", ",_", "sort", "\\u", "key_", ",_", "labels_", ",_", "defaults_", ",_", "values_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "entry", "\\u", "types_", ",_", "docstring_", ",_", "shape_", ",_", "min", "\\u", "conns_", ",_", "max", "\\u", "conns_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "output", "\\u", "port_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ",_", "port", "Signature_", ",_", "optional_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sort", "\\u", "key_", "=_", "-_", "1_", ",_", "docstring_", "=_", "None_", ",_", "shape_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "conns_", "=_", "0_", ",_", "max", "\\u", "conns_", "=_", "-_", "1_", ",_", "depth_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Registers", " ", "a", " ", "module", "'", "s", " ", "output", " ", "port", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "module", ":", " ", "class", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", "Name", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", "Sign", "ature", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "option", "al", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "sort", "\\u", "key", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "docstr", "ing", ":", " ", "str", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "shape", ":", " ", "list", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "min", "\\u", "conn", "s", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "max", "\\u", "conn", "s", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "depth", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "port", "Signature_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "port_", "(_", "descriptor_", ",_", "port", "Name_", ",_", "'", "output", "'_", ",_", "None_", ",_", "port", "Signature_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", ",_", "sort", "\\u", "key_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", ",_", "shape_", ",_", "min", "\\u", "conns_", ",_", "max", "\\u", "conns_", ",_", "depth_", ")_", "\\u\\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_", "._", "add", "\\u", "port_", "(_", "descriptor_", ",_", "port", "Name_", ",_", "'", "output", "'_", ",_", "port", "Signature_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "optional_", ",_", "sort", "\\u", "key_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", ",_", "shape_", ",_", "min", "\\u", "conns_", ",_", "max", "\\u", "conns_", ",_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\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", "package_", "(_", "self_", ",_", "code", "path_", ",_", "load", "\\u", "configuration_", "=_", "True_", ",_", "prefix_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package", "\\u", "id_", "=_", "self_", "._", "id", "Scope_", "._", "get", "New", "Id_", "(_", "Package_", "._", "vt", "Type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "Package_", "(_", "id_", "=_", "package", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "code", "path_", "=_", "code", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "load", "\\u", "configuration_", "=_", "load", "\\u", "configuration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "prefix_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "._", "prefix_", "=_", "prefix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "initialize", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "package_", "._", "initialized_", "(_", ")_", ":_", "\\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_", "debug_", "._", "splash", "Message_", "(_", "\"", "Initializ", "ing", " ", "\"_", "+_", "package_", "._", "code", "path_", "+_", "\"...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "._", "log_", "(_", "\"", "Initializ", "ing", " ", "\"_", "+_", "package_", "._", "code", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "package_", "._", "identifier_", ",_", "package_", "._", "version_", ")_", "not_", "in_", "self_", "._", "package", "\\u", "versions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "\\u", "package_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "set\\u", "current", "\\u", "package_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perform", " ", "auto", "-", "initialization", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "hasattr_", "(_", "package_", "._", "module_", ",_", "'\\u", "module", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "modules_", "=_", "package_", "._", "module_", "._", "\\u", "modules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "modules_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "module", "\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "namespace_", ",_", "m", "\\u", "list_", "in_", "modules_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "module_", "in_", "m", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m", "\\u", "dict_", "=_", "{_", "'", "namespace", "'_", ":_", "namespace_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "module_", ",_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "m", "\\u", "dict_", "._", "update_", "(_", "module_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "list_", "._", "append_", "(_", "(_", "module_", "[_", "0_", "]_", ",_", "m", "\\u", "dict_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'\\u", "settings", "'_", "in_", "module_", "._", "\\u\\u", "dict\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "kwargs_", "=_", "module_", "._", "\\u", "settings_", "._", "\\u", "asd", "ict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kwargs_", "._", "update_", "(_", "m", "\\u", "dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module_", "._", "\\u", "settings_", "=_", "Modul", "e", "Settings_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "list_", "._", "append_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "module", "\\u", "list_", "._", "append_", "(_", "(_", "module_", ",_", "m", "\\u", "dict_", ")_", ")_", "\\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 ", " ", "_", "module", "\\u", "list_", "=_", "modules_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "modules_", "=_", "\\u", "topo", "sort", "\\u", "modules_", "(_", "module", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "add", " ", "all", " ", "module", "s", " ", "bef", "ore", " ", "addin", "g", " ", "port", "s", " ", "bec", "aus", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "module", "s", " ", "insi", "de", " ", "package", " ", "mig", "ht", " ", "use", " ", "each", " ", "other", " ", "as", " ", "ports_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "module_", "in_", "modules_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "auto", "\\u", "add", "\\u", "module_", "(_", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allow", " ", "all", " ", "module", "s", " ", "to", " ", "auto", "\\u", "add", "\\u", "port", "s", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adde", "d\\u", "descriptors_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "descriptor_", "in_", "package_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "descriptor_", ",_", "'", "module", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "auto", "\\u", "add", "\\u", "ports_", "(_", "descriptor_", "._", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adde", "d\\u", "descriptors_", "._", "add_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Perform", " ", "auto", "-", "initialization", " ", "of", " ", "abstract", "ions_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hasattr_", "(_", "package_", "._", "module_", ",_", "'\\u", "subw", "ork", "flow", "s", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subw", "ork", "flows_", "=_", "\\u", "topo", "sort", "\\u", "abstract", "ions_", "(_", "package_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "package_", "._", "module_", "._", "\\u", "subw", "ork", "flows_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "subw", "ork", "flow_", "in_", "subw", "ork", "flows_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "auto", "\\u", "add", "\\u", "subw", "ork", "flow_", "(_", "subw", "ork", "flow_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "descriptor_", "in_", "package_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "descriptor_", "not_", "in_", "adde", "d\\u", "descriptors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "hasattr_", "(_", "descriptor_", ",_", "'", "module", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "auto", "\\u", "add", "\\u", "ports_", "(_", "descriptor_", "._", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "adde", "d\\u", "descriptors_", "._", "add_", "(_", "descriptor_", ")_", "\\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_", "Missing", "Requirement", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "package_", "._", "Initializ", "ation", "Failed_", "(_", "package_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "]_", ")_", "\\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_", "._", "set\\u", "current", "\\u", "package_", "(_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "package", " ", "mig", "ht", " ", "have", " ", "decide", "d", " ", "to", " ", "rename", " ", "its", "elf", ",", " ", "let", "'", "s", " ", "store", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debug_", "._", "splash", "Message_", "(_", "\"", "Initializ", "ing", " ", "\"_", "+_", "package_", "._", "code", "path_", "+_", "'...", " ", "don", "e", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "._", "\\u", "initialized_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "module_", "(_", "self_", ",_", "identifier_", ",_", "module", "\\u", "name_", ",_", "namespace_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", "s", " ", "a", " ", "module", " ", "from", " ", "the", " ", "registr", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "module", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "descriptor_", "._", "children_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "invalidate", " ", "the", " ", "map", " ", "of", " ", "converters_", "\\u\\u\\uNL\\u\\u\\u_", "converter", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descriptor_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "._", "Converter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "descriptor_", ",_", "converter", "\\u", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "conversions", "_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "converters_", "._", "remove_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "signals_", "._", "emit", "\\u", "delete", "d\\u", "module_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "abstract", "ion_", "(_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "delete", "d\\u", "abstract", "ion_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "=_", "self_", "._", "packages_", "[_", "descriptor_", "._", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "\\u", "descriptor_", "(_", "descriptor_", ",_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descriptor_", "._", "module_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "self_", "._", "\\u", "module", "\\u", "key", "\\u", "map_", "[_", "descriptor_", "._", "module_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "remove", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", "s", " ", "an", " ", "entire", " ", "package", " ", "from", " ", "the", " ", "registr", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "graph", " ", "is", " ", "the", " ", "class", " ", "hier", "arch", "y", " ", "graph", " ", "for", " ", "this", " ", "subset_", "\\u\\u\\uNL\\u\\u\\u_", "graph_", "=_", "Graph_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "package_", "._", "identifier_", "not_", "in_", "self_", "._", "packages_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Missing", "Package_", "(_", "package_", "._", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "=_", "self_", "._", "packages_", "[_", "package_", "._", "identifier_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "descriptor_", "in_", "package_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph_", "._", "add", "\\u", "vertex_", "(_", "descriptor_", "._", "sig", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "descriptor_", "in_", "package_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "id_", "=_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "base", "\\u", "id_", "in_", "package_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base", "\\u", "descriptor_", "=_", "package_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph_", "._", "add", "\\u", "edge_", "(_", "descriptor_", "._", "sig", "string_", ",_", "base", "\\u", "descriptor_", "._", "sig", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "top", "\\u", "sort_", "=_", "graph_", "._", "vertice", "s", "\\u", "topologi", "cal", "\\u", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "set", " ", "up", " ", "fast", " ", "removal", " ", "of", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "sig", "string_", "in_", "top", "\\u", "sort_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delete", "\\u", "module_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "._", "parse", "\\u", "descrip", "tor", "\\u", "string_", "(_", "sig", "string_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Remove", " ", "upgrade", "d", " ", "package", " ", "subw", "ork", "flow", "s", " ", "from", " ", "registry_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", ",_", "version", "\\u", "dict_", "in_", "package_", "._", "\\u", "abs", "\\u", "pkg", "\\u", "upgrade", "s_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "version_", ",_", "descriptor_", "in_", "version", "\\u", "dict_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delete", "\\u", "module_", "(_", "descriptor_", "._", "identifier_", ",_", "descriptor_", "._", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descriptor_", "._", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "package_", "._", "\\u", "abs", "\\u", "pkg", "\\u", "upgrade", "s_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "package_", "._", "unload", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "delete", "\\u", "package_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "signals_", "._", "emit", "\\u", "delete", "d\\u", "package_", "(_", "package_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "input", "\\u", "port_", "(_", "self_", ",_", "descriptor_", ",_", "port", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", " ", "an", " ", "input", " ", "port", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "delete", "\\u", "input", "\\u", "port_", "(_", "port", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete", "\\u", "output", "\\u", "port_", "(_", "self_", ",_", "descriptor_", ",_", "port", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Remove", "s", " ", "an", " ", "output", " ", "port", " ", "by", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptor_", "._", "delete", "\\u", "output", "\\u", "port_", "(_", "port", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "source", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "descriptor_", ",_", "sorted_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "=_", "[_", "p_", "[_", "1_", "]_", "for_", "p_", "in_", "self_", "._", "module", "\\u", "ports_", "(_", "'", "output", "'_", ",_", "descriptor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ports_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destinat", "ion", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "(_", "self_", ",_", "descriptor_", ",_", "sorted_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "=_", "[_", "p_", "[_", "1_", "]_", "for_", "p_", "in_", "self_", "._", "module", "\\u", "ports_", "(_", "'", "input", "'_", ",_", "descriptor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sorted_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ports_", "._", "sort_", "(_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ports_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "all", "\\u", "destinat", "ion", "\\u", "ports_", "(_", "self_", ",_", "descriptor_", ",_", "sorted_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "input", " ", "port", "s", ",", " ", "inclu", "ding", " ", "inherited", ",", " ", "for", " ", "the", " ", "give", "n", " ", "module", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getter_", "=_", "self_", "._", "destinat", "ion", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "(_", "desc_", "._", "name_", ",_", "getter_", "(_", "desc_", ",_", "sorted_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "desc_", "in_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "all", "\\u", "source", "\\u", "ports_", "(_", "self_", ",_", "descriptor_", ",_", "sorted_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "output", " ", "port", "s", ",", " ", "inclu", "ding", " ", "inherited", ",", " ", "for", " ", "the", " ", "give", "n", " ", "module", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getter_", "=_", "self_", "._", "source", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "(_", "desc_", "._", "name_", ",_", "getter_", "(_", "desc_", ",_", "sorted_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "desc_", "in_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "port", "\\u", "from", "\\u", "all", "\\u", "destinations_", "(_", "self_", ",_", "descriptor_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "an", " ", "input", " ", "port", ",", " ", "possib", "ly", " ", "inherited", ",", " ", "on", " ", "the", " ", "give", "n", " ", "module", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "ports_", "=_", "self_", "._", "all", "\\u", "destinat", "ion", "\\u", "ports_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "klass_", ",_", "port", "\\u", "list_", ")_", "in_", "all", "\\u", "ports_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "port_", "in_", "port", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "port_", "._", "name_", "==_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "method_", "(_", "self_", ",_", "port", "\\u", "spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "constant", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Const", "ant", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "port", "\\u", "spec_", "._", "type_", "==_", "'", "input", "'_", "and_", "all_", "(_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d_", ",_", "constant", "\\u", "desc_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "d_", "in_", "port", "\\u", "spec_", "._", "descriptors_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "is", "\\u", "constant", "\\u", "module_", "(_", "self_", ",_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "constant", "\\u", "cls_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Const", "ant", "'_", ")_", "._", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "issubclass_", "(_", "module_", ",_", "constant", "\\u", "cls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "method", "\\u", "ports_", "(_", "self_", ",_", "module", "\\u", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "port", " ", "spec", "s", " ", "tha", "t", " ", "only", " ", "contain", " ", "subclasses", " ", "of", " ", "Const", "ant", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "list", "[", "Port", "Spec", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "getter_", "=_", "self_", "._", "module", "\\u", "destinat", "ion", "\\u", "port", "s", "\\u", "from", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "spec_", "for_", "spec_", "in_", "sorted_", "(_", "getter_", "(_", "False_", ",_", "module", "\\u", "descriptor_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "lambda_", "x_", ":_", "x_", "._", "name_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "method_", "(_", "spec_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "port", "\\u", "and", "\\u", "port", "\\u", "spec", "\\u", "match_", "(_", "self_", ",_", "port_", ",_", "port", "\\u", "spec_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "whe", "ther", " ", "the", " ", "port", "s", " ", "match", ",", " ", "i", ".", "e", ".", " ", "have", " ", "the", " ", "same", " ", "signa", "ture", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", "y", " ", "must", " ", "als", "o", " ", "have", " ", "the", " ", "same", " ", "type", " ", "(", "bot", "h", " ", "input", " ", "or", " ", "bot", "h", " ", "output", ")", " ", "and", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", ":", " ", "Port", " ", "|", " ", "Port", "Spec", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "port", "\\u", "spec", ":", " ", "Port", "Spec", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "bool", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "port_", "._", "type_", "in_", "Port", "Spec_", "._", "port", "\\u", "type", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port", "\\u", "type_", "=_", "port_", "._", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "port_", "._", "type_", "in_", "Port", "Spec_", "._", "port", "\\u", "type", "\\u", "map_", "._", "inverse_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "port", "\\u", "type_", "=_", "Port", "Spec_", "._", "port", "\\u", "type", "\\u", "map_", "._", "inverse_", "[_", "port_", "._", "type_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "Port", " ", "type", " ", "\"%", "s", "\"", " ", "invalid", "'_", "%_", "str_", "(_", "port_", "._", "type_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "port", "\\u", "type_", "!=_", "port", "\\u", "spec_", "._", "type_", ":_", "\\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_", "port_", "._", "name_", "!=_", "port", "\\u", "spec_", "._", "name_", ":_", "\\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_", "port_", "._", "sig", "string_", "==_", "port", "\\u", "spec_", "._", "sig", "string_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "are", "\\u", "spec", "s", "\\u", "matched_", "(_", "port_", ",_", "port", "\\u", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "port", "s", "\\u", "can", "\\u", "connect_", "(_", "self_", ",_", "source", "Modul", "e", "Port_", ",_", "destinat", "ion", "Modul", "e", "Port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "conversion_", "=_", "False_", ",_", "out", "\\u", "converters_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "whe", "ther", " ", "the", " ", "give", "n", " ", "port", "s", " ", "can", " ", "be", " ", "connect", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "source", "Modul", "e", "Port_", "._", "type_", "==_", "destinat", "ion", "Modul", "e", "Port_", "._", "type_", ":_", "\\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_", "self_", "._", "are", "\\u", "spec", "s", "\\u", "matched_", "(_", "source", "Modul", "e", "Port_", ",_", "destinat", "ion", "Modul", "e", "Port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "\\u", "conversion_", "=_", "allow", "\\u", "conversion_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "out", "\\u", "converters_", "=_", "out", "\\u", "converters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "port", "\\u", "sub\\u", "type_", "(_", "self_", ",_", "sub_", ",_", "super_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "whe", "ther", " ", "`", "sub", "`", " ", "is", " ", "a", " ", "subclass", " ", "of", " ", "`", "super", "`.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", "y", " ", "must", " ", "als", "o", " ", "have", " ", "the", " ", "same", " ", "type", " ", "(", "bot", "h", " ", "input", " ", "or", " ", "bot", "h", " ", "output", ")", " ", "and", " ", "name", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sub_", "._", "type_", "!=_", "super_", "._", "type_", ":_", "\\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_", "sub_", "._", "name_", "!=_", "super_", "._", "name_", ":_", "\\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_", "self_", "._", "are", "\\u", "spec", "s", "\\u", "matched_", "(_", "sub_", ",_", "super_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "converters_", "(_", "self_", ",_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "key_", "=_", "(_", "tuple_", "(_", "sub\\u", "desc", "s_", ")_", ",_", "tuple_", "(_", "super", "\\u", "desc", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "result", " ", "from", " ", "the", " ", "cache_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u", "conversions", "_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "converters_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Compute", " ", "the", " ", "result_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "converter_", "in_", "self_", "._", "\\u", "converters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "converter_", "._", "module_", "is_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "._", "Converter_", ")_", ":_", "\\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_", "converter_", "._", "module_", "._", "can", "\\u", "convert_", "(_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "converters_", "._", "append_", "(_", "converter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Stor", "e", " ", "in", " ", "the", " ", "cache", " ", "tha", "t", " ", "there", " ", "was", " ", "no", " ", "result_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "conversions", "_", "[_", "key_", "]_", "=_", "converters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "converters_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "descrip", "tor", "\\u", "list", "\\u", "subclass_", "(_", "self_", ",_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variant", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Varia", "nt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Modul", "e", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "sub\\u", "desc_", ",_", "super", "\\u", "desc_", ")_", "in_", "izip_", "(_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sub\\u", "desc_", "==_", "variant", "\\u", "desc_", "or_", "super", "\\u", "desc_", "==_", "variant", "\\u", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "super", "\\u", "desc_", "==_", "module", "\\u", "desc_", "and_", "sub\\u", "desc_", "!=_", "module", "\\u", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Connect", "ing", " ", "any", " ", "type", " ", "on", " ", "a", " ", "Modul", "e", " ", "input", " ", "port", " ", "is", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "depre", "cated", "\\\\", "n", "Ple", "ase", " ", "make", " ", "the", " ", "output", " ", "port", " ", "a", " ", "Varia", "nt", " ", "to", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", " ", "this", " ", "behavior", ".\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "category_", "=_", "Vis", "trail", "s", "Dep", "reca", "tion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "sub\\u", "desc_", ",_", "super", "\\u", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "are", "\\u", "spec", "s", "\\u", "matched_", "(_", "self_", ",_", "sub_", ",_", "super_", ",_", "allow", "\\u", "conversion_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "out", "\\u", "converters_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "if", " ", "spec", "s", " ", "of", " ", "`", "sub", "`", " ", "subclass", " ", "`", "super", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "For", " ", "a", " ", "connecti", "on", ",", " ", "this", " ", "gets", " ", "call", "ed", " ", "for", " ", "sub", " ", "->", " ", "super_", "\\u\\u\\uNL\\u\\u\\u_", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variant", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Varia", "nt", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "List", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "somet", "imes", " ", "sub", " ", "is", " ", "comi", "ng", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "I", " ", "don", "'", "t", " ", "know", " ", "if", " ", "this", " ", "is", " ", "expected", ",", " ", "so", " ", "I", " ", "will", " ", "put", " ", "a", " ", "test", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "sub\\u", "desc", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sub_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub\\u", "desc", "s_", "=_", "sub_", "._", "descriptors_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sub\\u", "desc", "s_", "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_", "elif_", "sub\\u", "desc", "s_", "==_", "[_", "variant", "\\u", "desc_", "]_", ":_", "\\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_", "super", "\\u", "desc", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "super_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super", "\\u", "desc", "s_", "=_", "super_", "._", "descriptors_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "super", "\\u", "desc", "s_", "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_", "elif_", "super", "\\u", "desc", "s_", "==_", "[_", "variant", "\\u", "desc_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "[_", "list", "\\u", "desc_", "]_", "in_", "[_", "super", "\\u", "desc", "s_", ",_", "sub\\u", "desc", "s_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", "ow", " ", "List", "s", " ", "to", " ", "connect", " ", "to", " ", "anyt", "hing_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "eli", "f", " ", "super", "\\u", "desc", "s", " ", "==", " ", "[", "list", "\\u", "desc", "]", " ", "and", " ", "sub\\u", "desc", "s", " ", "!=", " ", "[", "list", "\\u", "desc", "]", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "sub", ".", "depth", " ", ">", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "List", " ", "is", " ", "handle", "d", " ", "as", " ", "Varia", "nt", " ", "with", " ", "depth", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "#", "eli", "f", " ", "sub\\u", "desc", "s", " ", "==", " ", "[", "list", "\\u", "desc", "]", " ", "and", " ", "super", "\\u", "desc", "s", " ", "!=", " ", "[", "list", "\\u", "desc", "]", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "super", ".", "depth", " ", ">", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", " ", "List", " ", "is", " ", "handle", "d", " ", "as", " ", "Varia", "nt", " ", "with", " ", "depth", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "(_", "len_", "(_", "sub\\u", "desc", "s_", ")_", "==_", "len_", "(_", "super", "\\u", "desc", "s_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "list", "\\u", "subclass_", "(_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", ")_", ":_", "\\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_", "if_", "allow", "\\u", "conversion_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "converters_", "=_", "self_", "._", "get", "\\u", "converters_", "(_", "sub\\u", "desc", "s_", ",_", "super", "\\u", "desc", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "converters_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "out", "\\u", "converters_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "out", "\\u", "converters_", "._", "extend_", "(_", "converters_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "the", " ", "module", " ", "and", " ", "all", " ", "its", " ", "parents", ",", " ", "in", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "will", " ", "return", " ", "all", " ", "the", " ", "module", "s", " ", "descrip", "tor", " ", "from", " ", "the", " ", "give", "n", " ", "one", " ", "to", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "one", " ", "for", " ", "the", " ", "root", " ", "Modul", "e", ".", " ", "It", " ", "will", " ", "thu", "s", " ", "not", " ", "return", " ", "mix", "ins", " ", "(", "whi", "ch", "\\", "10", ";", " ", " ", " ", " ", "them", "sel", "ves", " ", "don", "'", "t", " ", "subclass", " ", "Modul", "e", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descriptor_", "._", "module_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptors_", "=_", "[_", "descriptor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base", "\\u", "id_", "=_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "base", "\\u", "id_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "descrip", "tors", "\\u", "by", "\\u", "id_", "[_", "base", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "descriptors_", "._", "append_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base", "\\u", "id_", "=_", "descriptor_", "._", "base", "\\u", "descrip", "tor", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "descriptors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "self_", "._", "get", "\\u", "descriptor_", "(_", "klass_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "klass_", "in_", "descriptor_", "._", "module_", "._", "mro", "_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "issubclass_", "(_", "klass_", ",_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "._", "Module_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "descrip", "tor", "\\u", "subclasses", "_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "ds", " ", "descrip", "tors", " ", "tha", "t", " ", "subclass", " ", "the", " ", "give", "n", " ", "descrip", "tor", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub\\u", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pkg_", "in_", "self_", "._", "package", "\\u", "versions_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "d_", "in_", "pkg_", "._", "descrip", "tor", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sub\\u", "list_", "._", "append_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "sub\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "input", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "a", " ", "Port", "Spec", " ", "from", " ", "a", " ", "pipeline", " ", "module", " ", "and", " ", "an", " ", "input", " ", "port", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "module", ":", " ", "vist", "rail", "s", ".", "core", ".", "vist", "rail", ".", "module", ".", "Modul", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Modul", "e", "Descrip", "tor", " ", "|", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module_", "._", "has", "\\u", "port", "\\u", "spec_", "(_", "port", "Name_", ",_", "'", "input", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "module_", "._", "get", "\\u", "port", "\\u", "spec_", "(_", "port", "Name_", ",_", "'", "input", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "output", "\\u", "port", "\\u", "spec_", "(_", "self_", ",_", "module_", ",_", "port", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "a", " ", "Port", "Spec", " ", "from", " ", "a", " ", "pipeline", " ", "module", " ", "and", " ", "an", " ", "output", " ", "port", " ", "name", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "type", " ", "module", ":", " ", "vist", "rail", "s", ".", "core", ".", "vist", "rail", ".", "module", ".", "Modul", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "Modul", "e", "Descrip", "tor", " ", "|", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "module_", "._", "has", "\\u", "port", "\\u", "spec_", "(_", "port", "Name_", ",_", "'", "output", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "module_", "._", "get", "\\u", "port", "\\u", "spec_", "(_", "port", "Name_", ",_", "'", "output", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "staticmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get", "\\u", "subclass", "\\u", "candidates_", "(_", "module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "all", " ", "Modul", "e", " ", "superclass", "es", " ", "of", " ", "the", " ", "give", "n", " ", "Modul", "e", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "superclass", "es", " ", "of", " ", "the", " ", "give", "n", " ", "Modul", "e", " ", "subclass", ",", " ", "but", " ", "only", " ", "tho", "se", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "are", " ", "subclasses", " ", "of", " ", "Modul", "e", " ", "them", "sel", "ves", ".", " ", "Thi", "s", " ", "means", " ", "tha", "t", " ", "mix", "ins", " ", "won", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "return", "ed", ",", " ", "sinc", "e", " ", "the", "y", " ", "don", "'", "t", " ", "subclass", " ", "Modul", "e", " ", "direct", "ly", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "list", "[", "class", "]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "klass_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "klass_", "in_", "module_", "._", "\\u\\u", "bases\\u", "\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "issubclass_", "(_", "klass_", ",_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "vist", "rail", "s", "\\u", "module_", "._", "Module_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "current", "\\u", "package_", "(_", "self_", ",_", "package_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Set", " ", "the", " ", "current", " ", "package", " ", "for", " ", "all", " ", "add", "\\u", "module", "()", " ", "operati", "ons", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "means", " ", "tha", "t", " ", "all", " ", "module", "s", " ", "adde", "d", " ", "after", " ", "this", " ", "call", " ", "will", " ", "be", " ", "assign", "ed", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "specified", " ", "package", ".", " ", " ", "Set", " ", "package", " ", "to", " ", "Non", "e", " ", "to", " ", "indicat", "e", " ", "tha", "t", " ", "Vis", "Trail", "s", "\\", "10", ";", " ", " ", " ", " ", "default", " ", "package", " ", "shou", "ld", " ", "be", " ", "used", " ", "inst", "ead", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Do", " ", "not", " ", "call", " ", "this", " ", "direct", "ly", ".", " ", "The", " ", "package", " ", "manage", "r", " ", "will", " ", "call", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "correct", " ", "value", " ", "prior", " ", "to", " ", "calling", " ", "'", "initialize", "'", " ", "on", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "package", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "package_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "self_", "._", "\\u", "default", "\\u", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "current", "\\u", "package_", "=_", "package_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "configura", "tion", "\\u", "widget_", "(_", "self_", ",_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "descriptor_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "identifier_", ",_", "name_", ",_", "namespace_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "package_", "=_", "self_", "._", "get", "\\u", "package", "\\u", "by", "\\u", "name_", "(_", "identifier_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "package_", "._", "prefix_", "is_", "not_", "None_", "and_", "package_", "._", "code", "path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "prefix_", "=_", "package_", "._", "prefix_", "+_", "package_", "._", "code", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cls_", "=_", "descriptor_", "._", "configura", "tion", "\\u", "widget_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "._", "load", "\\u", "cls_", "(_", "cls_", ",_", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "constant", "\\u", "config", "\\u", "params_", "(_", "self_", ",_", "widget", "\\u", "type_", "=_", "None_", ",_", "widget", "\\u", "use_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "widget", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "widget", "\\u", "use_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "use_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "widget", "\\u", "type_", ",_", "widget", "\\u", "use_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "self_", ",_", "descriptor_", ",_", "widget", "\\u", "type_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "use_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", ",_", "widget", "\\u", "use_", "=_", "self_", "._", "get", "\\u", "constant", "\\u", "config", "\\u", "params_", "(_", "widget", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "use_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "desc_", "in_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "desc_", "._", "has", "\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "widget", "\\u", "use_", ",_", "widget", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "desc_", "._", "get", "\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "widget", "\\u", "use_", ",_", "widget", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "all", "\\u", "constant", "\\u", "config", "\\u", "widgets_", "(_", "self_", ",_", "descriptor_", ",_", "widget", "\\u", "use_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "use_", "=_", "self_", "._", "get", "\\u", "constant", "\\u", "config", "\\u", "params_", "(_", "None_", ",_", "widget", "\\u", "use_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "widgets_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "desc_", "in_", "reversed_", "(_", "self_", "._", "get", "\\u", "module", "\\u", "hierarchy_", "(_", "descriptor_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widgets_", "._", "update_", "(_", "desc_", "._", "get", "\\u", "all", "\\u", "constant", "\\u", "config", "\\u", "widgets_", "(_", "widget", "\\u", "use_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "widgets_", "._", "values_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "self_", ",_", "descriptor_", ",_", "widget", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "type_", "=_", "None_", ",_", "widget", "\\u", "use_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widget", "\\u", "type_", ",_", "widget", "\\u", "use_", "=_", "self_", "._", "get", "\\u", "constant", "\\u", "config", "\\u", "params_", "(_", "widget", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "use_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "constant", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "'", "Const", "ant", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "descriptor_", ",_", "constant", "\\u", "desc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Descrip", "tor", " ", "\"%", "s", "\"", " ", "must", " ", "be", " ", "a", " ", "subclass", " ", "of", " ", "Const", "ant", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "to", " ", "use", " ", "a", " ", "constant", " ", "configura", "tion", " ", "widget", ".'_", "%_", "descriptor_", "._", "sig", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descriptor_", "._", "set\\u", "constant", "\\u", "config", "\\u", "widget_", "(_", "widget", "\\u", "class_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "widget", "\\u", "use_", ",_", "widget", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "self_", ",_", "sub_", ",_", "super_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Check", "s", " ", "whe", "ther", " ", "a", " ", "descrip", "tor", " ", "subclasses", " ", "anot", "her", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sub_", "._", "module_", "is_", "not_", "None_", "and_", "super_", "._", "module_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "issubclass_", "(_", "sub_", "._", "module_", ",_", "super_", "._", "module_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "use", " ", "descrip", "tors", " ", "them", "sel", "ves_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "sub_", "==_", "super_", ":_", "\\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_", "while_", "sub_", "!=_", "self_", "._", "root", "\\u", "descriptor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sub_", "=_", "sub_", "._", "base", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sub_", "==_", "super_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "self_", ",_", "d1_", ",_", "d2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d1_", ",_", "d2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d2_", ",_", "d1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "find", "\\u", "descrip", "tor", "\\u", "superclass", "_", "(_", "self_", ",_", "d1_", ",_", "d2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Fin", "ds", " ", "the", " ", "lowe", "st", " ", "common", " ", "superclass", " ", "descrip", "tor", " ", "for", " ", "`", "d1", "`", " ", "and", " ", "`", "d2", "`", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "The", " ", "Modul", "e", "Descrip", "tor", " ", "or", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d1_", ",_", "d2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d2_", ",_", "d1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "d1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d1", "\\u", "list_", "=_", "[_", "d1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "d1_", "!=_", "self_", "._", "root", "\\u", "descriptor_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1_", "=_", "d1_", "._", "base", "\\u", "descriptor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "d1", "\\u", "list_", "._", "append_", "(_", "d1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d1", "\\u", "idx_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "d2_", ",_", "d1", "\\u", "list_", "[_", "d1", "\\u", "idx_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d1", "\\u", "idx_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d1", "\\u", "idx_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "d1", "\\u", "list_", "[_", "d1", "\\u", "idx_", "+_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "is", "\\u", "abstract", "ion_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "basic", "\\u", "pkg_", "=_", "get", "\\u", "vist", "rail", "s", "\\u", "basic", "\\u", "pkg", "\\u", "id_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "abstract", "ion", "\\u", "desc_", "=_", "self_", "._", "get", "\\u", "descrip", "tor", "\\u", "by", "\\u", "name_", "(_", "basic", "\\u", "pkg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Sub", "Work", "flow", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Missing", "Module_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "No", " ", "abstract", "ion", "s", " ", "can", " ", "be", " ", "load", "ed", " ", "bef", "ore", " ", "the", " ", "basic_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sub", "Work", "flow", " ", "descrip", "tor", " ", "is", " ", "initialized_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "abstract", "ion", "\\u", "desc_", "!=_", "descriptor_", "and_", "self_", "._", "is", "\\u", "descrip", "tor", "\\u", "subclass_", "(_", "descriptor_", ",_", "abstract", "ion", "\\u", "desc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "show", "\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "show", "\\u", "module_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hide", "\\u", "module_", "(_", "self_", ",_", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "hide", "\\u", "module_", "(_", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "update", "\\u", "module_", "(_", "self_", ",_", "old", "\\u", "descriptor_", ",_", "new", "\\u", "descriptor_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "signals_", "._", "emit", "\\u", "module", "\\u", "updated_", "(_", "old", "\\u", "descriptor_", ",_", "new", "\\u", "descriptor_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Modul", "e", "Registry_", "(_", "DB", "Registry_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "expand", "\\u", "port", "\\u", "spec", "\\u", "string_", "(_", "self_", ",_", "p", "\\u", "string_", ",_", "cur", "\\u", "package_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "style_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "utils_", "._", "expand", "\\u", "port", "\\u", "spec", "\\u", "string_", "(_", "p", "\\u", "string_", ",_", "cur", "\\u", "package_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "style_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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", "module", "\\u", "registry_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "registry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Vis", "trail", "s", "Intern", "al", "Error_", "(_", "\"", "Regi", "stry", " ", "not", " ", "construct", "ed", " ", "ye", "t", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "registry_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "module", "\\u", "registr", "y", "\\u", "loaded_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "registry_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Test", "Modul", "e", "Registry_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Modul", "e", "Registry_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "port", "spec", "\\u", "constructi", "on_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "vist", "rail", "s_", "._", "core_", "._", "modules_", "._", "basic", "\\u", "modules_", "import_", "Float_", ",_", "Integer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t1_", "=_", "Port", "Spec_", "(_", "signature_", "=_", "Float_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Port", "Spec_", "(_", "signature_", "=_", "[_", "Float_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "t1_", ",_", "t2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t1_", "=_", "Port", "Spec_", "(_", "signature_", "=_", "[_", "Float_", ",_", "Integer_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t2_", "=_", "Port", "Spec_", "(_", "signature_", "=_", "[_", "Integer_", ",_", "Float_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equals_", "(_", "t1_", ",_", "t2_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
lingthio/Flask-User/flask_user/tests/test_multiple_emails.py
[ { "content": "def test_multiple_emails(app, db, client):\n \"\"\"\n Test 'multiple emails per user' feature\n \"\"\"\n\n # Set Flask-User settings\n um = current_app.user_manager\n um.enable_register = True\n um.enable_username = False\n um.enable_email = True\n um.enable_confirm_email = True\n um.enable_change_username = False\n um.enable_change_password = False\n um.enable_forgot_password = False\n um.enable_multiple_emails = True\n um.enable_retype_password = False\n\n # Adjust DbAdapter settings\n um.db_adapter.UserEmailClass = app.UserEmailClass\n\n # Adjust URL routes\n app.add_url_rule(um.email_action_url, 'user.email_action', um.email_action_view_function)\n app.add_url_rule(um.manage_emails_url, 'user.manage_emails', um.manage_emails_view_function, methods=['GET', 'POST'])\n\n # constants\n EMAIL1 = '[email protected]'\n EMAIL2 = '[email protected]'\n PASSWORD = 'Password1'\n\n # Register user\n response = client.post_valid_form(url_for('user.register'), email=EMAIL1, password=PASSWORD)\n user_email1 = um.db_adapter.UserEmailClass.query.filter(um.db_adapter.UserEmailClass.email==EMAIL1).first()\n assert user_email1 != None\n\n # Confirm email\n confirmation_token = um.generate_token(user_email1.id)\n client.get_valid_page(url_for('user.confirm_email', token=confirmation_token))\n\n # Log in using email1\n client.login(email=EMAIL1, password=PASSWORD)\n\n # Visit manage emails page\n response = client.get_valid_page(url_for('user.manage_emails'))\n assert response.data.find(str.encode(EMAIL1)) >= 0\n\n # Add an email\n response = client.post_valid_form(url_for('user.manage_emails'), email=EMAIL2)\n assert response.data.find(str.encode(EMAIL1)) >= 0\n assert response.data.find(str.encode(EMAIL2)) >= 0\n user_email2 = um.db_adapter.UserEmailClass.query.filter(um.db_adapter.UserEmailClass.email==EMAIL2).first()\n assert user_email2 != None\n\n # Confirm email\n confirmation_token = um.generate_token(user_email2.id)\n client.get_valid_page(url_for('user.confirm_email', token=confirmation_token))\n\n # Logout\n client.logout()\n\n # Log in using email1\n client.login(email=EMAIL1, password=PASSWORD)\n\n # Logout\n client.logout()\n\n # Log in using email2\n client.login(email=EMAIL2, password=PASSWORD)\n\n # Confirm\n response = client.get_valid_page(url_for('user.email_action', id=user_email2.id, action='confirm'))\n\n # Make primary\n response = client.get_valid_page(url_for('user.email_action', id=user_email2.id, action='make-primary'))\n\n # Delete\n response = client.get_valid_page(url_for('user.email_action', id=user_email1.id, action='delete'))\n\n # Logout\n client.logout()\n\n # Restore settings\n um.enable_multiple_emails = False\n um.enable_confirm_email = True\n um.enable_retype_password = True\n um.db_adapter.UserEmailClass = None", "metadata": "root.test_multiple_emails", "header": "['module', '___EOS___']", "index": 28 } ]
[ { "span": "response ", "start_line": 58, "start_column": 4, "end_line": 58, "end_column": 12 }, { "span": "response ", "start_line": 97, "start_column": 4, "end_line": 97, "end_column": 12 }, { "span": "response ", "start_line": 100, "start_column": 4, "end_line": 100, "end_column": 12 } ]
[ { "span": "response ", "start_line": 70, "start_column": 4, "end_line": 70, "end_column": 12 }, { "span": "response ", "start_line": 103, "start_column": 4, "end_line": 103, "end_column": 12 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "multiple", "\\u", "emails_", "(_", "app_", ",_", "db_", ",_", "client_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "'", "multiple", " ", "email", "s", " ", "per", " ", "user", "'", " ", "feature", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "Fla", "sk", "-", "User", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "um_", "=_", "current", "\\u", "app_", "._", "user", "\\u", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "register_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "username_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "email_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "confirm", "\\u", "email_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "change", "\\u", "username_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "change", "\\u", "password_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "forgo", "t", "\\u", "password_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "multiple", "\\u", "emails_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "ret", "ype", "\\u", "password_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "Db", "Adapt", "er", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "=_", "app_", "._", "User", "Ema", "il", "Class_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Adjust", " ", "URL", " ", "routes_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "add", "\\u", "url", "\\u", "rule_", "(_", "um_", "._", "email", "\\u", "action", "\\u", "url_", ",_", "'", "user", ".", "email", "\\u", "action", "'_", ",_", "um_", "._", "email", "\\u", "action", "\\u", "view", "\\u", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "._", "add", "\\u", "url", "\\u", "rule_", "(_", "um_", "._", "manage", "\\u", "email", "s", "\\u", "url_", ",_", "'", "user", ".", "manage", "\\u", "email", "s", "'_", ",_", "um_", "._", "manage", "\\u", "email", "s", "\\u", "view", "\\u", "function_", ",_", "methods_", "=_", "[_", "'", "GET", "'_", ",_", "'", "POST", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "EMA", "IL", "1_", "=_", "'", "email", "1", "@", "multi", "-", "email", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "EMA", "IL", "2_", "=_", "'", "email", "2", "@", "multi", "-", "email", ".", "com", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PASSWORD_", "=_", "'", "Passw", "ord", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Register", " ", "user_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "post", "\\u", "valid", "\\u", "form_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "register", "'_", ")_", ",_", "email_", "=_", "EMA", "IL", "1_", ",_", "password_", "=_", "PASSWORD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "email", "1_", "=_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "._", "query_", "._", "filter_", "(_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "._", "email_", "==_", "EMA", "IL", "1_", ")_", "._", "first_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "user", "\\u", "email", "1_", "!=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Confirm", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "confirmation", "\\u", "token_", "=_", "um_", "._", "generat", "e\\u", "token_", "(_", "user", "\\u", "email", "1_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "confirm", "\\u", "email", "'_", ",_", "token_", "=_", "confirmation", "\\u", "token_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Log", " ", "in", " ", "usi", "ng", " ", "email", "1_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "login_", "(_", "email_", "=_", "EMA", "IL", "1_", ",_", "password_", "=_", "PASSWORD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Visit", " ", "manage", " ", "email", "s", " ", "page_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "manage", "\\u", "email", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "data_", "._", "find_", "(_", "str_", "._", "encode_", "(_", "EMA", "IL", "1_", ")_", ")_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "an", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "post", "\\u", "valid", "\\u", "form_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "manage", "\\u", "email", "s", "'_", ")_", ",_", "email_", "=_", "EMA", "IL", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "data_", "._", "find_", "(_", "str_", "._", "encode_", "(_", "EMA", "IL", "1_", ")_", ")_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "._", "data_", "._", "find_", "(_", "str_", "._", "encode_", "(_", "EMA", "IL", "2_", ")_", ")_", ">=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "email", "2_", "=_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "._", "query_", "._", "filter_", "(_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "._", "email_", "==_", "EMA", "IL", "2_", ")_", "._", "first_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "user", "\\u", "email", "2_", "!=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Confirm", " ", "email_", "\\u\\u\\uNL\\u\\u\\u_", "confirmation", "\\u", "token_", "=_", "um_", "._", "generat", "e\\u", "token_", "(_", "user", "\\u", "email", "2_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "confirm", "\\u", "email", "'_", ",_", "token_", "=_", "confirmation", "\\u", "token_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Logo", "ut_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Log", " ", "in", " ", "usi", "ng", " ", "email", "1_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "login_", "(_", "email_", "=_", "EMA", "IL", "1_", ",_", "password_", "=_", "PASSWORD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Logo", "ut_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Log", " ", "in", " ", "usi", "ng", " ", "email", "2_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "login_", "(_", "email_", "=_", "EMA", "IL", "2_", ",_", "password_", "=_", "PASSWORD_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Confirm", "_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "email", "\\u", "action", "'_", ",_", "id_", "=_", "user", "\\u", "email", "2_", "._", "id_", ",_", "action_", "=_", "'", "confirm", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "primary_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "email", "\\u", "action", "'_", ",_", "id_", "=_", "user", "\\u", "email", "2_", "._", "id_", ",_", "action_", "=_", "'", "make", "-", "primary", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Delete_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "client_", "._", "get", "\\u", "valid", "\\u", "page_", "(_", "url", "\\u", "for_", "(_", "'", "user", ".", "email", "\\u", "action", "'_", ",_", "id_", "=_", "user", "\\u", "email", "1_", "._", "id_", ",_", "action_", "=_", "'", "delete", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Logo", "ut_", "\\u\\u\\uNL\\u\\u\\u_", "client_", "._", "logout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Restor", "e", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "um_", "._", "enable", "\\u", "multiple", "\\u", "emails_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "confirm", "\\u", "email_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "enable", "\\u", "ret", "ype", "\\u", "password_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "um_", "._", "db", "\\u", "adapter_", "._", "User", "Ema", "il", "Class_", "=_", "None_" ]
[ 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, 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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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
jkcom/SublimeRJS/core/factory.py
[ { "content": "def onNameDone(inputString):\n\tglobal createConfig\n\tglobal context\n\tglobal shadowList\n\tmoduleFile = context.getBaseDir() + createConfig[\"packageBase\"] + \"/\" + inputString\n\tcreateConfig[\"moduleFile\"] = moduleFile\n\tprint moduleFile\n\n\tname = moduleFile[moduleFile.rfind(\"/\"):]\n\tif not \".\" in name:\n\t\tif createConfig[\"type\"] == \"script\":\n\t\t\text = \".js\"\n\t\t\tname += ext\n\t\telif createConfig[\"type\"] == \"text\":\n\t\t\text = \".html\"\n\t\t\tname += ext\n\telse:\n\t\text = name[name.rfind(\".\"):]\n\n\tmoduleDir = moduleFile[0:moduleFile.rfind(\"/\")]\n\tmoduleFile = moduleDir + name\n\tcreateConfig[\"moduleFile\"] = moduleFile\n\tif os.path.exists(moduleDir) == False:\n\t\tos.makedirs(moduleDir)\n\n\t# ask for snippet\n\tif len(context.settings[\"module_templates\"]) > 0:\n\t\tsnippetsDir = context.getBaseDir() + context.settings[\"module_templates\"]\n\t\tsnippets = []\n\t\tshadowList =[]\n\t\tsnippets.append(\"Blank\")\n\t\tshadowList.append(\"\")\n\t\tfor file in os.listdir(snippetsDir):\n\t\t\tdirfile = os.path.join(snippetsDir, file)\n\t\t\tif os.path.isfile(dirfile):\n\t\t\t\tprint \"TEST .=\" + str(ntpath.basename(file)[0:1]), str(ntpath.basename(file)[0:1]) is \".\"\n\t\t\t\tif \"DS_Store\" not in ntpath.basename(file):\n\t\t\t\t\tsnippets.append(ntpath.basename(file))\n\t\t\t\t\tshadowList.append(dirfile)\n\n\t\tcontext.window.show_quick_panel(snippets, onSnippetSelected, 0)\n\telse:\n\t\tfinish(\"\")", "metadata": "root.onNameDone", "header": "['module', '___EOS___']", "index": 55 } ]
[ { "span": "ext ", "start_line": 72, "start_column": 2, "end_line": 72, "end_column": 5 } ]
[]
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_", "on", "Name", "Done_", "(_", "input", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "create", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "shadow", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "File_", "=_", "context_", "._", "get", "Base", "Dir_", "(_", ")_", "+_", "create", "Config_", "[_", "\"", "package", "Base", "\"_", "]_", "+_", "\"/\"_", "+_", "input", "String_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "Config_", "[_", "\"", "module", "File", "\"_", "]_", "=_", "module", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "module", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "module", "File_", "[_", "module", "File_", "._", "rfind_", "(_", "\"/\"_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "\".\"_", "in_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "if_", "create", "Config_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "script", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "ext_", "=_", "\".", "js", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "+=_", "ext_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "create", "Config_", "[_", "\"", "type", "\"_", "]_", "==_", "\"", "text", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "ext_", "=_", "\".", "html", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "+=_", "ext_", "\\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_", "ext_", "=_", "name_", "[_", "name_", "._", "rfind_", "(_", "\".\"_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "module", "Dir_", "=_", "module", "File_", "[_", "0_", ":_", "module", "File_", "._", "rfind_", "(_", "\"/\"_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "module", "File_", "=_", "module", "Dir_", "+_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "Config_", "[_", "\"", "module", "File", "\"_", "]_", "=_", "module", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "module", "Dir_", ")_", "==_", "False_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "os_", "._", "makedirs_", "(_", "module", "Dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ask", " ", "for", " ", "snippet_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "context_", "._", "settings_", "[_", "\"", "module", "\\u", "template", "s", "\"_", "]_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "snippet", "s", "Dir_", "=_", "context_", "._", "get", "Base", "Dir_", "(_", ")_", "+_", "context_", "._", "settings_", "[_", "\"", "module", "\\u", "template", "s", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snippets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shadow", "List_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snippets_", "._", "append_", "(_", "\"", "Blan", "k", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shadow", "List_", "._", "append_", "(_", "\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "file_", "in_", "os_", "._", "listdir_", "(_", "snippet", "s", "Dir_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "dir", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "snippet", "s", "Dir_", ",_", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "isfile_", "(_", "dir", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "print_", "\"", "TEST", " ", ".", "=\"_", "+_", "str_", "(_", "ntpath", "_", "._", "basename_", "(_", "file_", ")_", "[_", "0_", ":_", "1_", "]_", ")_", ",_", "str_", "(_", "ntpath", "_", "._", "basename_", "(_", "file_", ")_", "[_", "0_", ":_", "1_", "]_", ")_", "is_", "\".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\"", "DS", "\\u", "Stor", "e", "\"_", "not_", "in_", "ntpath", "_", "._", "basename_", "(_", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "snippets_", "._", "append_", "(_", "ntpath", "_", "._", "basename_", "(_", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shadow", "List_", "._", "append_", "(_", "dir", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "context_", "._", "window_", "._", "show", "\\u", "quick", "\\u", "panel_", "(_", "snippets_", ",_", "on", "Snippet", "Selected_", ",_", "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\t", "\t_", "finish_", "(_", "\"\"_", ")_", "\\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,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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 ]
Unused import
PyHDI/Pyverilog/pyverilog/vparser/parser.py
[ { "content": "#-------------------------------------------------------------------------------\n# parser.py\n#\n# Verilog Parser\n#\n# Copyright (C) 2013, Shinya Takamaeda-Yamazaki\n# License: Apache 2.0\n# Contributor: ryosuke fukatani\n#-------------------------------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport sys\nimport os\n\nfrom pyverilog.vparser.ply.yacc import yacc\nfrom pyverilog.vparser.plyparser import PLYParser, Coord, ParseError\nfrom pyverilog.vparser.preprocessor import VerilogPreprocessor\nfrom pyverilog.vparser.lexer import VerilogLexer\nfrom pyverilog.vparser.ast import *\n\n\n#-------------------------------------------------------------------------------\n\n#-------------------------------------------------------------------------------\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class VerilogParser(PLYParser):\n 'Verilog HDL Parser'\n\n # Expression Precedence\n # Reference: http://hp.vector.co.jp/authors/VA016670/verilog/index.html\n precedence = (\n # <- Weak\n ('left', 'LOR'),\n ('left', 'LAND'),\n ('left', 'OR'),\n ('left', 'AND', 'XOR', 'XNOR'),\n ('left', 'EQ', 'NE', 'EQL', 'NEL'),\n ('left', 'LT', 'GT', 'LE', 'GE'),\n ('left', 'LSHIFT', 'RSHIFT', 'LSHIFTA', 'RSHIFTA'),\n ('left', 'PLUS', 'MINUS'),\n ('left', 'TIMES', 'DIVIDE', 'MOD'),\n ('left', 'POWER'),\n ('right', 'UMINUS', 'UPLUS', 'ULNOT', 'UNOT',\n 'UAND', 'UNAND', 'UOR', 'UNOR', 'UXOR', 'UXNOR'),\n # -> Strong\n )\n\n\n\n\n\n # Returns AST\n\n ######################################################################\n # Parse Rule Definition\n ######################################################################\n\n\n\n\n\n\n ######################################################################\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # Signal Decl\n\n\n\n\n\n\n\n\n # Decl and Assign\n\n\n\n\n\n\n # Integer\n\n\n\n\n\n # Real\n\n\n\n\n # Parameter\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n # Level 1 (Highest Priority)\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n # Level 2\n\n ######################################################################\n # Level 3\n\n\n\n ######################################################################\n # Level 4\n\n\n ######################################################################\n # Level 5\n\n\n\n\n ######################################################################\n # Level 6\n\n\n\n\n ######################################################################\n # Level 7\n\n\n\n\n ######################################################################\n # Level 8\n\n\n\n ######################################################################\n # Level 9\n\n ######################################################################\n # Level 10\n\n ######################################################################\n # Level 11\n\n ######################################################################\n # Level 12\n\n ######################################################################\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n ######################################################################\n # String Literal\n\n ######################################################################\n # Always\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n ######################################################################\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n ######################################################################\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n ######################################################################\n\n ######################################################################\n\n\n\n ######################################################################\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n\n\n\n\n ######################################################################\n\n\n\n\n\n\n\n ######################################################################\n\n\n ######################################################################\n\n\n ######################################################################\n\n ######################################################################\n\n\n\n ## fix me: to support task-call-statement\n #def p_single_statement_taskcall(self, p):\n # 'single_statement : functioncall SEMICOLON'\n # p[0] = SingleStatement(p[1], lineno=p.lineno(1))\n # p.set_lineno(0, p.lineno(1))\n\n #def p_single_statement_taskcall_empty(self, p):\n # 'single_statement : taskcall SEMICOLON'\n # p[0] = SingleStatement(p[1], lineno=p.lineno(1))\n # p.set_lineno(0, p.lineno(1))\n\n #def p_taskcall_empty(self, p):\n # 'taskcall : identifier'\n # p[0] = FunctionCall(p[1], (), lineno=p.lineno(1))\n # p.set_lineno(0, p.lineno(1))\n\n ######################################################################\n\n ######################################################################", "metadata": "root.VerilogParser", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self):\n self.lexer = VerilogLexer(error_func=self._lexer_error_func)\n self.lexer.build()\n\n self.tokens = self.lexer.tokens\n #self.parser = yacc(module=self)\n ## Use this if you want to build the parser using LALR(1) instead of SLR\n self.parser = yacc(module=self, method=\"LALR\")", "metadata": "root.VerilogParser.__init__", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 42 }, { "content": " def _lexer_error_func(self, msg, line, column):\n self._parse_error(msg, self._coord(line, column))", "metadata": "root.VerilogParser._lexer_error_func", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 51 }, { "content": " def get_directives(self):\n return self.lexer.get_directives()", "metadata": "root.VerilogParser.get_directives", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 54 }, { "content": " def get_default_nettype(self):\n return self.lexer.get_default_nettype()", "metadata": "root.VerilogParser.get_default_nettype", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 57 }, { "content": " def parse(self, text, debug=0):\n return self.parser.parse(text, lexer=self.lexer, debug=debug)", "metadata": "root.VerilogParser.parse", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 61 }, { "content": " def p_source_text(self, p):\n 'source_text : description'\n p[0] = Source(name='', description=p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_source_text", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 67 }, { "content": " def p_description(self, p):\n 'description : definitions'\n p[0] = Description(definitions=p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_description", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 72 }, { "content": " def p_definitions(self, p):\n 'definitions : definitions definition'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_definitions", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 77 }, { "content": " def p_definitions_one(self, p):\n 'definitions : definition'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_definitions_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 82 }, { "content": " def p_definition(self, p):\n 'definition : moduledef'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_definition", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 87 }, { "content": " def p_definition_pragma(self, p):\n 'definition : pragma'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_definition_pragma", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 92 }, { "content": " def p_pragma_assign(self, p):\n 'pragma : LPAREN TIMES ID EQUALS expression TIMES RPAREN'\n p[0] = Pragma( PragmaEntry(p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_pragma_assign", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 98 }, { "content": " def p_pragma(self, p):\n 'pragma : LPAREN TIMES ID TIMES RPAREN'\n p[0] = Pragma( PragmaEntry(p[3], lineno=p.lineno(1)), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_pragma", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 103 }, { "content": " def p_moduledef(self, p):\n 'moduledef : MODULE modulename paramlist portlist items ENDMODULE'\n p[0] = ModuleDef(name=p[2], paramlist=p[3], portlist=p[4], items=p[5],\n default_nettype=self.get_default_nettype(), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_moduledef", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 109 }, { "content": " def p_modulename(self, p):\n 'modulename : ID'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_modulename", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 115 }, { "content": " def p_modulename_or(self, p):\n 'modulename : SENS_OR' # or primitive\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_modulename_or", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 120 }, { "content": " def p_paramlist(self, p):\n 'paramlist : DELAY LPAREN params RPAREN'\n p[0] = Paramlist(params=p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_paramlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 125 }, { "content": " def p_paramlist_empty(self, p):\n 'paramlist : empty'\n p[0] = Paramlist(params=())", "metadata": "root.VerilogParser.p_paramlist_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 130 }, { "content": " def p_params(self, p):\n 'params : params_begin param_end'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_params", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 134 }, { "content": " def p_params_begin(self, p):\n 'params_begin : params_begin param'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_params_begin", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 139 }, { "content": " def p_params_begin_one(self, p):\n 'params_begin : param'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_params_begin_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 144 }, { "content": " def p_params_one(self, p):\n 'params : param_end'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_params_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 149 }, { "content": " def p_param(self, p):\n 'param : PARAMETER param_substitution_list COMMA'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(2)) for rname, rvalue in p[2] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 154 }, { "content": " def p_param_width(self, p):\n 'param : PARAMETER width param_substitution_list COMMA'\n paramlist = [ Parameter(rname, rvalue, p[2], lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 160 }, { "content": " def p_param_integer(self, p):\n 'param : PARAMETER INTEGER param_substitution_list COMMA'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_integer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 166 }, { "content": " def p_param_end(self, p):\n 'param_end : PARAMETER param_substitution_list'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(2)) for rname, rvalue in p[2] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_end", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 172 }, { "content": " def p_param_end_width(self, p):\n 'param_end : PARAMETER width param_substitution_list'\n paramlist = [ Parameter(rname, rvalue, p[2], lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_end_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 178 }, { "content": " def p_param_end_integer(self, p):\n 'param_end : PARAMETER INTEGER param_substitution_list'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_end_integer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 184 }, { "content": " def p_portlist(self, p):\n 'portlist : LPAREN ports RPAREN SEMICOLON'\n p[0] = Portlist(ports=p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_portlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 190 }, { "content": " def p_portlist_io(self, p):\n 'portlist : LPAREN ioports RPAREN SEMICOLON'\n p[0] = Portlist(ports=p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_portlist_io", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 195 }, { "content": " def p_portlist_paren_empty(self, p):\n 'portlist : LPAREN RPAREN SEMICOLON'\n p[0] = Portlist(ports=(), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_portlist_paren_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 200 }, { "content": " def p_portlist_empty(self, p):\n 'portlist : SEMICOLON'\n p[0] = Portlist(ports=(), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_portlist_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 205 }, { "content": " def p_ports(self, p):\n 'ports : ports COMMA portname'\n wid = None\n port = Port(name=p[3], width=wid, type=None, lineno=p.lineno(1))\n p[0] = p[1] + (port,)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ports", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 210 }, { "content": " def p_ports_one(self, p):\n 'ports : portname'\n wid = None\n port = Port(name=p[1], width=wid, type=None, lineno=p.lineno(1))\n p[0] = (port,)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ports_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 217 }, { "content": " def p_portname(self, p):\n 'portname : ID'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_portname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 224 }, { "content": " def p_sigtypes(self, p):\n 'sigtypes : sigtypes sigtype'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtypes", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 229 }, { "content": " def p_sigtypes_one(self, p):\n 'sigtypes : sigtype'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtypes_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 234 }, { "content": " def p_sigtype_input(self, p):\n 'sigtype : INPUT'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_input", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 239 }, { "content": " def p_sigtype_output(self, p):\n 'sigtype : OUTPUT'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_output", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 244 }, { "content": " def p_sigtype_inout(self, p):\n 'sigtype : INOUT'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_inout", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 249 }, { "content": " def p_sigtype_tri(self, p):\n 'sigtype : TRI'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_tri", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 254 }, { "content": " def p_sigtype_reg(self, p):\n 'sigtype : REG'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_reg", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 259 }, { "content": " def p_sigtype_wire(self, p):\n 'sigtype : WIRE'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_wire", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 264 }, { "content": " def p_sigtype_signed(self, p):\n 'sigtype : SIGNED'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_signed", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 269 }, { "content": " def p_sigtype_supply0(self, p):\n 'sigtype : SUPPLY0'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_supply0", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 274 }, { "content": " def p_sigtype_supply1(self, p):\n 'sigtype : SUPPLY1'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sigtype_supply1", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 279 }, { "content": " def p_ioports(self, p):\n 'ioports : ioports COMMA ioport'\n if isinstance(p[3], str):\n t = None\n for r in reversed(p[1]):\n if isinstance(r.first, Input):\n t = Ioport(Input(name=p[3], width=r.first.width, lineno=p.lineno(3)),\n lineno=p.lineno(3))\n break\n if isinstance(r.first, Output) and r.second is None:\n t = Ioport(Output(name=p[3], width=r.first.width, lineno=p.lineno(3)),\n lineno=p.lineno(3))\n break\n if isinstance(r.first, Output) and isinstance(r.second, Reg):\n t = Ioport(Output(name=p[3], width=r.first.width, lineno=p.lineno(3)),\n Reg(name=p[3],width=r.first.width, lineno=p.lineno(3)),\n lineno=p.lineno(3))\n break\n if isinstance(r.first, Inout):\n t = Ioport(Inout(name=p[3],width=r.first.width, lineno=p.lineno(3)),\n lineno=p.lineno(3))\n break\n p[0] = p[1] + (t,)\n else:\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioports", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 284 }, { "content": " def p_ioports_one(self, p):\n 'ioports : ioport_head'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioports_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 311 }, { "content": " def create_ioport(self, sigtypes, name, width=None, lineno=0):\n self.typecheck_ioport(sigtypes)\n first = None\n second = None\n signed = False\n if 'signed' in sigtypes:\n signed = True\n if 'input' in sigtypes:\n first = Input(name=name, width=width, signed=signed, lineno=lineno)\n if 'output' in sigtypes:\n first = Output(name=name, width=width, signed=signed, lineno=lineno)\n if 'inout' in sigtypes:\n first = Inout(name=name, width=width, signed=signed, lineno=lineno)\n if 'wire' in sigtypes:\n second = Wire(name=name, width=width, signed=signed, lineno=lineno)\n if 'reg' in sigtypes:\n second = Reg(name=name, width=width, signed=signed, lineno=lineno)\n if 'tri' in sigtypes:\n second = Tri(name=name, width=width, signed=signed, lineno=lineno)\n return Ioport(first, second, lineno=lineno)", "metadata": "root.VerilogParser.create_ioport", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 316 }, { "content": " def typecheck_ioport(self, sigtypes):\n if 'input' not in sigtypes and 'output' not in sigtypes and 'inout' not in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'input' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'tri' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'output' in sigtypes and 'tri' in sigtypes:\n raise ParseError(\"Syntax Error\")", "metadata": "root.VerilogParser.typecheck_ioport", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 337 }, { "content": " def p_ioport(self, p):\n 'ioport : sigtypes portname'\n p[0] = self.create_ioport(p[1], p[2], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioport", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 355 }, { "content": " def p_ioport_width(self, p):\n 'ioport : sigtypes width portname'\n p[0] = self.create_ioport(p[1], p[3], width=p[2], lineno=p.lineno(3))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioport_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 360 }, { "content": " def p_ioport_head(self, p):\n 'ioport_head : sigtypes portname'\n p[0] = self.create_ioport(p[1], p[2], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioport_head", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 365 }, { "content": " def p_ioport_head_width(self, p):\n 'ioport_head : sigtypes width portname'\n p[0] = self.create_ioport(p[1], p[3], width=p[2], lineno=p.lineno(3))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioport_head_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 370 }, { "content": " def p_ioport_portname(self, p):\n 'ioport : portname'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ioport_portname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 375 }, { "content": " def p_width(self, p):\n 'width : LBRACKET expression COLON expression RBRACKET'\n p[0] = Width(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 380 }, { "content": " def p_length(self, p):\n 'length : LBRACKET expression COLON expression RBRACKET'\n p[0] = Length(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_length", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 385 }, { "content": " def p_items(self, p):\n 'items : items item'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_items", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 390 }, { "content": " def p_items_one(self, p):\n 'items : item'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_items_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 395 }, { "content": " def p_items_empty(self, p):\n 'items : empty'\n p[0] = ()", "metadata": "root.VerilogParser.p_items_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 400 }, { "content": " def p_item(self, p):\n \"\"\"item : standard_item\n | generate\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_item", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 404 }, { "content": " def p_standard_item(self, p):\n \"\"\"standard_item : decl\n | integerdecl\n | realdecl\n | declassign\n | parameterdecl\n | localparamdecl\n | genvardecl\n | assignment\n | always\n | initial\n | instance\n | function\n | task\n | pragma\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_standard_item", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 411 }, { "content": " def create_decl(self, sigtypes, name, width=None, length=None, lineno=0):\n self.typecheck_decl(sigtypes, length)\n decls = []\n signed = False\n if 'signed' in sigtypes:\n signed = True\n if 'input' in sigtypes:\n decls.append( Input(name=name, width=width, signed=signed, lineno=lineno) )\n if 'output' in sigtypes:\n decls.append( Output(name=name, width=width, signed=signed, lineno=lineno) )\n if 'inout' in sigtypes:\n decls.append( Inout(name=name, width=width, signed=signed, lineno=lineno) )\n if 'wire' in sigtypes:\n if length:\n decls.append( WireArray(name=name, width=width,\n signed=signed, length=length, lineno=lineno) )\n else:\n decls.append( Wire(name=name, width=width, signed=signed, lineno=lineno) )\n if 'reg' in sigtypes:\n if length:\n decls.append( RegArray(name=name, width=width,\n signed=signed, length=length, lineno=lineno) )\n else:\n decls.append( Reg(name=name, width=width, signed=signed, lineno=lineno) )\n if 'tri' in sigtypes:\n decls.append( Tri(name=name, width=width, signed=signed, lineno=lineno) )\n if 'supply0' in sigtypes:\n decls.append( Supply(name=name,value=IntConst('0', lineno=lineno),\n width=width, signed=signed, lineno=lineno) )\n if 'supply1' in sigtypes:\n decls.append( Supply(name=name,value=IntConst('1', lineno=lineno),\n width=width, signed=signed, lineno=lineno) )\n return decls", "metadata": "root.VerilogParser.create_decl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 431 }, { "content": " def typecheck_decl(self, sigtypes, length=None):\n if length and 'input' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if length and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if length and 'inout' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if len(sigtypes) == 1 and 'signed' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'input' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'tri' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'output' in sigtypes and 'tri' in sigtypes:\n raise ParseError(\"Syntax Error\")", "metadata": "root.VerilogParser.typecheck_decl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 465 }, { "content": " def p_decl(self, p):\n 'decl : sigtypes declnamelist SEMICOLON'\n decllist = []\n for rname, rlength in p[2]:\n decllist.extend( self.create_decl(p[1], rname, length=rlength,\n lineno=p.lineno(2)) )\n p[0] = Decl( tuple(decllist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_decl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 489 }, { "content": " def p_decl_width(self, p):\n 'decl : sigtypes width declnamelist SEMICOLON'\n decllist = []\n for rname, rlength in p[3]:\n decllist.extend( self.create_decl(p[1], rname, width=p[2], length=rlength,\n lineno=p.lineno(3)) )\n p[0] = Decl( tuple(decllist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_decl_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 498 }, { "content": " def p_declnamelist(self, p):\n 'declnamelist : declnamelist COMMA declname'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declnamelist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 507 }, { "content": " def p_declnamelist_one(self, p):\n 'declnamelist : declname'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declnamelist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 512 }, { "content": " def p_declname(self, p):\n 'declname : ID'\n p[0] = (p[1], None)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 517 }, { "content": " def p_declarray(self, p):\n 'declname : ID length'\n p[0] = (p[1], p[2])\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declarray", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 522 }, { "content": " def create_declassign(self, sigtypes, name, assign, width=None, lineno=0):\n self.typecheck_declassign(sigtypes)\n decls = []\n signed = False\n if 'signed' in sigtypes:\n signed = True\n if 'input' in sigtypes:\n decls.append( Input(name=name, width=width, signed=signed, lineno=lineno) )\n if 'output' in sigtypes:\n decls.append( Output(name=name, width=width, signed=signed, lineno=lineno) )\n if 'inout' in sigtypes:\n decls.append( Inout(name=name, width=width, signed=signed, lineno=lineno) )\n if 'wire' in sigtypes:\n decls.append( Wire(name=name, width=width, signed=signed, lineno=lineno) )\n if 'reg' in sigtypes:\n decls.append( Reg(name=name, width=width, signed=signed, lineno=lineno) )\n decls.append( assign )\n return decls", "metadata": "root.VerilogParser.create_declassign", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 528 }, { "content": " def typecheck_declassign(self, sigtypes):\n if len(sigtypes) == 1 and 'signed' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'reg' not in sigtypes and 'wire' not in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'output' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'input' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'input' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'inout' in sigtypes and 'reg' in sigtypes:\n raise ParseError(\"Syntax Error\")\n if 'supply0' in sigtypes and len(sigtypes) != 1:\n raise ParseError(\"Syntax Error\")\n if 'supply1' in sigtypes and len(sigtypes) != 1:\n raise ParseError(\"Syntax Error\")", "metadata": "root.VerilogParser.typecheck_declassign", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 547 }, { "content": " def p_declassign(self, p):\n 'declassign : sigtypes declassign_element SEMICOLON'\n decllist = self.create_declassign(p[1], p[2][0], p[2][1], lineno=p.lineno(2))\n p[0] = Decl( decllist, lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declassign", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 567 }, { "content": " def p_declassign_width(self, p):\n 'declassign : sigtypes width declassign_element SEMICOLON'\n decllist = self.create_declassign(p[1], p[3][0], p[3][1], width=p[2], lineno=p.lineno(3))\n p[0] = Decl( tuple(decllist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declassign_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 573 }, { "content": " def p_declassign_element(self, p):\n 'declassign_element : ID EQUALS rvalue'\n assign = Assign(Lvalue(Identifier(p[1], lineno=p.lineno(1)), lineno=p.lineno(1)),\n p[3], lineno=p.lineno(1))\n p[0] = (p[1], assign)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_declassign_element", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 579 }, { "content": " def p_declassign_element_delay(self, p):\n 'declassign_element : delays ID EQUALS delays rvalue'\n assign = Assign(Lvalue(Identifier(p[2], lineno=p.lineno(1)), lineno=p.lineno(2)),\n p[5], p[1], p[4], lineno=p.lineno(2))\n p[0] = (p[1], assign)\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_declassign_element_delay", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 586 }, { "content": " def p_integerdecl(self, p):\n 'integerdecl : INTEGER integernamelist SEMICOLON'\n intlist = [ Integer(r,\n Width(msb=IntConst('31', lineno=p.lineno(2)),\n lsb=IntConst('0', lineno=p.lineno(2)),\n lineno=p.lineno(2)),\n signed=True, lineno=p.lineno(2)) for r in p[2] ]\n p[0] = Decl( tuple(intlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_integerdecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 594 }, { "content": " def p_integerdecl_signed(self, p):\n 'integerdecl : INTEGER SIGNED integernamelist SEMICOLON'\n intlist = [ Integer(r,\n Width(msb=IntConst('31', lineno=p.lineno(3)),\n lsb=IntConst('0', lineno=p.lineno(3)),\n lineno=p.lineno(3)),\n signed=True, lineno=p.lineno(3)) for r in p[2] ]\n p[0] = Decl( tuple(intlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_integerdecl_signed", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 604 }, { "content": " def p_integernamelist(self, p):\n 'integernamelist : integernamelist COMMA integername'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_integernamelist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 614 }, { "content": " def p_integernamelist_one(self, p):\n 'integernamelist : integername'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_integernamelist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 619 }, { "content": " def p_integername(self, p):\n 'integername : ID'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_integername", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 624 }, { "content": " def p_realdecl(self, p):\n 'realdecl : REAL realnamelist SEMICOLON'\n reallist = [ Real(p[1],\n Width(msb=IntConst('31', lineno=p.lineno(2)),\n lsb=IntConst('0', lineno=p.lineno(2)),\n lineno=p.lineno(2)),\n lineno=p.lineno(2)) for r in p[2] ]\n p[0] = Decl( tuple(reallist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_realdecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 630 }, { "content": " def p_realnamelist(self, p):\n 'realnamelist : realnamelist COMMA realname'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_realnamelist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 640 }, { "content": " def p_realnamelist_one(self, p):\n 'realnamelist : realname'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_realnamelist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 645 }, { "content": " def p_realname(self, p):\n 'realname : ID'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_realname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 650 }, { "content": " def p_parameterdecl(self, p):\n 'parameterdecl : PARAMETER param_substitution_list SEMICOLON'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(2)) for rname, rvalue in p[2] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parameterdecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 656 }, { "content": " def p_parameterdecl_width(self, p):\n 'parameterdecl : PARAMETER width param_substitution_list SEMICOLON'\n paramlist = [ Parameter(rname, rvalue, p[2], lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parameterdecl_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 662 }, { "content": " def p_parameterdecl_integer(self, p):\n 'parameterdecl : PARAMETER INTEGER param_substitution_list SEMICOLON'\n paramlist = [ Parameter(rname, rvalue, lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parameterdecl_integer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 668 }, { "content": " def p_localparamdecl(self, p):\n 'localparamdecl : LOCALPARAM param_substitution_list SEMICOLON'\n paramlist = [ Localparam(rname, rvalue, lineno=p.lineno(2)) for rname, rvalue in p[2] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_localparamdecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 674 }, { "content": " def p_localparamdecl_width(self, p):\n 'localparamdecl : LOCALPARAM width param_substitution_list SEMICOLON'\n paramlist = [ Localparam(rname, rvalue, p[2], lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_localparamdecl_width", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 680 }, { "content": " def p_localparamdecl_integer(self, p):\n 'localparamdecl : LOCALPARAM INTEGER param_substitution_list SEMICOLON'\n paramlist = [ Localparam(rname, rvalue, lineno=p.lineno(3)) for rname, rvalue in p[3] ]\n p[0] = Decl( tuple(paramlist), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_localparamdecl_integer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 686 }, { "content": " def p_param_substitution_list(self, p):\n 'param_substitution_list : param_substitution_list COMMA param_substitution'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_substitution_list", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 692 }, { "content": " def p_param_substitution_list_one(self, p):\n 'param_substitution_list : param_substitution'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_substitution_list_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 697 }, { "content": " def p_param_substitution(self, p):\n 'param_substitution : ID EQUALS rvalue'\n p[0] = (p[1], p[3])\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_substitution", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 702 }, { "content": " def p_assignment(self, p):\n 'assignment : ASSIGN lvalue EQUALS rvalue SEMICOLON'\n p[0] = Assign(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_assignment", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 707 }, { "content": " def p_assignment_delay(self, p):\n 'assignment : ASSIGN delays lvalue EQUALS delays rvalue SEMICOLON'\n p[0] = Assign(p[3], p[6], p[2], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_assignment_delay", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 712 }, { "content": " def p_lpartselect_lpointer(self, p):\n 'lpartselect : pointer LBRACKET expression COLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect_lpointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 718 }, { "content": " def p_lpartselect_lpointer_plus(self, p):\n 'lpartselect : pointer LBRACKET expression PLUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Plus(p[3], p[5]), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect_lpointer_plus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 723 }, { "content": " def p_lpartselect_lpointer_minus(self, p):\n 'lpartselect : pointer LBRACKET expression MINUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Minus(p[3], p[5]), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect_lpointer_minus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 728 }, { "content": " def p_lpartselect(self, p):\n 'lpartselect : identifier LBRACKET expression COLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 733 }, { "content": " def p_lpartselect_plus(self, p):\n 'lpartselect : identifier LBRACKET expression PLUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Plus(p[3], p[5]), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect_plus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 738 }, { "content": " def p_lpartselect_minus(self, p):\n 'lpartselect : identifier LBRACKET expression MINUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Minus(p[3], p[5]), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpartselect_minus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 743 }, { "content": " def p_lpointer(self, p):\n 'lpointer : pointer'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lpointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 748 }, { "content": " def p_lconcat(self, p):\n 'lconcat : LBRACE lconcatlist RBRACE'\n p[0] = LConcat(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 753 }, { "content": " def p_lconcatlist(self, p):\n 'lconcatlist : lconcatlist COMMA lconcat_one'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcatlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 758 }, { "content": " def p_lconcatlist_one(self, p):\n 'lconcatlist : lconcat_one'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcatlist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 763 }, { "content": " def p_lconcat_one_identifier(self, p):\n 'lconcat_one : identifier'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcat_one_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 768 }, { "content": " def p_lconcat_one_lpartselect(self, p):\n 'lconcat_one : lpartselect'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcat_one_lpartselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 773 }, { "content": " def p_lconcat_one_lpointer(self, p):\n 'lconcat_one : lpointer'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcat_one_lpointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 778 }, { "content": " def p_lconcat_one_lconcat(self, p):\n 'lconcat_one : lconcat'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lconcat_one_lconcat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 783 }, { "content": " def p_lvalue_partselect(self, p):\n 'lvalue : lpartselect'\n p[0] = Lvalue( p[1], lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lvalue_partselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 788 }, { "content": " def p_lvalue_pointer(self, p):\n 'lvalue : lpointer'\n p[0] = Lvalue( p[1], lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lvalue_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 793 }, { "content": " def p_lvalue_concat(self, p):\n 'lvalue : lconcat'\n p[0] = Lvalue( p[1], lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lvalue_concat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 798 }, { "content": " def p_lvalue_one(self, p):\n 'lvalue : identifier'\n p[0] = Lvalue( p[1], lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_lvalue_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 803 }, { "content": " def p_rvalue(self, p):\n 'rvalue : expression'\n p[0] = Rvalue( p[1], lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_rvalue", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 808 }, { "content": " def p_expression_uminus(self, p):\n 'expression : MINUS expression %prec UMINUS'\n p[0] = Uminus(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uminus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 815 }, { "content": " def p_expression_uplus(self, p):\n 'expression : PLUS expression %prec UPLUS'\n p[0] = p[2]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uplus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 820 }, { "content": " def p_expression_ulnot(self, p):\n 'expression : LNOT expression %prec ULNOT'\n p[0] = Ulnot(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_ulnot", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 825 }, { "content": " def p_expression_unot(self, p):\n 'expression : NOT expression %prec UNOT'\n p[0] = Unot(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_unot", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 830 }, { "content": " def p_expression_uand(self, p):\n 'expression : AND expression %prec UAND'\n p[0] = Uand(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uand", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 835 }, { "content": " def p_expression_unand(self, p):\n 'expression : NAND expression %prec UNAND'\n p[0] = Unand(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_unand", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 840 }, { "content": " def p_expression_unor(self, p):\n 'expression : NOR expression %prec UNOR'\n p[0] = Unor(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_unor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 845 }, { "content": " def p_expression_uor(self, p):\n 'expression : OR expression %prec UOR'\n p[0] = Uor(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 850 }, { "content": " def p_expression_uxor(self, p):\n 'expression : XOR expression %prec UXOR'\n p[0] = Uxor(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uxor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 855 }, { "content": " def p_expression_uxnor(self, p):\n 'expression : XNOR expression %prec UXNOR'\n p[0] = Uxnor(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_uxnor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 860 }, { "content": " def p_expression_power(self, p):\n 'expression : expression POWER expression'\n p[0] = Power(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_power", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 867 }, { "content": " def p_expression_times(self, p):\n 'expression : expression TIMES expression'\n p[0] = Times(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_times", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 874 }, { "content": " def p_expression_div(self, p):\n 'expression : expression DIVIDE expression'\n p[0] = Divide(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_div", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 879 }, { "content": " def p_expression_mod(self, p):\n 'expression : expression MOD expression'\n p[0] = Mod(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_mod", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 884 }, { "content": " def p_expression_plus(self, p):\n 'expression : expression PLUS expression'\n p[0] = Plus(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_plus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 891 }, { "content": " def p_expression_minus(self, p):\n 'expression : expression MINUS expression'\n p[0] = Minus(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_minus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 896 }, { "content": " def p_expression_sll(self, p):\n 'expression : expression LSHIFT expression'\n p[0] = Sll(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_sll", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 903 }, { "content": " def p_expression_srl(self, p):\n 'expression : expression RSHIFT expression'\n p[0] = Srl(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_srl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 908 }, { "content": " def p_expression_sla(self, p):\n 'expression : expression LSHIFTA expression'\n p[0] = Sll(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_sla", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 913 }, { "content": " def p_expression_sra(self, p):\n 'expression : expression RSHIFTA expression'\n p[0] = Sra(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_sra", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 918 }, { "content": " def p_expression_lessthan(self, p):\n 'expression : expression LT expression'\n p[0] = LessThan(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_lessthan", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 925 }, { "content": " def p_expression_greaterthan(self, p):\n 'expression : expression GT expression'\n p[0] = GreaterThan(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_greaterthan", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 930 }, { "content": " def p_expression_lesseq(self, p):\n 'expression : expression LE expression'\n p[0] = LessEq(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_lesseq", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 935 }, { "content": " def p_expression_greatereq(self, p):\n 'expression : expression GE expression'\n p[0] = GreaterEq(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_greatereq", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 940 }, { "content": " def p_expression_eq(self, p):\n 'expression : expression EQ expression'\n p[0] = Eq(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_eq", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 947 }, { "content": " def p_expression_noteq(self, p):\n 'expression : expression NE expression'\n p[0] = NotEq(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_noteq", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 952 }, { "content": " def p_expression_eql(self, p):\n 'expression : expression EQL expression'\n p[0] = Eql(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_eql", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 957 }, { "content": " def p_expression_noteql(self, p):\n 'expression : expression NEL expression'\n p[0] = NotEql(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_noteql", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 962 }, { "content": " def p_expression_And(self, p):\n 'expression : expression AND expression'\n p[0] = And(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_And", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 969 }, { "content": " def p_expression_Xor(self, p):\n 'expression : expression XOR expression'\n p[0] = Xor(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_Xor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 974 }, { "content": " def p_expression_Xnor(self, p):\n 'expression : expression XNOR expression'\n p[0] = Xnor(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_Xnor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 979 }, { "content": " def p_expression_Or(self, p):\n 'expression : expression OR expression'\n p[0] = Or(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_Or", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 986 }, { "content": " def p_expression_land(self, p):\n 'expression : expression LAND expression'\n p[0] = Land(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_land", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 993 }, { "content": " def p_expression_lor(self, p):\n 'expression : expression LOR expression'\n p[0] = Lor(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_lor", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1000 }, { "content": " def p_expression_cond(self, p):\n 'expression : expression COND expression COLON expression'\n p[0] = Cond(p[1], p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_cond", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1007 }, { "content": " def p_expression_expr(self, p):\n 'expression : LPAREN expression RPAREN'\n p[0] = p[2]\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_expression_expr", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1013 }, { "content": " def p_expression_concat(self, p):\n 'expression : concat'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_concat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1019 }, { "content": " def p_expression_repeat(self, p):\n 'expression : repeat'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_repeat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1024 }, { "content": " def p_expression_partselect(self, p):\n 'expression : partselect'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_partselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1029 }, { "content": " def p_expression_pointer(self, p):\n 'expression : pointer'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1034 }, { "content": " def p_expression_functioncall(self, p):\n 'expression : functioncall'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_functioncall", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1039 }, { "content": " def p_expression_systemcall(self, p):\n 'expression : systemcall'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_systemcall", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1044 }, { "content": " def p_expression_id(self, p):\n 'expression : identifier'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_id", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1049 }, { "content": " def p_expression_const(self, p):\n 'expression : const_expression'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_expression_const", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1054 }, { "content": " def p_concat(self, p):\n 'concat : LBRACE concatlist RBRACE'\n p[0] = Concat(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_concat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1059 }, { "content": " def p_concatlist(self, p):\n 'concatlist : concatlist COMMA expression'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_concatlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1064 }, { "content": " def p_concatlist_one(self, p):\n 'concatlist : expression'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_concatlist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1069 }, { "content": " def p_repeat(self, p):\n 'repeat : LBRACE expression concat RBRACE'\n p[0] = Repeat(p[3], p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_repeat", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1074 }, { "content": " def p_partselect(self, p):\n 'partselect : identifier LBRACKET expression COLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1079 }, { "content": " def p_partselect_plus(self, p):\n 'partselect : identifier LBRACKET expression PLUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Plus(p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect_plus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1084 }, { "content": " def p_partselect_minus(self, p):\n 'partselect : identifier LBRACKET expression MINUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Minus(p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect_minus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1089 }, { "content": " def p_partselect_pointer(self, p):\n 'partselect : pointer LBRACKET expression COLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1094 }, { "content": " def p_partselect_pointer_plus(self, p):\n 'partselect : pointer LBRACKET expression PLUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Plus(p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect_pointer_plus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1099 }, { "content": " def p_partselect_pointer_minus(self, p):\n 'partselect : pointer LBRACKET expression MINUSCOLON expression RBRACKET'\n p[0] = Partselect(p[1], p[3], Minus(p[3], p[5], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_partselect_pointer_minus", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1104 }, { "content": " def p_pointer(self, p):\n 'pointer : identifier LBRACKET expression RBRACKET'\n p[0] = Pointer(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1109 }, { "content": " def p_pointer_pointer(self, p):\n 'pointer : pointer LBRACKET expression RBRACKET'\n p[0] = Pointer(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_pointer_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1114 }, { "content": " def p_const_expression_intnum(self, p):\n 'const_expression : intnumber'\n p[0] = IntConst(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_const_expression_intnum", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1120 }, { "content": " def p_const_expression_floatnum(self, p):\n 'const_expression : floatnumber'\n p[0] = FloatConst(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_const_expression_floatnum", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1125 }, { "content": " def p_const_expression_stringliteral(self, p):\n 'const_expression : stringliteral'\n p[0] = StringConst(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_const_expression_stringliteral", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1130 }, { "content": " def p_floatnumber(self, p):\n 'floatnumber : FLOATNUMBER'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_floatnumber", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1135 }, { "content": " def p_intnumber(self, p):\n \"\"\"intnumber : INTNUMBER_DEC\n | SIGNED_INTNUMBER_DEC\n | INTNUMBER_BIN\n | SIGNED_INTNUMBER_BIN\n | INTNUMBER_OCT\n | SIGNED_INTNUMBER_OCT\n | INTNUMBER_HEX\n | SIGNED_INTNUMBER_HEX\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_intnumber", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1140 }, { "content": " def p_stringliteral(self, p):\n 'stringliteral : STRING_LITERAL'\n p[0] = p[1][1:-1] # strip \\\" and \\\"\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_stringliteral", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1155 }, { "content": " def p_always(self, p):\n 'always : ALWAYS senslist always_statement'\n p[0] = Always(p[2], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_always", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1162 }, { "content": " def p_sens_egde_paren(self, p):\n 'senslist : AT LPAREN edgesigs RPAREN'\n p[0] = SensList(p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_egde_paren", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1167 }, { "content": " def p_posedgesig(self, p):\n 'edgesig : POSEDGE edgesig_base'\n p[0] = Sens(p[2], 'posedge', lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_posedgesig", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1172 }, { "content": " def p_negedgesig(self, p):\n 'edgesig : NEGEDGE edgesig_base'\n p[0] = Sens(p[2], 'negedge', lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_negedgesig", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1177 }, { "content": " def p_edgesig_base_identifier(self, p):\n 'edgesig_base : identifier'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_edgesig_base_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1182 }, { "content": " def p_edgesig_base_pointer(self, p):\n 'edgesig_base : pointer'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_edgesig_base_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1187 }, { "content": " def p_edgesigs(self, p):\n 'edgesigs : edgesigs SENS_OR edgesig'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_edgesigs", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1192 }, { "content": " def p_edgesigs_one(self, p):\n 'edgesigs : edgesig'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_edgesigs_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1197 }, { "content": " def p_sens_empty(self, p):\n 'senslist : empty'\n p[0] = SensList( (Sens(None, 'all', lineno=p.lineno(1)),), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1202 }, { "content": " def p_sens_level(self, p):\n 'senslist : AT levelsig'\n p[0] = SensList( (p[2],), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_level", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1207 }, { "content": " def p_sens_level_paren(self, p):\n 'senslist : AT LPAREN levelsigs RPAREN'\n p[0] = SensList(p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_level_paren", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1212 }, { "content": " def p_levelsig(self, p):\n 'levelsig : levelsig_base'\n p[0] = Sens(p[1], 'level', lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsig", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1217 }, { "content": " def p_levelsig_base_identifier(self, p):\n 'levelsig_base : identifier'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsig_base_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1222 }, { "content": " def p_levelsig_base_pointer(self, p):\n 'levelsig_base : pointer'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsig_base_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1227 }, { "content": " def p_levelsig_base_partselect(self, p):\n 'levelsig_base : partselect'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsig_base_partselect", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1232 }, { "content": " def p_levelsigs(self, p):\n 'levelsigs : levelsigs SENS_OR levelsig'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsigs", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1237 }, { "content": " def p_levelsigs_comma(self, p):\n 'levelsigs : levelsigs COMMA levelsig'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsigs_comma", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1242 }, { "content": " def p_levelsigs_one(self, p):\n 'levelsigs : levelsig'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_levelsigs_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1247 }, { "content": " def p_sens_all(self, p):\n 'senslist : AT TIMES'\n p[0] = SensList( (Sens(None, 'all', lineno=p.lineno(1)),), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_all", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1252 }, { "content": " def p_sens_all_paren(self, p):\n 'senslist : AT LPAREN TIMES RPAREN'\n p[0] = SensList( (Sens(None, 'all', lineno=p.lineno(1)),), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sens_all_paren", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1257 }, { "content": " def p_basic_statement(self, p):\n \"\"\"basic_statement : if_statement\n | case_statement\n | casex_statement\n | for_statement\n | while_statement\n | event_statement\n | wait_statement\n | forever_statement\n | block\n | namedblock\n | parallelblock\n | blocking_substitution\n | nonblocking_substitution\n | single_statement\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_basic_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1262 }, { "content": " def p_always_statement(self, p):\n 'always_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_always_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1281 }, { "content": " def p_blocking_substitution(self, p):\n 'blocking_substitution : delays lvalue EQUALS delays rvalue SEMICOLON'\n p[0] = BlockingSubstitution(p[2], p[5], p[1], p[4], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_blocking_substitution", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1287 }, { "content": " def p_blocking_substitution_base(self, p):\n 'blocking_substitution_base : delays lvalue EQUALS delays rvalue'\n p[0] = BlockingSubstitution(p[2], p[5], p[1], p[4], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_blocking_substitution_base", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1292 }, { "content": " def p_nonblocking_substitution(self, p):\n 'nonblocking_substitution : delays lvalue LE delays rvalue SEMICOLON'\n p[0] = NonblockingSubstitution(p[2], p[5], p[1], p[4], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_nonblocking_substitution", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1297 }, { "content": " def p_delays(self, p):\n 'delays : DELAY LPAREN expression RPAREN'\n p[0] = DelayStatement(p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_delays", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1303 }, { "content": " def p_delays_identifier(self, p):\n 'delays : DELAY identifier'\n p[0] = DelayStatement(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_delays_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1308 }, { "content": " def p_delays_intnumber(self, p):\n 'delays : DELAY intnumber'\n p[0] = DelayStatement(IntConst(p[2], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_delays_intnumber", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1313 }, { "content": " def p_delays_floatnumber(self, p):\n 'delays : DELAY floatnumber'\n p[0] = DelayStatement(FloatConst(p[2], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_delays_floatnumber", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1318 }, { "content": " def p_delays_empty(self, p):\n 'delays : empty'\n p[0] = None", "metadata": "root.VerilogParser.p_delays_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1323 }, { "content": " def p_block(self, p):\n 'block : BEGIN block_statements END'\n p[0] = Block(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_block", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1328 }, { "content": " def p_block_empty(self, p):\n 'block : BEGIN END'\n p[0] = Block((), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_block_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1333 }, { "content": " def p_block_statements(self, p):\n 'block_statements : block_statements block_statement'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_block_statements", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1338 }, { "content": " def p_block_statements_one(self, p):\n 'block_statements : block_statement'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_block_statements_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1343 }, { "content": " def p_block_statement(self, p):\n 'block_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_block_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1348 }, { "content": " def p_namedblock(self, p):\n 'namedblock : BEGIN COLON ID namedblock_statements END'\n p[0] = Block(p[4], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_namedblock", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1354 }, { "content": " def p_namedblock_empty(self, p):\n 'namedblock : BEGIN COLON ID END'\n p[0] = Block((), p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_namedblock_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1359 }, { "content": " def p_namedblock_statements(self, p):\n 'namedblock_statements : namedblock_statements namedblock_statement'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_namedblock_statements", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1364 }, { "content": " def p_namedblock_statements_one(self, p):\n 'namedblock_statements : namedblock_statement'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_namedblock_statements_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1369 }, { "content": " def p_namedblock_statement(self, p):\n \"\"\"namedblock_statement : basic_statement\n | decl\n | integerdecl\n | realdecl\n | parameterdecl\n | localparamdecl\n \"\"\"\n if isinstance(p[1], Decl):\n for r in p[1].list:\n if (not isinstance(r, Reg) and not isinstance(r, Wire) and\n not isinstance(r, Integer) and not isinstance(r, Real) and\n not isinstance(r, Parameter) and not isinstance(r, Localparam)):\n raise ParseError(\"Syntax Error\")\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_namedblock_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1374 }, { "content": " def p_parallelblock(self, p):\n 'parallelblock : FORK block_statements JOIN'\n p[0] = ParallelBlock(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parallelblock", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1392 }, { "content": " def p_parallelblock_empty(self, p):\n 'parallelblock : FORK JOIN'\n p[0] = ParallelBlock((), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parallelblock_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1397 }, { "content": " def p_if_statement(self, p):\n 'if_statement : IF LPAREN cond RPAREN true_statement ELSE else_statement'\n p[0] = IfStatement(p[3], p[5], p[7], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_if_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1403 }, { "content": " def p_if_statement_woelse(self, p):\n 'if_statement : IF LPAREN cond RPAREN true_statement'\n p[0] = IfStatement(p[3], p[5], None, lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_if_statement_woelse", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1408 }, { "content": " def p_if_statement_delay(self, p):\n 'if_statement : delays IF LPAREN cond RPAREN true_statement ELSE else_statement'\n p[0] = IfStatement(p[4], p[6], p[8], lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_if_statement_delay", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1413 }, { "content": " def p_if_statement_woelse_delay(self, p):\n 'if_statement : delays IF LPAREN cond RPAREN true_statement'\n p[0] = IfStatement(p[4], p[6], None, lineno=p.lineno(2))\n p.set_lineno(0, p.lineno(2))", "metadata": "root.VerilogParser.p_if_statement_woelse_delay", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1418 }, { "content": " def p_cond(self, p):\n 'cond : expression'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_cond", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1423 }, { "content": " def p_ifcontent_statement(self, p):\n 'ifcontent_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_ifcontent_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1428 }, { "content": " def p_true_statement(self, p):\n 'true_statement : ifcontent_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_true_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1433 }, { "content": " def p_else_statement(self, p):\n 'else_statement : ifcontent_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_else_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1438 }, { "content": " def p_for_statement(self, p):\n 'for_statement : FOR LPAREN forpre forcond forpost RPAREN forcontent_statement'\n p[0] = ForStatement(p[3], p[4], p[5], p[7], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_for_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1444 }, { "content": " def p_forpre(self, p):\n 'forpre : blocking_substitution'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forpre", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1449 }, { "content": " def p_forpre_empty(self, p):\n 'forpre : SEMICOLON'\n p[0] = None\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forpre_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1454 }, { "content": " def p_forcond(self, p):\n 'forcond : cond SEMICOLON'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forcond", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1459 }, { "content": " def p_forcond_empty(self, p):\n 'forcond : SEMICOLON'\n p[0] = None\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forcond_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1464 }, { "content": " def p_forpost(self, p):\n 'forpost : blocking_substitution_base'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forpost", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1469 }, { "content": " def p_forpost_empty(self, p):\n 'forpost : empty'\n p[0] = None", "metadata": "root.VerilogParser.p_forpost_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1474 }, { "content": " def p_forcontent_statement(self, p):\n 'forcontent_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forcontent_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1478 }, { "content": " def p_while_statement(self, p):\n 'while_statement : WHILE LPAREN cond RPAREN whilecontent_statement'\n p[0] = WhileStatement(p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_while_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1484 }, { "content": " def p_whilecontent_statement(self, p):\n 'whilecontent_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_whilecontent_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1489 }, { "content": " def p_case_statement(self, p):\n 'case_statement : CASE LPAREN case_comp RPAREN casecontent_statements ENDCASE'\n p[0] = CaseStatement(p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_case_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1495 }, { "content": " def p_casex_statement(self, p):\n 'casex_statement : CASEX LPAREN case_comp RPAREN casecontent_statements ENDCASE'\n p[0] = CasexStatement(p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casex_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1500 }, { "content": " def p_case_comp(self, p):\n 'case_comp : expression'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_case_comp", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1505 }, { "content": " def p_casecontent_statements(self, p):\n 'casecontent_statements : casecontent_statements casecontent_statement'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_statements", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1510 }, { "content": " def p_casecontent_statements_one(self, p):\n 'casecontent_statements : casecontent_statement'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_statements_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1515 }, { "content": " def p_casecontent_statement(self, p):\n 'casecontent_statement : casecontent_condition COLON basic_statement'\n p[0] = Case(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1520 }, { "content": " def p_casecontent_condition_single(self, p):\n 'casecontent_condition : casecontent_condition COMMA expression'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_condition_single", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1525 }, { "content": " def p_casecontent_condition_one(self, p):\n 'casecontent_condition : expression'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_condition_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1530 }, { "content": " def p_casecontent_statement_default(self, p):\n 'casecontent_statement : DEFAULT COLON basic_statement'\n p[0] = Case(None, p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_casecontent_statement_default", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1535 }, { "content": " def p_initial(self, p):\n 'initial : INITIAL initial_statement'\n p[0] = Initial(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_initial", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1541 }, { "content": " def p_initial_statement(self, p):\n 'initial_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_initial_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1546 }, { "content": " def p_event_statement(self, p):\n 'event_statement : senslist SEMICOLON'\n p[0] = EventStatement(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_event_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1552 }, { "content": " def p_wait_statement(self, p):\n 'wait_statement : WAIT LPAREN cond RPAREN waitcontent_statement'\n p[0] = WaitStatement(p[3], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_wait_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1558 }, { "content": " def p_waitcontent_statement(self, p):\n 'waitcontent_statement : basic_statement'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_waitcontent_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1563 }, { "content": " def p_waitcontent_statement_empty(self, p):\n 'waitcontent_statement : SEMICOLON'\n p[0] = None\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_waitcontent_statement_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1568 }, { "content": " def p_forever_statement(self, p):\n 'forever_statement : FOREVER basic_statement'\n p[0] = ForeverStatement(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_forever_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1574 }, { "content": " def p_instance(self, p):\n 'instance : ID parameterlist instance_bodylist SEMICOLON'\n instancelist = []\n for instance_name, instance_ports, instance_array in p[3]:\n instancelist.append( Instance(p[1], instance_name, instance_ports,\n p[2], instance_array, lineno=p.lineno(1)) )\n p[0] = InstanceList(p[1], p[2], tuple(instancelist), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1580 }, { "content": " def p_instance_or(self, p):\n 'instance : SENS_OR parameterlist instance_bodylist SEMICOLON'\n instancelist = []\n for instance_name, instance_ports, instance_array in p[3]:\n instancelist.append( Instance(p[1], instance_name, instance_ports,\n p[2], instance_array, lineno=p.lineno(1)) )\n p[0] = InstanceList(p[1], p[2], tuple(instancelist), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_or", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1589 }, { "content": " def p_instance_bodylist(self, p):\n 'instance_bodylist : instance_bodylist COMMA instance_body'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_bodylist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1598 }, { "content": " def p_instance_bodylist_one(self, p):\n 'instance_bodylist : instance_body'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_bodylist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1603 }, { "content": " def p_instance_body(self, p):\n 'instance_body : ID LPAREN instance_ports RPAREN'\n p[0] = (p[1], p[3], None)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_body", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1608 }, { "content": " def p_instance_body_array(self, p):\n 'instance_body : ID width LPAREN instance_ports RPAREN'\n p[0] = (p[1], p[4], p[2])\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_body_array", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1613 }, { "content": " def p_instance_noname(self, p):\n 'instance : ID instance_bodylist_noname SEMICOLON'\n instancelist = []\n for instance_name, instance_ports, instance_array in p[2]:\n instancelist.append( Instance(p[1], instance_name, instance_ports,\n (), instance_array, lineno=p.lineno(1)) )\n p[0] = InstanceList(p[1], (), tuple(instancelist), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1618 }, { "content": " def p_instance_or_noname(self, p):\n 'instance : SENS_OR instance_bodylist_noname SEMICOLON'\n instancelist = []\n for instance_name, instance_ports, instance_array in p[2]:\n instancelist.append( Instance(p[1], instance_name, instance_ports,\n (), instance_array, lineno=p.lineno(1)) )\n p[0] = InstanceList(p[1], (), tuple(instancelist), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_or_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1627 }, { "content": " def p_instance_bodylist_noname(self, p):\n 'instance_bodylist_noname : instance_bodylist_noname COMMA instance_body_noname'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_bodylist_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1636 }, { "content": " def p_instance_bodylist_one_noname(self, p):\n 'instance_bodylist_noname : instance_body_noname'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_bodylist_one_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1641 }, { "content": " def p_instance_body_noname(self, p):\n 'instance_body_noname : LPAREN instance_ports RPAREN'\n p[0] = ('', p[2], None)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_body_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1646 }, { "content": " def p_parameterlist(self, p):\n 'parameterlist : DELAY LPAREN param_args RPAREN'\n p[0] = p[3]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parameterlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1651 }, { "content": " def p_parameterlist_noname(self, p):\n 'parameterlist : DELAY LPAREN param_args_noname RPAREN'\n p[0] = p[3]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_parameterlist_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1656 }, { "content": " def p_parameterlist_empty(self, p):\n 'parameterlist : empty'\n p[0] = ()", "metadata": "root.VerilogParser.p_parameterlist_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1661 }, { "content": " def p_param_args_noname(self, p):\n 'param_args_noname : param_args_noname COMMA param_arg_noname'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_args_noname", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1665 }, { "content": " def p_param_args_noname_one(self, p):\n 'param_args_noname : param_arg_noname'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_args_noname_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1670 }, { "content": " def p_param_args(self, p):\n 'param_args : param_args COMMA param_arg'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_args", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1675 }, { "content": " def p_param_args_one(self, p):\n 'param_args : param_arg'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_args_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1680 }, { "content": " def p_param_arg_noname_exp(self, p):\n 'param_arg_noname : expression'\n p[0] = ParamArg(None, p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_arg_noname_exp", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1685 }, { "content": " def p_param_arg_exp(self, p):\n 'param_arg : DOT ID LPAREN expression RPAREN'\n p[0] = ParamArg(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_param_arg_exp", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1690 }, { "content": " def p_instance_ports(self, p):\n \"\"\"instance_ports : instance_ports_list\n | instance_ports_arg\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_ports", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1695 }, { "content": " def p_instance_ports_list(self, p):\n 'instance_ports_list : instance_ports_list COMMA instance_port_list'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_ports_list", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1702 }, { "content": " def p_instance_ports_list_one(self, p):\n 'instance_ports_list : instance_port_list'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_ports_list_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1707 }, { "content": " def p_instance_port_list(self, p):\n 'instance_port_list : expression'\n p[0] = PortArg(None, p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_port_list", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1712 }, { "content": " def p_instance_ports_arg(self, p):\n 'instance_ports_arg : instance_ports_arg COMMA instance_port_arg'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_ports_arg", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1717 }, { "content": " def p_instance_ports_arg_one(self, p):\n 'instance_ports_arg : instance_port_arg'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_ports_arg_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1722 }, { "content": " def p_instance_port_arg(self, p):\n 'instance_port_arg : DOT ID LPAREN identifier RPAREN'\n p[0] = PortArg(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_port_arg", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1727 }, { "content": " def p_instance_port_arg_exp(self, p):\n 'instance_port_arg : DOT ID LPAREN expression RPAREN'\n p[0] = PortArg(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_port_arg_exp", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1732 }, { "content": " def p_instance_port_arg_none(self, p):\n 'instance_port_arg : DOT ID LPAREN RPAREN'\n p[0] = PortArg(p[2], None, lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_instance_port_arg_none", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1737 }, { "content": " def p_genvardecl(self, p):\n 'genvardecl : GENVAR genvarlist SEMICOLON'\n p[0] = Decl(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_genvardecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1743 }, { "content": " def p_genvarlist(self, p):\n 'genvarlist : genvarlist COMMA genvar'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_genvarlist", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1748 }, { "content": " def p_genvarlist_one(self, p):\n 'genvarlist : genvar'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_genvarlist_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1753 }, { "content": " def p_genvar(self, p):\n 'genvar : ID'\n p[0] = Genvar(name=p[1],\n width=Width(msb=IntConst('31', lineno=p.lineno(1)),\n lsb=IntConst('0', lineno=p.lineno(1)),\n lineno=p.lineno(1)),\n lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_genvar", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1758 }, { "content": " def p_generate(self, p):\n 'generate : GENERATE generate_items ENDGENERATE'\n p[0] = GenerateStatement(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1767 }, { "content": " def p_generate_items_empty(self, p):\n 'generate_items : empty'\n p[0] = ()\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_items_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1772 }, { "content": " def p_generate_items(self, p):\n 'generate_items : generate_items generate_item'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_items", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1777 }, { "content": " def p_generate_items_one(self, p):\n 'generate_items : generate_item'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_items_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1782 }, { "content": " def p_generate_item(self, p):\n \"\"\"generate_item : standard_item\n | generate_if\n | generate_for\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_item", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1787 }, { "content": " def p_generate_block(self, p):\n 'generate_block : BEGIN generate_items END'\n p[0] = Block(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_block", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1795 }, { "content": " def p_generate_named_block(self, p):\n 'generate_block : BEGIN COLON ID generate_items END'\n p[0] = Block(p[4], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_named_block", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1800 }, { "content": " def p_generate_if(self, p):\n 'generate_if : IF LPAREN cond RPAREN gif_true_item ELSE gif_false_item'\n p[0] = IfStatement(p[3], p[5], p[7], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_if", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1805 }, { "content": " def p_generate_if_woelse(self, p):\n 'generate_if : IF LPAREN cond RPAREN gif_true_item'\n p[0] = IfStatement(p[3], p[5], None, lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_if_woelse", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1810 }, { "content": " def p_generate_if_true_item(self, p):\n \"\"\"gif_true_item : generate_item\n | generate_block\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_if_true_item", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1815 }, { "content": " def p_generate_if_false_item(self, p):\n \"\"\"gif_false_item : generate_item\n | generate_block\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_if_false_item", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1822 }, { "content": " def p_generate_for(self, p):\n 'generate_for : FOR LPAREN forpre forcond forpost RPAREN generate_forcontent'\n p[0] = ForStatement(p[3], p[4], p[5], p[7], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_for", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1829 }, { "content": " def p_generate_forcontent(self, p):\n \"\"\"generate_forcontent : generate_item\n | generate_block\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_generate_forcontent", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1834 }, { "content": " def p_systemcall_noargs(self, p):\n 'systemcall : DOLLER ID'\n p[0] = SystemCall(p[2], (), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_systemcall_noargs", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1842 }, { "content": " def p_systemcall(self, p):\n 'systemcall : DOLLER ID LPAREN sysargs RPAREN'\n p[0] = SystemCall(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_systemcall", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1847 }, { "content": " def p_systemcall_signed(self, p): # for $signed system task\n 'systemcall : DOLLER SIGNED LPAREN sysargs RPAREN'\n p[0] = SystemCall(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_systemcall_signed", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1852 }, { "content": " def p_sysargs(self, p):\n 'sysargs : sysargs COMMA sysarg'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sysargs", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1857 }, { "content": " def p_sysargs_one(self, p):\n 'sysargs : sysarg'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sysargs_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1862 }, { "content": " def p_sysargs_empty(self, p):\n 'sysargs : empty'\n p[0] = ()", "metadata": "root.VerilogParser.p_sysargs_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1867 }, { "content": " def p_sysarg(self, p):\n 'sysarg : expression'\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_sysarg", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1871 }, { "content": " def p_function(self, p):\n 'function : FUNCTION width ID SEMICOLON function_statement ENDFUNCTION'\n p[0] = Function(p[3], p[2], p[5], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_function", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1877 }, { "content": " def p_function_nowidth(self, p):\n 'function : FUNCTION ID SEMICOLON function_statement ENDFUNCTION'\n p[0] = Function(p[2],\n Width(IntConst('0', lineno=p.lineno(1)),\n IntConst('0', lineno=p.lineno(1)),\n lineno=p.lineno(1)),\n p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_function_nowidth", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1882 }, { "content": " def p_function_statement(self, p):\n 'function_statement : funcvardecls function_calc'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_function_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1891 }, { "content": " def p_funcvardecls(self, p):\n 'funcvardecls : funcvardecls funcvardecl'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_funcvardecls", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1896 }, { "content": " def p_funcvardecls_one(self, p):\n 'funcvardecls : funcvardecl'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_funcvardecls_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1901 }, { "content": " def p_funcvardecl(self, p):\n \"\"\"funcvardecl : decl\n | integerdecl\n \"\"\"\n if isinstance(p[1], Decl):\n for r in p[1].list:\n if (not isinstance(r, Input) and not isinstance(r, Reg) and\n not isinstance(r, Integer)):\n raise ParseError(\"Syntax Error\")\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_funcvardecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1906 }, { "content": " def p_function_calc(self, p):\n \"\"\"function_calc : blocking_substitution\n | if_statement\n | for_statement\n | while_statement\n | case_statement\n | casex_statement\n | block\n | namedblock\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_function_calc", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1918 }, { "content": " def p_functioncall(self, p):\n 'functioncall : identifier LPAREN func_args RPAREN'\n p[0] = FunctionCall(p[1], p[3], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_functioncall", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1931 }, { "content": " def p_func_args(self, p):\n 'func_args : func_args COMMA expression'\n p[0] = p[1] + (p[3],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_func_args", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1936 }, { "content": " def p_func_args_one(self, p):\n 'func_args : expression'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_func_args_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1941 }, { "content": " def p_func_args_empty(self, p):\n 'func_args : empty'\n p[0] = ()", "metadata": "root.VerilogParser.p_func_args_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1946 }, { "content": " def p_task(self, p):\n 'task : TASK ID SEMICOLON task_statement ENDTASK'\n p[0] = Task(p[2], p[4], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_task", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1951 }, { "content": " def p_task_statement(self, p):\n 'task_statement : taskvardecls task_calc'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_task_statement", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1956 }, { "content": " def p_taskvardecls(self, p):\n 'taskvardecls : taskvardecls taskvardecl'\n p[0] = p[1] + (p[2],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_taskvardecls", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1961 }, { "content": " def p_taskvardecls_one(self, p):\n 'taskvardecls : taskvardecl'\n p[0] = (p[1],)\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_taskvardecls_one", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1966 }, { "content": " def p_taskvardecls_empty(self, p):\n 'taskvardecls : empty'\n p[0] = ()", "metadata": "root.VerilogParser.p_taskvardecls_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1971 }, { "content": " def p_taskvardecl(self, p):\n \"\"\"taskvardecl : decl\n | integerdecl\n \"\"\"\n if isinstance(p[1], Decl):\n for r in p[1].list:\n if (not isinstance(r, Input) and not isinstance(r, Reg) and\n not isinstance(r, Integer)):\n raise ParseError(\"Syntax Error\")\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_taskvardecl", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1975 }, { "content": " def p_task_calc(self, p):\n \"\"\"task_calc : blocking_substitution\n | if_statement\n | for_statement\n | while_statement\n | case_statement\n | casex_statement\n | block\n | namedblock\n \"\"\"\n p[0] = p[1]\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_task_calc", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 1987 }, { "content": " def p_identifier(self, p):\n 'identifier : ID'\n p[0] = Identifier(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2001 }, { "content": " def p_scope_identifier(self, p):\n 'identifier : scope ID'\n p[0] = Identifier(p[2], p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_scope_identifier", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2006 }, { "content": " def p_scope(self, p):\n 'scope : identifier DOT'\n scope = () if p[1].scope is None else p[1].scope.labellist\n p[0] = IdentifierScope( scope + (IdentifierScopeLabel(p[1].name, lineno=p.lineno(1)),), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_scope", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2012 }, { "content": " def p_scope_pointer(self, p):\n 'scope : pointer DOT'\n scope = () if p[1].var.scope is None else p[1].var.scope.labellist\n p[0] = IdentifierScope( scope + (IdentifierScopeLabel(p[1].var.name, p[1].ptr, lineno=p.lineno(1)),), lineno=p.lineno(1) )\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_scope_pointer", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2018 }, { "content": " def p_disable(self, p):\n 'disable : DISABLE ID'\n p[0] = Disable(p[2], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_disable", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2025 }, { "content": " def p_single_statement_delays(self, p):\n 'single_statement : DELAY expression SEMICOLON'\n p[0] = SingleStatement(DelayStatement(p[2], lineno=p.lineno(1)), lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_single_statement_delays", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2031 }, { "content": " def p_single_statement_systemcall(self, p):\n 'single_statement : systemcall SEMICOLON'\n p[0] = SingleStatement(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_single_statement_systemcall", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2036 }, { "content": " def p_single_statement_disable(self, p):\n 'single_statement : disable SEMICOLON'\n p[0] = SingleStatement(p[1], lineno=p.lineno(1))\n p.set_lineno(0, p.lineno(1))", "metadata": "root.VerilogParser.p_single_statement_disable", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2041 }, { "content": " def p_empty(self, p):\n 'empty : '\n pass", "metadata": "root.VerilogParser.p_empty", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2063 }, { "content": " def p_error(self, p):\n print(\"Syntax error\")\n if p:\n self._parse_error(\n 'before: %s' % p.value,\n self._coord(p.lineno))\n else:\n self._parse_error('At end of input', '')", "metadata": "root.VerilogParser.p_error", "header": "['class', 'VerilogParser', '(', 'PLYParser', ')', ':', '___EOS___']", "index": 2068 }, { "content": "class VerilogCodeParser(object):\n\n\n", "metadata": "root.VerilogCodeParser", "header": "['module', '___EOS___']", "index": 2078 }, { "content": " def __init__(self, filelist, preprocess_output='preprocess.output',\n preprocess_include=None,\n preprocess_define=None):\n self.preprocess_output = preprocess_output\n self.directives = ()\n self.preprocessor = VerilogPreprocessor(filelist, preprocess_output,\n preprocess_include,\n preprocess_define)\n self.parser = VerilogParser()", "metadata": "root.VerilogCodeParser.__init__", "header": "['class', 'VerilogCodeParser', '(', 'object', ')', ':', '___EOS___']", "index": 2079 }, { "content": " def preprocess(self):\n self.preprocessor.preprocess()\n text = open(self.preprocess_output).read()\n os.remove(self.preprocess_output)\n return text", "metadata": "root.VerilogCodeParser.preprocess", "header": "['class', 'VerilogCodeParser', '(', 'object', ')', ':', '___EOS___']", "index": 2089 }, { "content": " def parse(self, preprocess_output='preprocess.output', debug=0):\n text = self.preprocess()\n ast = self.parser.parse(text, debug=debug)\n self.directives = self.parser.get_directives()\n return ast", "metadata": "root.VerilogCodeParser.parse", "header": "['class', 'VerilogCodeParser', '(', 'object', ')', ':', '___EOS___']", "index": 2095 }, { "content": " def get_directives(self):\n return self.directives", "metadata": "root.VerilogCodeParser.get_directives", "header": "['class', 'VerilogCodeParser', '(', 'object', ')', ':', '___EOS___']", "index": 2101 }, { "content": "def parse(filelist, preprocess_include=None, preprocess_define=None):\n codeparser = VerilogCodeParser(filelist,\n preprocess_include=preprocess_include,\n preprocess_define=preprocess_define)\n ast = codeparser.parse()\n directives = codeparser.get_directives()\n return ast, directives", "metadata": "root.parse", "header": "['module', '___EOS___']", "index": 2105 } ]
[ { "span": "import sys", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 10 }, { "span": "from pyverilog.vparser.plyparser import PLYParser, Coord, ParseError", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 68 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parser", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Veri", "log", " ", "Parser_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2013", ",", " ", "Shi", "nya", " ", "Tak", "ama", "eda", "-", "Ya", "ma", "za", "ki_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "Ap", "ache", " ", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Contributor", ":", " ", "ry", "osu", "ke", " ", "fu", "kata", "ni_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\u", "import_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "vpa", "rser_", "._", "ply_", "._", "yac", "c_", "import_", "yac", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "vpa", "rser_", "._", "ply", "parser_", "import_", "PL", "YP", "arser", "_", ",_", "Coord_", ",_", "Pars", "e", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "vpa", "rser_", "._", "preprocessor_", "import_", "Veri", "log", "Preprocessor", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "vpa", "rser_", "._", "lexer_", "import_", "Veri", "log", "Lexer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyv", "eri", "log_", "._", "vpa", "rser_", "._", "ast_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "Veri", "log", " ", "HD", "L", " ", "Parser", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Expression", " ", "Prec", "eden", "ce_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reference", ":", " ", "http", "://", "hp", ".", "vector", ".", "co", ".", "jp", "/", "author", "s", "/", "VA", "016", "670", "/", "veri", "log", "/", "index", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "preceden", "ce_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<-", " ", "Wea", "k_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "LO", "R", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "LAND", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "OR", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "AND", "'_", ",_", "'", "XO", "R", "'_", ",_", "'", "XN", "OR", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "EQ", "'_", ",_", "'", "NE", "'_", ",_", "'", "EQ", "L", "'_", ",_", "'", "NEL", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "LT", "'_", ",_", "'", "GT", "'_", ",_", "'", "LE", "'_", ",_", "'", "GE", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "LS", "HIFT", "'_", ",_", "'", "RS", "HIFT", "'_", ",_", "'", "LS", "HIFT", "A", "'_", ",_", "'", "RS", "HIFT", "A", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "PLUS", "'_", ",_", "'", "MINUS", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "TIMES", "'_", ",_", "'", "DIVI", "DE", "'_", ",_", "'", "MOD", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "left", "'_", ",_", "'", "POWER", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "right", "'_", ",_", "'", "UM", "IN", "US", "'_", ",_", "'", "UP", "LUS", "'_", ",_", "'", "UL", "NOT", "'_", ",_", "'", "UN", "OT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "UA", "ND", "'_", ",_", "'", "UNA", "ND", "'_", ",_", "'", "UO", "R", "'_", ",_", "'", "UN", "OR", "'_", ",_", "'", "UX", "OR", "'_", ",_", "'", "UX", "NOR", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Strong", "_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Return", "s", " ", "AST_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pars", "e", " ", "Rule", " ", "Definition_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Signal", " ", "Decl", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Decl", " ", "and", " ", "Assign_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Integer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Real_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Parameter_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "1", " ", "(", "Highe", "st", " ", "Prior", "it", "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\\uNL\\u\\u\\u_", "#", " ", "Leve", "l", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leve", "l", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "4_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "6_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "7_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "Leve", "l", " ", "9_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leve", "l", " ", "10_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leve", "l", " ", "11_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Leve", "l", " ", "12_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "#", " ", "String", " ", "Literal_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Al", "ways_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "fix", " ", "me", ":", " ", "to", " ", "support", " ", "task", "-", "call", "-", "statement_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "p", "\\u", "single", "\\u", "statem", "ent", "\\u", "task", "call", "(", "self", ",", " ", "p", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "single", "\\u", "statem", "ent", " ", ":", " ", "function", "call", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", "[", "0", "]", " ", "=", " ", "Sing", "le", "State", "ment", "(", "p", "[", "1", "],", " ", "linen", "o", "=", "p", ".", "linen", "o", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", ".", "set\\u", "linen", "o", "(", "0", ",", " ", "p", ".", "linen", "o", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "p", "\\u", "single", "\\u", "statem", "ent", "\\u", "task", "call", "\\u", "empty", "(", "self", ",", " ", "p", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "single", "\\u", "statem", "ent", " ", ":", " ", "task", "call", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", "[", "0", "]", " ", "=", " ", "Sing", "le", "State", "ment", "(", "p", "[", "1", "],", " ", "linen", "o", "=", "p", ".", "linen", "o", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", ".", "set\\u", "linen", "o", "(", "0", ",", " ", "p", ".", "linen", "o", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "p", "\\u", "task", "call", "\\u", "empty", "(", "self", ",", " ", "p", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "task", "call", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", "[", "0", "]", " ", "=", " ", "Function", "Call", "(", "p", "[", "1", "],", " ", "()", ",", " ", "linen", "o", "=", "p", ".", "linen", "o", "(", "1", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "p", ".", "set\\u", "linen", "o", "(", "0", ",", " ", "p", ".", "linen", "o", "(", "1", "))", "_", "\\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_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "lexer_", "=_", "Veri", "log", "Lexer_", "(_", "error", "\\u", "func_", "=_", "self_", "._", "\\u", "lexer", "\\u", "error", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lexer_", "._", "build_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "tokens_", "=_", "self_", "._", "lexer_", "._", "tokens_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "self", ".", "parser", " ", "=", " ", "yac", "c", "(", "module", "=", "self", ")_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Us", "e", " ", "this", " ", "if", " ", "you", " ", "want", " ", "to", " ", "build", " ", "the", " ", "parser", " ", "usi", "ng", " ", "LA", "LR", "(", "1", ")", " ", "inst", "ead", " ", "of", " ", "SL", "R_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "parser_", "=_", "yac", "c_", "(_", "module_", "=_", "self_", ",_", "method_", "=_", "\"", "LA", "LR", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "lexer", "\\u", "error", "\\u", "func_", "(_", "self_", ",_", "msg_", ",_", "line_", ",_", "column_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parse", "\\u", "error_", "(_", "msg_", ",_", "self_", "._", "\\u", "coord_", "(_", "line_", ",_", "column_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "directives_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "lexer_", "._", "get", "\\u", "directives_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "default", "\\u", "nett", "ype_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "lexer_", "._", "get", "\\u", "default", "\\u", "nett", "ype_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "text_", ",_", "debug_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parser_", "._", "parse_", "(_", "text_", ",_", "lexer_", "=_", "self_", "._", "lexer_", ",_", "debug_", "=_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "source", "\\u", "text_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "source", "\\u", "text", " ", ":", " ", "description", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Source_", "(_", "name_", "=_", "''_", ",_", "description_", "=_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "description_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "description", " ", ":", " ", "definit", "ion", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Description_", "(_", "definitions_", "=_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "definitions_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "definit", "ion", "s", " ", ":", " ", "definit", "ion", "s", " ", "definit", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "definit", "ion", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "definit", "ion", "s", " ", ":", " ", "definit", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "definition_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "definit", "ion", " ", ":", " ", "module", "def", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "definit", "ion", "\\u", "pragma", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "definit", "ion", " ", ":", " ", "pragma", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "pragma", "\\u", "assign_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "pragma", " ", ":", " ", "LPAR", "EN", " ", "TIMES", " ", "ID", " ", "EQUAL", "S", " ", "express", "ion", " ", "TIMES", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Pra", "gma", "_", "(_", "Pra", "gma", "Entry_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "pragma", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "pragma", " ", ":", " ", "LPAR", "EN", " ", "TIMES", " ", "ID", " ", "TIMES", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Pra", "gma", "_", "(_", "Pra", "gma", "Entry_", "(_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "module", "def_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "module", "def", " ", ":", " ", "MODUL", "E", " ", "modulename", " ", "param", "list", " ", "port", "list", " ", "items", " ", "END", "MODUL", "E", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Modul", "e", "Def_", "(_", "name_", "=_", "p_", "[_", "2_", "]_", ",_", "param", "list_", "=_", "p_", "[_", "3_", "]_", ",_", "port", "list_", "=_", "p_", "[_", "4_", "]_", ",_", "items_", "=_", "p_", "[_", "5_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "nett", "ype_", "=_", "self_", "._", "get", "\\u", "default", "\\u", "nett", "ype_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "modulename", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "modulename", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "modulename", "\\u", "or_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "modulename", " ", ":", " ", "SENS", "\\u", "OR", "'_", "#", " ", "or", " ", "primitive_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "list", " ", ":", " ", "DELAY", " ", "LPAR", "EN", " ", "params", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Param", "list_", "(_", "params_", "=_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "list", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "list", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Param", "list_", "(_", "params_", "=_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "params_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "params", " ", ":", " ", "params", "\\u", "begin", " ", "param", "\\u", "end", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "params", "\\u", "begin_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "params", "\\u", "begin", " ", ":", " ", "params", "\\u", "begin", " ", "param", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "params", "\\u", "begin", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "params", "\\u", "begin", " ", ":", " ", "param", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "params", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "params", " ", ":", " ", "param", "\\u", "end", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", " ", ":", " ", "PARAMETER", " ", "param", "\\u", "substitution", "\\u", "list", " ", "COMMA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", " ", ":", " ", "PARAMETER", " ", "widt", "h", " ", "param", "\\u", "substitution", "\\u", "list", " ", "COMMA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "integer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", " ", ":", " ", "PARAMETER", " ", "INTEG", "ER", " ", "param", "\\u", "substitution", "\\u", "list", " ", "COMMA", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "end_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "end", " ", ":", " ", "PARAMETER", " ", "param", "\\u", "substitution", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "end", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "end", " ", ":", " ", "PARAMETER", " ", "widt", "h", " ", "param", "\\u", "substitution", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "end", "\\u", "integer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "end", " ", ":", " ", "PARAMETER", " ", "INTEG", "ER", " ", "param", "\\u", "substitution", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "list", " ", ":", " ", "LPAR", "EN", " ", "port", "s", " ", "RPA", "REN", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "list_", "(_", "ports_", "=_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "list", "\\u", "io_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "list", " ", ":", " ", "LPAR", "EN", " ", "iop", "orts", " ", "RPA", "REN", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "list_", "(_", "ports_", "=_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "list", "\\u", "paren", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "list", " ", ":", " ", "LPAR", "EN", " ", "RPA", "REN", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "list_", "(_", "ports_", "=_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "list", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "list", " ", ":", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "list_", "(_", "ports_", "=_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "ports_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "s", " ", ":", " ", "port", "s", " ", "COMMA", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "Port_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "wid_", ",_", "type_", "=_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "port_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "s", " ", ":", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wid_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "port_", "=_", "Port_", "(_", "name_", "=_", "p_", "[_", "1_", "]_", ",_", "width_", "=_", "wid_", ",_", "type_", "=_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "port_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "port", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "port", "name", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "types_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "types", " ", ":", " ", "sig", "types", " ", "sig", "type", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "types", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "types", " ", ":", " ", "sig", "type", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "input_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "INPUT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "output_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "OUTPU", "T", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "inou", "t_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "IN", "OUT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "tri_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "TRI", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "reg_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "REG", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "wire_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "WIRE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "signed_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "SIGN", "ED", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "supply", "0_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "SUP", "PL", "Y", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sig", "type", "\\u", "supply", "1_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sig", "type", " ", ":", " ", "SUP", "PL", "Y", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "orts", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "orts", " ", ":", " ", "iop", "orts", " ", "COMMA", " ", "iop", "ort", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "p_", "[_", "3_", "]_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", "in_", "reversed_", "(_", "p_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "r_", "._", "first_", ",_", "Input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "Io", "port_", "(_", "Input_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "r_", "._", "first_", "._", "width_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "r_", "._", "first_", ",_", "Output_", ")_", "and_", "r_", "._", "second_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "Io", "port_", "(_", "Output_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "r_", "._", "first_", "._", "width_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "r_", "._", "first_", ",_", "Output_", ")_", "and_", "isinstance_", "(_", "r_", "._", "second_", ",_", "Reg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "Io", "port_", "(_", "Output_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "r_", "._", "first_", "._", "width_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Reg_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "r_", "._", "first_", "._", "width_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "r_", "._", "first_", ",_", "In", "out_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "t_", "=_", "Io", "port_", "(_", "In", "out_", "(_", "name_", "=_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "r_", "._", "first_", "._", "width_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\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_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "t_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "orts", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "orts", " ", ":", " ", "iop", "ort", "\\u", "head", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "iop", "ort_", "(_", "self_", ",_", "sig", "types_", ",_", "name_", ",_", "width_", "=_", "None_", ",_", "lineno_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "typecheck", "\\u", "iop", "ort_", "(_", "sig", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "second_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "sign", "ed", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first_", "=_", "Input_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first_", "=_", "Output_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "first_", "=_", "In", "out_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "wire", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second_", "=_", "Wire", "_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second_", "=_", "Reg_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "second_", "=_", "Tri", "_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Io", "port_", "(_", "first_", ",_", "second_", ",_", "lineno_", "=_", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "typecheck", "\\u", "iop", "ort_", "(_", "self_", ",_", "sig", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "input", "'_", "not_", "in_", "sig", "types_", "and_", "'", "output", "'_", "not_", "in_", "sig", "types_", "and_", "'", "inou", "t", "'_", "not_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "output", "'_", "in_", "sig", "types_", "and_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "ort_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "ort", " ", ":", " ", "sig", "types", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "self_", "._", "create", "\\u", "iop", "ort_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "ort", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "ort", " ", ":", " ", "sig", "types", " ", "widt", "h", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "self_", "._", "create", "\\u", "iop", "ort_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "ort", "\\u", "head_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "ort", "\\u", "head", " ", ":", " ", "sig", "types", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "self_", "._", "create", "\\u", "iop", "ort_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "ort", "\\u", "head", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "ort", "\\u", "head", " ", ":", " ", "sig", "types", " ", "widt", "h", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "self_", "._", "create", "\\u", "iop", "ort_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "width_", "=_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "iop", "ort", "\\u", "port", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "iop", "ort", " ", ":", " ", "port", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "widt", "h", " ", ":", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Width_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "length_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "length", " ", ":", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Length_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "items_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "items", " ", ":", " ", "items", " ", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "items", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "items", " ", ":", " ", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "items", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "items", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "item_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "item", " ", ":", " ", "standard", "\\u", "item", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "standard", "\\u", "item_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "standard", "\\u", "item", " ", ":", " ", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "integ", "erd", "ecl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "real", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "decl", "assign", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "parameter", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "localpa", "ram", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "gen", "vard", "ecl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "assign", "ment", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "alw", "ay", "s", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "initial", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "function", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "task", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "pragma", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "decl_", "(_", "self_", ",_", "sig", "types_", ",_", "name_", ",_", "width_", "=_", "None_", ",_", "length_", "=_", "None_", ",_", "lineno_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "typecheck", "\\u", "decl_", "(_", "sig", "types_", ",_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "sign", "ed", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Input_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Output_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "In", "out_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "wire", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Wire", "Array_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signed_", "=_", "signed_", ",_", "length_", "=_", "length_", ",_", "lineno_", "=_", "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 ", " _", "decl", "s_", "._", "append_", "(_", "Wire", "_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "length_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Reg", "Array_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signed_", "=_", "signed_", ",_", "length_", "=_", "length_", ",_", "lineno_", "=_", "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 ", " _", "decl", "s_", "._", "append_", "(_", "Reg_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Tri", "_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "supply", "0", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Suppl", "y_", "(_", "name_", "=_", "name_", ",_", "value_", "=_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "lineno_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "supply", "1", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Suppl", "y_", "(_", "name_", "=_", "name_", ",_", "value_", "=_", "Int", "Const_", "(_", "'", "1", "'_", ",_", "lineno_", "=_", "lineno_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "decl", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "typecheck", "\\u", "decl_", "(_", "self_", ",_", "sig", "types_", ",_", "length_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "length_", "and_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "length_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "length_", "and_", "'", "inou", "t", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "sig", "types_", ")_", "==_", "1_", "and_", "'", "sign", "ed", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "output", "'_", "in_", "sig", "types_", "and_", "'", "tri", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", " ", ":", " ", "sig", "types", " ", "decl", "namel", "ist", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rname_", ",_", "rle", "ngt", "h_", "in_", "p_", "[_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "list_", "._", "extend_", "(_", "self_", "._", "create", "\\u", "decl_", "(_", "p_", "[_", "1_", "]_", ",_", "rname_", ",_", "length_", "=_", "rle", "ngt", "h_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "decl", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", " ", ":", " ", "sig", "types", " ", "widt", "h", " ", "decl", "namel", "ist", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "rname_", ",_", "rle", "ngt", "h_", "in_", "p_", "[_", "3_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "list_", "._", "extend_", "(_", "self_", "._", "create", "\\u", "decl_", "(_", "p_", "[_", "1_", "]_", ",_", "rname_", ",_", "width_", "=_", "p_", "[_", "2_", "]_", ",_", "length_", "=_", "rle", "ngt", "h_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "decl", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "namelist_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "namel", "ist", " ", ":", " ", "decl", "namel", "ist", " ", "COMMA", " ", "decl", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "namel", "ist", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "namel", "ist", " ", ":", " ", "decl", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "name", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "declar", "ray_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "name", " ", ":", " ", "ID", " ", "length", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "decl", "assign_", "(_", "self_", ",_", "sig", "types_", ",_", "name_", ",_", "assign_", ",_", "width_", "=_", "None_", ",_", "lineno_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "typecheck", "\\u", "decl", "assign_", "(_", "sig", "types_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "s_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "sign", "ed", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "signed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Input_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Output_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "In", "out_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "wire", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Wire", "_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "decl", "s_", "._", "append_", "(_", "Reg_", "(_", "name_", "=_", "name_", ",_", "width_", "=_", "width_", ",_", "signed_", "=_", "signed_", ",_", "lineno_", "=_", "lineno_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "decl", "s_", "._", "append_", "(_", "assign_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "decl", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "typecheck", "\\u", "decl", "assign_", "(_", "self_", ",_", "sig", "types_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "sig", "types_", ")_", "==_", "1_", "and_", "'", "sign", "ed", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "reg", "'_", "not_", "in_", "sig", "types_", "and_", "'", "wire", "'_", "not_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "output", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "input", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "input", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "inou", "t", "'_", "in_", "sig", "types_", "and_", "'", "reg", "'_", "in_", "sig", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "supply", "0", "'_", "in_", "sig", "types_", "and_", "len_", "(_", "sig", "types_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "supply", "1", "'_", "in_", "sig", "types_", "and_", "len_", "(_", "sig", "types_", ")_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "assign_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "assign", " ", ":", " ", "sig", "types", " ", "decl", "assign", "\\u", "element", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "list_", "=_", "self_", "._", "create", "\\u", "decl", "assign_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", "[_", "0_", "]_", ",_", "p_", "[_", "2_", "]_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "decl", "list_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "assign", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "assign", " ", ":", " ", "sig", "types", " ", "widt", "h", " ", "decl", "assign", "\\u", "element", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "decl", "list_", "=_", "self_", "._", "create", "\\u", "decl", "assign_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", "[_", "0_", "]_", ",_", "p_", "[_", "3_", "]_", "[_", "1_", "]_", ",_", "width_", "=_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "decl", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "assign", "\\u", "element_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "assign", "\\u", "element", " ", ":", " ", "ID", " ", "EQUAL", "S", " ", "rval", "ue", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assign_", "=_", "Assign_", "(_", "Lv", "alue_", "(_", "Identifier_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "assign_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "decl", "assign", "\\u", "element", "\\u", "delay_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "decl", "assign", "\\u", "element", " ", ":", " ", "delays", " ", "ID", " ", "EQUAL", "S", " ", "delays", " ", "rval", "ue", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assign_", "=_", "Assign_", "(_", "Lv", "alue_", "(_", "Identifier_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "assign_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "integ", "erd", "ecl", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "integ", "erd", "ecl", " ", ":", " ", "INTEG", "ER", " ", "integ", "erna", "mel", "ist", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intl", "ist_", "=_", "[_", "Integer_", "(_", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Width_", "(_", "msb", "_", "=_", "Int", "Const_", "(_", "'", "3", "1", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lsb", "_", "=_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signed_", "=_", "True_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "r_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "intl", "ist_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "integ", "erd", "ecl", "\\u", "signed_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "integ", "erd", "ecl", " ", ":", " ", "INTEG", "ER", " ", "SIGN", "ED", " ", "integ", "erna", "mel", "ist", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "intl", "ist_", "=_", "[_", "Integer_", "(_", "r_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Width_", "(_", "msb", "_", "=_", "Int", "Const_", "(_", "'", "3", "1", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lsb", "_", "=_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "signed_", "=_", "True_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "r_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "intl", "ist_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "integ", "erna", "mel", "ist_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "integ", "erna", "mel", "ist", " ", ":", " ", "integ", "erna", "mel", "ist", " ", "COMMA", " ", "integ", "erna", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "integ", "erna", "mel", "ist", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "integ", "erna", "mel", "ist", " ", ":", " ", "integ", "erna", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "integ", "erna", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "integ", "erna", "me", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "real", "decl_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "real", "decl", " ", ":", " ", "REAL", " ", "real", "namel", "ist", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reall", "ist_", "=_", "[_", "Real_", "(_", "p_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Width_", "(_", "msb", "_", "=_", "Int", "Const_", "(_", "'", "3", "1", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lsb", "_", "=_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "r_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "reall", "ist_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "real", "namelist_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "real", "namel", "ist", " ", ":", " ", "real", "namel", "ist", " ", "COMMA", " ", "real", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "real", "namel", "ist", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "real", "namel", "ist", " ", ":", " ", "real", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "real", "name_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "real", "name", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "decl_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "decl", " ", ":", " ", "PARAMETER", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "decl", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "decl", " ", ":", " ", "PARAMETER", " ", "widt", "h", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "decl", "\\u", "integer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "decl", " ", ":", " ", "PARAMETER", " ", "INTEG", "ER", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Parameter_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "localpa", "ram", "decl_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "localpa", "ram", "decl", " ", ":", " ", "LOCAL", "PARAM", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Local", "param_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "2_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "localpa", "ram", "decl", "\\u", "width_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "localpa", "ram", "decl", " ", ":", " ", "LOCAL", "PARAM", " ", "widt", "h", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Local", "param_", "(_", "rname_", ",_", "rval", "ue_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "localpa", "ram", "decl", "\\u", "integer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "localpa", "ram", "decl", " ", ":", " ", "LOCAL", "PARAM", " ", "INTEG", "ER", " ", "param", "\\u", "substitution", "\\u", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "param", "list_", "=_", "[_", "Local", "param_", "(_", "rname_", ",_", "rval", "ue_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "3_", ")_", ")_", "for_", "rname_", ",_", "rval", "ue_", "in_", "p_", "[_", "3_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "tuple_", "(_", "param", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "substitution", "\\u", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "substitution", "\\u", "list", " ", ":", " ", "param", "\\u", "substitution", "\\u", "list", " ", "COMMA", " ", "param", "\\u", "substitution", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "substitution", "\\u", "list", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "substitution", "\\u", "list", " ", ":", " ", "param", "\\u", "substitution", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "substitution", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "substitution", " ", ":", " ", "ID", " ", "EQUAL", "S", " ", "rval", "ue", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "assignment_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "assign", "ment", " ", ":", " ", "ASSIGN", " ", "lval", "ue", " ", "EQUAL", "S", " ", "rval", "ue", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Assign_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "assign", "ment", "\\u", "delay_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "assign", "ment", " ", ":", " ", "ASSIGN", " ", "delays", " ", "lval", "ue", " ", "EQUAL", "S", " ", "delays", " ", "rval", "ue", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Assign_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "6_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "\\u", "lpo", "inter_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "\\u", "lpo", "inter", "\\u", "plus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "PLUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Plus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "\\u", "lpo", "inter", "\\u", "minus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "MINUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Minus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "\\u", "plus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "PLUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Plus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpar", "tse", "lect", "\\u", "minus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpar", "tse", "lect", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "MINUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Minus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lpo", "inter_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lpo", "inter", " ", ":", " ", "point", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "t_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "t", " ", ":", " ", "LB", "RACE", " ", "lco", "nca", "tli", "st", " ", "RB", "RACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "LC", "onc", "at_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "tlist_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "tli", "st", " ", ":", " ", "lco", "nca", "tli", "st", " ", "COMMA", " ", "lco", "nca", "t", "\\u", "one", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "tli", "st", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "tli", "st", " ", ":", " ", "lco", "nca", "t", "\\u", "one", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "t", "\\u", "one", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "t", "\\u", "one", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "t", "\\u", "one", "\\u", "lpar", "tse", "lect", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "t", "\\u", "one", " ", ":", " ", "lpar", "tse", "lect", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "t", "\\u", "one", "\\u", "lpo", "inter_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "t", "\\u", "one", " ", ":", " ", "lpo", "inter", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lco", "nca", "t", "\\u", "one", "\\u", "lco", "nca", "t_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lco", "nca", "t", "\\u", "one", " ", ":", " ", "lco", "nca", "t", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lval", "ue", "\\u", "part", "select_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lval", "ue", " ", ":", " ", "lpar", "tse", "lect", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Lv", "alue_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lval", "ue", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lval", "ue", " ", ":", " ", "lpo", "inter", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Lv", "alue_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lval", "ue", "\\u", "concat_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lval", "ue", " ", ":", " ", "lco", "nca", "t", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Lv", "alue_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "lval", "ue", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "lval", "ue", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Lv", "alue_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "rval", "ue_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "rval", "ue", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Rv", "alue_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "umi", "nus", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "MINUS", " ", "express", "ion", " ", "%", "prec", " ", "UM", "IN", "US", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Um", "inu", "s_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "up", "lus", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "PLUS", " ", "express", "ion", " ", "%", "prec", " ", "UP", "LUS", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "ul", "not_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "LN", "OT", " ", "express", "ion", " ", "%", "prec", " ", "UL", "NOT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Ul", "not_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "uno", "t_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "NOT", " ", "express", "ion", " ", "%", "prec", " ", "UN", "OT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Uno", "t_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "uan", "d_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "AND", " ", "express", "ion", " ", "%", "prec", " ", "UA", "ND", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Ua", "nd_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "una", "nd_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "NAN", "D", " ", "express", "ion", " ", "%", "prec", " ", "UNA", "ND", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Una", "nd_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "uno", "r_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "NOR", " ", "express", "ion", " ", "%", "prec", " ", "UN", "OR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Uno", "r_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "uo", "r_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "OR", " ", "express", "ion", " ", "%", "prec", " ", "UO", "R", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "U", "or_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "ux", "or_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "XO", "R", " ", "express", "ion", " ", "%", "prec", " ", "UX", "OR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "U", "xor_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "ux", "nor", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "XN", "OR", " ", "express", "ion", " ", "%", "prec", " ", "UX", "NOR", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "U", "xn", "or_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "power_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "POWER", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Power_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "times_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "TIMES", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Times_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "div_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "DIVI", "DE", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Divide", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "mod_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "MOD", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Mod_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "plus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "PLUS", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Plus", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "minus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "MINUS", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Minus", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "sl", "l_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LS", "HIFT", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sl", "l_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "sr", "l_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "RS", "HIFT", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sr", "l_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "sla", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LS", "HIFT", "A", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sl", "l_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "sra", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "RS", "HIFT", "A", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sr", "a_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "less", "than_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LT", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Less", "Than", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "great", "ert", "han", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "GT", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Great", "er", "Than", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "less", "eq_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LE", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Less", "Eq_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "great", "ere", "q_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "GE", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Great", "er", "Eq_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "eq_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "EQ", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Eq_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "note", "q_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "NE", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Not", "Eq_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "eq", "l_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "EQ", "L", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Eq", "l_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "note", "ql_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "NEL", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Not", "Eq", "l_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "And_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "AND", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "And_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "Xo", "r_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "XO", "R", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Xo", "r_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "Xn", "or_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "XN", "OR", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Xn", "or_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "Or_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "OR", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Or_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "land", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LAND", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Land", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "lor_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "LO", "R", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Lor", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "cond_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "express", "ion", " ", "COND", " ", "express", "ion", " ", "COLON", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Cond", "_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "expr_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "LPAR", "EN", " ", "express", "ion", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "concat_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "conc", "at", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "repeat_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "repeat", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "part", "select_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "part", "select", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "point", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "function", "call_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "function", "call", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "system", "call_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "system", "call", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "id_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "express", "ion", "\\u", "const_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "express", "ion", " ", ":", " ", "const", "\\u", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "concat_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "conc", "at", " ", ":", " ", "LB", "RACE", " ", "conc", "atl", "ist", " ", "RB", "RACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Concat", "_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "conc", "atl", "ist_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "conc", "atl", "ist", " ", ":", " ", "conc", "atl", "ist", " ", "COMMA", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "conc", "atl", "ist", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "conc", "atl", "ist", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "repeat_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "repeat", " ", ":", " ", "LB", "RACE", " ", "express", "ion", " ", "conc", "at", " ", "RB", "RACE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Repeat", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select", "\\u", "plus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "PLUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Plus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select", "\\u", "minus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "MINUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Minus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select", "\\u", "point", "er", "\\u", "plus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "PLUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Plus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "part", "select", "\\u", "point", "er", "\\u", "minus_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "part", "select", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "MINUS", "COLON", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Part", "select_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "Minus", "_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "point", "er", " ", ":", " ", "identifi", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Pointer_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "point", "er", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "point", "er", " ", ":", " ", "point", "er", " ", "LB", "RACK", "ET", " ", "express", "ion", " ", "RB", "RACK", "ET", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Pointer_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "const", "\\u", "express", "ion", "\\u", "int", "num_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "const", "\\u", "express", "ion", " ", ":", " ", "int", "number", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Int", "Const_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "const", "\\u", "express", "ion", "\\u", "float", "num_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "const", "\\u", "express", "ion", " ", ":", " ", "float", "number", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Float", "Const_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "const", "\\u", "express", "ion", "\\u", "string", "literal_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "const", "\\u", "express", "ion", " ", ":", " ", "string", "literal", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "String", "Const_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "float", "number_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "float", "number", " ", ":", " ", "FLOAT", "NUMB", "ER", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "int", "number_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "int", "number", " ", ":", " ", "INT", "NUMB", "ER", "\\u", "DEC", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "SIGN", "ED", "\\u", "INT", "NUMB", "ER", "\\u", "DEC", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "INT", "NUMB", "ER", "\\u", "BIN", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "SIGN", "ED", "\\u", "INT", "NUMB", "ER", "\\u", "BIN", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "INT", "NUMB", "ER", "\\u", "OCT", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "SIGN", "ED", "\\u", "INT", "NUMB", "ER", "\\u", "OCT", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "INT", "NUMB", "ER", "\\u", "HEX", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "SIGN", "ED", "\\u", "INT", "NUMB", "ER", "\\u", "HEX", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "string", "literal_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "string", "literal", " ", ":", " ", "STRING", "\\u", "LITERA", "L", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "[_", "1_", ":_", "-_", "1_", "]_", "#", " ", "strip", " ", "\\\\\"", " ", "and", " ", "\\\\\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "alw", "ays_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "alw", "ay", "s", " ", ":", " ", "ALWAYS", " ", "sens", "list", " ", "alw", "ay", "s", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Al", "ways_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "eg", "de", "\\u", "paren", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "AT", " ", "LPAR", "EN", " ", "edge", "sig", "s", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "pose", "dge", "sig_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", " ", ":", " ", "POS", "EDGE", " ", "edge", "sig", "\\u", "base", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s_", "(_", "p_", "[_", "2_", "]_", ",_", "'", "pose", "dge", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "neg", "edge", "sig_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", " ", ":", " ", "NEG", "EDGE", " ", "edge", "sig", "\\u", "base", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s_", "(_", "p_", "[_", "2_", "]_", ",_", "'", "neg", "edge", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "edge", "sig", "\\u", "base", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", "\\u", "base", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "edge", "sig", "\\u", "base", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", "\\u", "base", " ", ":", " ", "point", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "edge", "sigs_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", "s", " ", ":", " ", "edge", "sig", "s", " ", "SENS", "\\u", "OR", " ", "edge", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "edge", "sig", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "edge", "sig", "s", " ", ":", " ", "edge", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "(_", "Sen", "s_", "(_", "None_", ",_", "'", "all", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "level_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "AT", " ", "level", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "level", "\\u", "paren", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "AT", " ", "LPAR", "EN", " ", "level", "sig", "s", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", " ", ":", " ", "level", "sig", "\\u", "base", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s_", "(_", "p_", "[_", "1_", "]_", ",_", "'", "level", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig", "\\u", "base", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "\\u", "base", " ", ":", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig", "\\u", "base", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "\\u", "base", " ", ":", " ", "point", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig", "\\u", "base", "\\u", "part", "select_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "\\u", "base", " ", ":", " ", "part", "select", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sigs_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "s", " ", ":", " ", "level", "sig", "s", " ", "SENS", "\\u", "OR", " ", "level", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig", "s", "\\u", "comma_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "s", " ", ":", " ", "level", "sig", "s", " ", "COMMA", " ", "level", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "level", "sig", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "level", "sig", "s", " ", ":", " ", "level", "sig", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "all_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "AT", " ", "TIMES", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "(_", "Sen", "s_", "(_", "None_", ",_", "'", "all", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sens", "\\u", "all", "\\u", "paren", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sens", "list", " ", ":", " ", "AT", " ", "LPAR", "EN", " ", "TIMES", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sen", "s", "List_", "(_", "(_", "Sen", "s_", "(_", "None_", ",_", "'", "all", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "basic", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "basic", "\\u", "statem", "ent", " ", ":", " ", "if", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "x", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "for", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "whi", "le", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "event", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "wait", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "forever", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "named", "block", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "parall", "elb", "lock", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "blockin", "g", "\\u", "substitution", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "nonb", "locking", "\\u", "substitution", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "single", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "alw", "ay", "s", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "alw", "ay", "s", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "blockin", "g", "\\u", "substitution", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "blockin", "g", "\\u", "substitution", " ", ":", " ", "delays", " ", "lval", "ue", " ", "EQUAL", "S", " ", "delays", " ", "rval", "ue", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block", "ing", "Substituti", "on_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "blockin", "g", "\\u", "substitution", "\\u", "base_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "blockin", "g", "\\u", "substitution", "\\u", "base", " ", ":", " ", "delays", " ", "lval", "ue", " ", "EQUAL", "S", " ", "delays", " ", "rval", "ue", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block", "ing", "Substituti", "on_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "nonb", "locking", "\\u", "substitution", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "nonb", "locking", "\\u", "substitution", " ", ":", " ", "delays", " ", "lval", "ue", " ", "LE", " ", "delays", " ", "rval", "ue", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Non", "blockin", "g", "Substituti", "on_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "delays", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "delays", " ", ":", " ", "DELAY", " ", "LPAR", "EN", " ", "express", "ion", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Delay", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "delays", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "delays", " ", ":", " ", "DELAY", " ", "identifi", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Delay", "Statement_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "delays", "\\u", "int", "number_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "delays", " ", ":", " ", "DELAY", " ", "int", "number", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Delay", "Statement_", "(_", "Int", "Const_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "delays", "\\u", "float", "number_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "delays", " ", ":", " ", "DELAY", " ", "float", "number", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Delay", "Statement_", "(_", "Float", "Const_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "delays", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "delays", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "block_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "block", " ", ":", " ", "BEGIN", " ", "block", "\\u", "statem", "ents", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "block", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "block", " ", ":", " ", "BEGIN", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "block", "\\u", "statements_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "block", "\\u", "statem", "ents", " ", ":", " ", "block", "\\u", "statem", "ents", " ", "block", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "block", "\\u", "statem", "ents", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "block", "\\u", "statem", "ents", " ", ":", " ", "block", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "block", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "block", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "named", "block_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "named", "block", " ", ":", " ", "BEGIN", " ", "COLON", " ", "ID", " ", "named", "block", "\\u", "statem", "ents", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "named", "block", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "named", "block", " ", ":", " ", "BEGIN", " ", "COLON", " ", "ID", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "(_", ")_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "named", "block", "\\u", "statements_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "named", "block", "\\u", "statem", "ents", " ", ":", " ", "named", "block", "\\u", "statem", "ents", " ", "named", "block", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "named", "block", "\\u", "statem", "ents", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "named", "block", "\\u", "statem", "ents", " ", ":", " ", "named", "block", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "named", "block", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "named", "block", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "integ", "erd", "ecl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "real", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "parameter", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "localpa", "ram", "decl", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "p_", "[_", "1_", "]_", ",_", "Decl", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "p_", "[_", "1_", "]_", "._", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "isinstance_", "(_", "r_", ",_", "Reg_", ")_", "and_", "not_", "isinstance_", "(_", "r_", ",_", "Wire", "_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "r_", ",_", "Integer_", ")_", "and_", "not_", "isinstance_", "(_", "r_", ",_", "Real_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "r_", ",_", "Parameter_", ")_", "and_", "not_", "isinstance_", "(_", "r_", ",_", "Local", "param_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parall", "elb", "lock_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parall", "elb", "lock", " ", ":", " ", "FOR", "K", " ", "block", "\\u", "statem", "ents", " ", "JOIN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Parallel", "Block_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parall", "elb", "lock", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parall", "elb", "lock", " ", ":", " ", "FOR", "K", " ", "JOIN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Parallel", "Block_", "(_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "if", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "if", "\\u", "statem", "ent", " ", ":", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "true", "\\u", "statem", "ent", " ", "ELS", "E", " ", "else", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "7_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "if", "\\u", "statem", "ent", "\\u", "wo", "else_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "if", "\\u", "statem", "ent", " ", ":", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "true", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "if", "\\u", "statem", "ent", "\\u", "delay_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "if", "\\u", "statem", "ent", " ", ":", " ", "delays", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "true", "\\u", "statem", "ent", " ", "ELS", "E", " ", "else", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "6_", "]_", ",_", "p_", "[_", "8_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "if", "\\u", "statem", "ent", "\\u", "wo", "else", "\\u", "delay_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "if", "\\u", "statem", "ent", " ", ":", " ", "delays", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "true", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "6_", "]_", ",_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "cond_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "cond", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "ifc", "onte", "nt", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "ifc", "onte", "nt", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "true", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "true", "\\u", "statem", "ent", " ", ":", " ", "ifc", "onte", "nt", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "else", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "else", "\\u", "statem", "ent", " ", ":", " ", "ifc", "onte", "nt", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "\\u", "statem", "ent", " ", ":", " ", "FOR", " ", "LPAR", "EN", " ", "for", "pre", " ", "for", "cond", " ", "for", "post", " ", "RPA", "REN", " ", "for", "content", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "For", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "7_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "pre_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "pre", " ", ":", " ", "blockin", "g", "\\u", "substitution", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "pre", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "pre", " ", ":", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "cond_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "cond", " ", ":", " ", "cond", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "cond", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "cond", " ", ":", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "post_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "post", " ", ":", " ", "blockin", "g", "\\u", "substitution", "\\u", "base", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "post", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "post", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "for", "content", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "for", "content", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "whi", "le", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "whi", "le", "\\u", "statem", "ent", " ", ":", " ", "WH", "ILE", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "whi", "lec", "onte", "nt", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Whi", "le", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "whi", "lec", "onte", "nt", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "whi", "lec", "onte", "nt", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "\\u", "statem", "ent", " ", ":", " ", "CASE", " ", "LPAR", "EN", " ", "case", "\\u", "comp", " ", "RPA", "REN", " ", "case", "content", "\\u", "statem", "ents", " ", "END", "CASE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Case", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "x", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "x", "\\u", "statem", "ent", " ", ":", " ", "CASE", "X", " ", "LPAR", "EN", " ", "case", "\\u", "comp", " ", "RPA", "REN", " ", "case", "content", "\\u", "statem", "ents", " ", "END", "CASE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Case", "x", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "\\u", "comp_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "\\u", "comp", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "statements_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "statem", "ents", " ", ":", " ", "case", "content", "\\u", "statem", "ents", " ", "case", "content", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "statem", "ents", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "statem", "ents", " ", ":", " ", "case", "content", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "statem", "ent", " ", ":", " ", "case", "content", "\\u", "condition", " ", "COLON", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Case_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "condition", "\\u", "single_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "condition", " ", ":", " ", "case", "content", "\\u", "condition", " ", "COMMA", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "condition", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "condition", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "case", "content", "\\u", "statem", "ent", "\\u", "default_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "case", "content", "\\u", "statem", "ent", " ", ":", " ", "DEF", "AUL", "T", " ", "COLON", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Case_", "(_", "None_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "initial_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "initial", " ", ":", " ", "INITIAL", " ", "initial", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Initial", "_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "initial", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "initial", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "event", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "event", "\\u", "statem", "ent", " ", ":", " ", "sens", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Event", "Statement_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "wait", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "wait", "\\u", "statem", "ent", " ", ":", " ", "WAIT", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "wait", "content", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Wait", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "wait", "content", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "wait", "content", "\\u", "statem", "ent", " ", ":", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "wait", "content", "\\u", "statem", "ent", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "wait", "content", "\\u", "statem", "ent", " ", ":", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "forever", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "forever", "\\u", "statem", "ent", " ", ":", " ", "FORE", "VER", " ", "basic", "\\u", "statem", "ent", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Fore", "ver", "Statement_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", " ", ":", " ", "ID", " ", "parameter", "list", " ", "instance", "\\u", "body", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "instance", "\\u", "array_", "in_", "p_", "[_", "3_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance", "list_", "._", "append_", "(_", "Instance_", "(_", "p_", "[_", "1_", "]_", ",_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "2_", "]_", ",_", "instance", "\\u", "array_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Insta", "nce", "List_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "tuple_", "(_", "instance", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "or_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", " ", ":", " ", "SENS", "\\u", "OR", " ", "parameter", "list", " ", "instance", "\\u", "body", "list", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "instance", "\\u", "array_", "in_", "p_", "[_", "3_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance", "list_", "._", "append_", "(_", "Instance_", "(_", "p_", "[_", "1_", "]_", ",_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "2_", "]_", ",_", "instance", "\\u", "array_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Insta", "nce", "List_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "tuple_", "(_", "instance", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", "list", " ", ":", " ", "instance", "\\u", "body", "list", " ", "COMMA", " ", "instance", "\\u", "body", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "list", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", "list", " ", ":", " ", "instance", "\\u", "body", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", " ", ":", " ", "ID", " ", "LPAR", "EN", " ", "instance", "\\u", "port", "s", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "\\u", "array_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", " ", ":", " ", "ID", " ", "widt", "h", " ", "LPAR", "EN", " ", "instance", "\\u", "port", "s", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "2_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", " ", ":", " ", "ID", " ", "instance", "\\u", "body", "list", "\\u", "nona", "me", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "instance", "\\u", "array_", "in_", "p_", "[_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance", "list_", "._", "append_", "(_", "Instance_", "(_", "p_", "[_", "1_", "]_", ",_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", ")_", ",_", "instance", "\\u", "array_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Insta", "nce", "List_", "(_", "p_", "[_", "1_", "]_", ",_", "(_", ")_", ",_", "tuple_", "(_", "instance", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "or", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", " ", ":", " ", "SENS", "\\u", "OR", " ", "instance", "\\u", "body", "list", "\\u", "nona", "me", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance", "list_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "instance", "\\u", "array_", "in_", "p_", "[_", "2_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance", "list_", "._", "append_", "(_", "Instance_", "(_", "p_", "[_", "1_", "]_", ",_", "instance", "\\u", "name_", ",_", "instance", "\\u", "ports_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", ")_", ",_", "instance", "\\u", "array_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Insta", "nce", "List_", "(_", "p_", "[_", "1_", "]_", ",_", "(_", ")_", ",_", "tuple_", "(_", "instance", "list_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "list", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", "list", "\\u", "nona", "me", " ", ":", " ", "instance", "\\u", "body", "list", "\\u", "nona", "me", " ", "COMMA", " ", "instance", "\\u", "body", "\\u", "nona", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "list", "\\u", "one", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", "list", "\\u", "nona", "me", " ", ":", " ", "instance", "\\u", "body", "\\u", "nona", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "body", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "body", "\\u", "nona", "me", " ", ":", " ", "LPAR", "EN", " ", "instance", "\\u", "port", "s", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "''_", ",_", "p_", "[_", "2_", "]_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "list", " ", ":", " ", "DELAY", " ", "LPAR", "EN", " ", "param", "\\u", "args", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "list", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "list", " ", ":", " ", "DELAY", " ", "LPAR", "EN", " ", "param", "\\u", "args", "\\u", "nona", "me", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "parameter", "list", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "parameter", "list", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "args", "\\u", "nona", "me_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "args", "\\u", "nona", "me", " ", ":", " ", "param", "\\u", "args", "\\u", "nona", "me", " ", "COMMA", " ", "param", "\\u", "arg", "\\u", "nona", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "args", "\\u", "nona", "me", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "args", "\\u", "nona", "me", " ", ":", " ", "param", "\\u", "arg", "\\u", "nona", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "args_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "args", " ", ":", " ", "param", "\\u", "args", " ", "COMMA", " ", "param", "\\u", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "args", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "args", " ", ":", " ", "param", "\\u", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "arg", "\\u", "nona", "me", "\\u", "exp_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "arg", "\\u", "nona", "me", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Param", "Arg_", "(_", "None_", ",_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "param", "\\u", "arg", "\\u", "exp_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "param", "\\u", "arg", " ", ":", " ", "DOT", " ", "ID", " ", "LPAR", "EN", " ", "express", "ion", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Param", "Arg_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "ports_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "instance", "\\u", "port", "s", " ", ":", " ", "instance", "\\u", "port", "s", "\\u", "list", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "instance", "\\u", "port", "s", "\\u", "arg", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "s", "\\u", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "s", "\\u", "list", " ", ":", " ", "instance", "\\u", "port", "s", "\\u", "list", " ", "COMMA", " ", "instance", "\\u", "port", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "s", "\\u", "list", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "s", "\\u", "list", " ", ":", " ", "instance", "\\u", "port", "\\u", "list", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "\\u", "list_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "\\u", "list", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "Arg_", "(_", "None_", ",_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "s", "\\u", "arg_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "s", "\\u", "arg", " ", ":", " ", "instance", "\\u", "port", "s", "\\u", "arg", " ", "COMMA", " ", "instance", "\\u", "port", "\\u", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "s", "\\u", "arg", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "s", "\\u", "arg", " ", ":", " ", "instance", "\\u", "port", "\\u", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "\\u", "arg_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "\\u", "arg", " ", ":", " ", "DOT", " ", "ID", " ", "LPAR", "EN", " ", "identifi", "er", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "Arg_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "\\u", "arg", "\\u", "exp_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "\\u", "arg", " ", ":", " ", "DOT", " ", "ID", " ", "LPAR", "EN", " ", "express", "ion", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "Arg_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "instance", "\\u", "port", "\\u", "arg", "\\u", "none_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "instance", "\\u", "port", "\\u", "arg", " ", ":", " ", "DOT", " ", "ID", " ", "LPAR", "EN", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Port", "Arg_", "(_", "p_", "[_", "2_", "]_", ",_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "gen", "vard", "ecl", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "gen", "vard", "ecl", " ", ":", " ", "GEN", "VAR", " ", "gen", "varli", "st", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Decl", "_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "gen", "varli", "st_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "gen", "varli", "st", " ", ":", " ", "gen", "varli", "st", " ", "COMMA", " ", "gen", "var", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "gen", "varli", "st", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "gen", "varli", "st", " ", ":", " ", "gen", "var", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "gen", "var_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "gen", "var", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Gen", "var_", "(_", "name_", "=_", "p_", "[_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "Width_", "(_", "msb", "_", "=_", "Int", "Const_", "(_", "'", "3", "1", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lsb", "_", "=_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generate_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e", " ", ":", " ", "GENERATE", " ", "generat", "e\\u", "items", " ", "END", "GENERATE", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Generate", "Statement_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "items", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "items", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "items_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "items", " ", ":", " ", "generat", "e\\u", "items", " ", "generat", "e\\u", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "items", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "items", " ", ":", " ", "generat", "e\\u", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "item_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "generat", "e\\u", "item", " ", ":", " ", "standard", "\\u", "item", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e\\u", "if", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e\\u", "for", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "block_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "block", " ", ":", " ", "BEGIN", " ", "generat", "e\\u", "items", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "named", "\\u", "block_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "block", " ", ":", " ", "BEGIN", " ", "COLON", " ", "ID", " ", "generat", "e\\u", "items", " ", "END", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Block_", "(_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "if_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "if", " ", ":", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "gif", "\\u", "true", "\\u", "item", " ", "ELS", "E", " ", "gif", "\\u", "fal", "se", "\\u", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "7_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "if", "\\u", "wo", "else_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "if", " ", ":", " ", "IF", " ", "LPAR", "EN", " ", "cond", " ", "RPA", "REN", " ", "gif", "\\u", "true", "\\u", "item", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "If", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "None_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "if", "\\u", "true", "\\u", "item_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "gif", "\\u", "true", "\\u", "item", " ", ":", " ", "generat", "e\\u", "item", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e\\u", "block", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "if", "\\u", "fal", "se", "\\u", "item_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "gif", "\\u", "fal", "se", "\\u", "item", " ", ":", " ", "generat", "e\\u", "item", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e\\u", "block", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "for_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "generat", "e\\u", "for", " ", ":", " ", "FOR", " ", "LPAR", "EN", " ", "for", "pre", " ", "for", "cond", " ", "for", "post", " ", "RPA", "REN", " ", "generat", "e\\u", "for", "content", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "For", "Statement_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "p_", "[_", "7_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "generat", "e\\u", "for", "content_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "generat", "e\\u", "for", "content", " ", ":", " ", "generat", "e\\u", "item", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "generat", "e\\u", "block", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "system", "call", "\\u", "noar", "gs_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "system", "call", " ", ":", " ", "DO", "LLE", "R", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "System", "Call_", "(_", "p_", "[_", "2_", "]_", ",_", "(_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "system", "call_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "system", "call", " ", ":", " ", "DO", "LLE", "R", " ", "ID", " ", "LPAR", "EN", " ", "sys", "args", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "System", "Call_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "system", "call", "\\u", "signed_", "(_", "self_", ",_", "p_", ")_", ":_", "#", " ", "for", " ", "$", "sign", "ed", " ", "system", " ", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "system", "call", " ", ":", " ", "DO", "LLE", "R", " ", "SIGN", "ED", " ", "LPAR", "EN", " ", "sys", "args", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "System", "Call_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sys", "args_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sys", "args", " ", ":", " ", "sys", "args", " ", "COMMA", " ", "sys", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sys", "args", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sys", "args", " ", ":", " ", "sys", "arg", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sys", "args", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sys", "args", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "sys", "arg_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "sys", "arg", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "function_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "function", " ", ":", " ", "FUNC", "TIO", "N", " ", "widt", "h", " ", "ID", " ", "SEMI", "COLON", " ", "function", "\\u", "statem", "ent", " ", "END", "FUNC", "TIO", "N", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Function_", "(_", "p_", "[_", "3_", "]_", ",_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "5_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "function", "\\u", "now", "idth_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "function", " ", ":", " ", "FUNC", "TIO", "N", " ", "ID", " ", "SEMI", "COLON", " ", "function", "\\u", "statem", "ent", " ", "END", "FUNC", "TIO", "N", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Function_", "(_", "p_", "[_", "2_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Width_", "(_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Int", "Const_", "(_", "'", "0", "'_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "function", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "function", "\\u", "statem", "ent", " ", ":", " ", "func", "vard", "ecl", "s", " ", "function", "\\u", "calc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "vard", "ecl", "s_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "func", "vard", "ecl", "s", " ", ":", " ", "func", "vard", "ecl", "s", " ", "func", "vard", "ecl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "vard", "ecl", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "func", "vard", "ecl", "s", " ", ":", " ", "func", "vard", "ecl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "vard", "ecl", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "func", "vard", "ecl", " ", ":", " ", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "integ", "erd", "ecl", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "p_", "[_", "1_", "]_", ",_", "Decl", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "p_", "[_", "1_", "]_", "._", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "isinstance_", "(_", "r_", ",_", "Input_", ")_", "and_", "not_", "isinstance_", "(_", "r_", ",_", "Reg_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "r_", ",_", "Integer_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "function", "\\u", "calc_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "function", "\\u", "calc", " ", ":", " ", "blockin", "g", "\\u", "substitution", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "if", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "for", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "whi", "le", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "x", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "named", "block", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "function", "call_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "function", "call", " ", ":", " ", "identifi", "er", " ", "LPAR", "EN", " ", "func", "\\u", "args", " ", "RPA", "REN", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Function", "Call_", "(_", "p_", "[_", "1_", "]_", ",_", "p_", "[_", "3_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "\\u", "args_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "func", "\\u", "args", " ", ":", " ", "func", "\\u", "args", " ", "COMMA", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "3_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "\\u", "args", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "func", "\\u", "args", " ", ":", " ", "express", "ion", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "func", "\\u", "args", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "func", "\\u", "args", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "task", " ", ":", " ", "TASK", " ", "ID", " ", "SEMI", "COLON", " ", "task", "\\u", "statem", "ent", " ", "END", "TASK", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Task_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "4_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "\\u", "statement_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "task", "\\u", "statem", "ent", " ", ":", " ", "task", "vard", "ecl", "s", " ", "task", "\\u", "calc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "vard", "ecl", "s_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "task", "vard", "ecl", "s", " ", ":", " ", "task", "vard", "ecl", "s", " ", "task", "vard", "ecl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "+_", "(_", "p_", "[_", "2_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "vard", "ecl", "s", "\\u", "one_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "task", "vard", "ecl", "s", " ", ":", " ", "task", "vard", "ecl", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", "p_", "[_", "1_", "]_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "vard", "ecl", "s", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "task", "vard", "ecl", "s", " ", ":", " ", "empty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "vard", "ecl", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "task", "vard", "ecl", " ", ":", " ", "decl", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "integ", "erd", "ecl", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "p_", "[_", "1_", "]_", ",_", "Decl", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "r_", "in_", "p_", "[_", "1_", "]_", "._", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "not_", "isinstance_", "(_", "r_", ",_", "Input_", ")_", "and_", "not_", "isinstance_", "(_", "r_", ",_", "Reg_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "not_", "isinstance_", "(_", "r_", ",_", "Integer_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Pars", "e", "Error_", "(_", "\"", "Syntax", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "task", "\\u", "calc_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "task", "\\u", "calc", " ", ":", " ", "blockin", "g", "\\u", "substitution", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "if", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "for", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "whi", "le", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "case", "x", "\\u", "statem", "ent", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "|", " ", "named", "block", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "p_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "identifi", "er", " ", ":", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Identifier_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "scope", "\\u", "identifier_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "identifi", "er", " ", ":", " ", "scope", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Identifier_", "(_", "p_", "[_", "2_", "]_", ",_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "scope_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "scope", " ", ":", " ", "identifi", "er", " ", "DOT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope_", "=_", "(_", ")_", "if_", "p_", "[_", "1_", "]_", "._", "scope_", "is_", "None_", "else_", "p_", "[_", "1_", "]_", "._", "scope_", "._", "label", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Identifie", "r", "Scope_", "(_", "scope_", "+_", "(_", "Identifie", "r", "Sco", "pe", "Label_", "(_", "p_", "[_", "1_", "]_", "._", "name_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "scope", "\\u", "pointer_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "scope", " ", ":", " ", "point", "er", " ", "DOT", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scope_", "=_", "(_", ")_", "if_", "p_", "[_", "1_", "]_", "._", "var_", "._", "scope_", "is_", "None_", "else_", "p_", "[_", "1_", "]_", "._", "var_", "._", "scope_", "._", "label", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Identifie", "r", "Scope_", "(_", "scope_", "+_", "(_", "Identifie", "r", "Sco", "pe", "Label_", "(_", "p_", "[_", "1_", "]_", "._", "var_", "._", "name_", ",_", "p_", "[_", "1_", "]_", "._", "ptr_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "disable_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "disable", " ", ":", " ", "DISABLE", " ", "ID", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Disable_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "single", "\\u", "statem", "ent", "\\u", "delays", "_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "single", "\\u", "statem", "ent", " ", ":", " ", "DELAY", " ", "express", "ion", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sing", "le", "Statement_", "(_", "Delay", "Statement_", "(_", "p_", "[_", "2_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "single", "\\u", "statem", "ent", "\\u", "system", "call_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "single", "\\u", "statem", "ent", " ", ":", " ", "system", "call", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sing", "le", "Statement_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "single", "\\u", "statem", "ent", "\\u", "disable_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "single", "\\u", "statem", "ent", " ", ":", " ", "disable", " ", "SEMI", "COLON", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "0_", "]_", "=_", "Sing", "le", "Statement_", "(_", "p_", "[_", "1_", "]_", ",_", "lineno_", "=_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "._", "set\\u", "lineno_", "(_", "0_", ",_", "p_", "._", "lineno_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "empty_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'", "empty", " ", ":", " ", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Parser_", "(_", "PL", "YP", "arser", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "p", "\\u", "error_", "(_", "self_", ",_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Syntax", " ", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "p_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "parse", "\\u", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bef", "ore", ":", " ", "%", "s", "'_", "%_", "p_", "._", "value_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "coord_", "(_", "p_", "._", "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 ", " _", "self_", "._", "\\u", "parse", "\\u", "error_", "(_", "'", "At", " ", "end", " ", "of", " ", "input", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Veri", "log", "Code", "Parser_", "(_", "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_", "[SEP]_", "class_", "Veri", "log", "Code", "Parser_", "(_", "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_", ",_", "filelist_", ",_", "preproc", "ess", "\\u", "output_", "=_", "'", "preproc", "ess", ".", "output", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "include_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "define_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "preproc", "ess", "\\u", "output_", "=_", "preproc", "ess", "\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "directives_", "=_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "preprocessor_", "=_", "Veri", "log", "Preprocessor", "_", "(_", "filelist_", ",_", "preproc", "ess", "\\u", "output_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "include_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "define_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "parser_", "=_", "Veri", "log", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Code", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "preprocess_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "preprocessor_", "._", "preprocess_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text_", "=_", "open_", "(_", "self_", "._", "preproc", "ess", "\\u", "output_", ")_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "self_", "._", "preproc", "ess", "\\u", "output_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Code", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse_", "(_", "self_", ",_", "preproc", "ess", "\\u", "output_", "=_", "'", "preproc", "ess", ".", "output", "'_", ",_", "debug_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "self_", "._", "preprocess_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ast_", "=_", "self_", "._", "parser_", "._", "parse_", "(_", "text_", ",_", "debug_", "=_", "debug_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "directives_", "=_", "self_", "._", "parser_", "._", "get", "\\u", "directives_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Veri", "log", "Code", "Parser_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "directives_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "directives_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\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_", "(_", "filelist_", ",_", "preproc", "ess", "\\u", "include_", "=_", "None_", ",_", "preproc", "ess", "\\u", "define_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "code", "parser_", "=_", "Veri", "log", "Code", "Parser_", "(_", "filelist_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "include_", "=_", "preproc", "ess", "\\u", "include_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "preproc", "ess", "\\u", "define_", "=_", "preproc", "ess", "\\u", "define_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ast_", "=_", "code", "parser_", "._", "parse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "directives_", "=_", "code", "parser_", "._", "get", "\\u", "directives_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ast_", ",_", "directives_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
adblockplus/gyp/pylib/gyp/generator/msvs.py
[ { "content": "def PerformBuild(data, configurations, params):\n options = params['options']\n msvs_version = params['msvs_version']\n devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com')\n\n for build_file, build_file_dict in data.iteritems():\n (build_file_root, build_file_ext) = os.path.splitext(build_file)\n if build_file_ext != '.gyp':\n continue\n sln_path = build_file_root + options.suffix + '.sln'\n if options.generator_output:\n sln_path = os.path.join(options.generator_output, sln_path)\n\n for config in configurations:\n arguments = [devenv, sln_path, '/Build', config]\n print 'Building [%s]: %s' % (config, arguments)\n rtn = subprocess.check_call(arguments)", "metadata": "root.PerformBuild", "header": "['module', '___EOS___']", "index": 1920 }, { "content": "def _GenerateMSBuildProject(project, options, version, generator_flags):\n spec = project.spec\n configurations = spec['configurations']\n project_dir, project_file_name = os.path.split(project.path)\n gyp.common.EnsureDirExists(project.path)\n # Prepare list of sources and excluded sources.\n gyp_path = _NormalizedSource(project.build_file)\n relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)\n\n gyp_file = os.path.split(project.build_file)[1]\n sources, excluded_sources = _PrepareListOfSources(spec, generator_flags,\n gyp_file)\n # Add rules.\n actions_to_add = {}\n props_files_of_rules = set()\n targets_files_of_rules = set()\n rule_dependencies = set()\n extension_to_rule_name = {}\n list_excluded = generator_flags.get('msvs_list_excluded_files', True)\n\n # Don't generate rules if we are using an external builder like ninja.\n if not spec.get('msvs_external_builder'):\n _GenerateRulesForMSBuild(project_dir, options, spec,\n sources, excluded_sources,\n props_files_of_rules, targets_files_of_rules,\n actions_to_add, rule_dependencies,\n extension_to_rule_name)\n else:\n rules = spec.get('rules', [])\n _AdjustSourcesForRules(rules, sources, excluded_sources, True)\n\n sources, excluded_sources, excluded_idl = (\n _AdjustSourcesAndConvertToFilterHierarchy(spec, options,\n project_dir, sources,\n excluded_sources,\n list_excluded, version))\n\n # Don't add actions if we are using an external builder like ninja.\n if not spec.get('msvs_external_builder'):\n _AddActions(actions_to_add, spec, project.build_file)\n _AddCopies(actions_to_add, spec)\n\n # NOTE: this stanza must appear after all actions have been decided.\n # Don't excluded sources with actions attached, or they won't run.\n excluded_sources = _FilterActionsFromExcluded(\n excluded_sources, actions_to_add)\n\n exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)\n actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild(\n spec, actions_to_add)\n\n _GenerateMSBuildFiltersFile(project.path + '.filters', sources,\n rule_dependencies,\n extension_to_rule_name)\n missing_sources = _VerifySourcesExist(sources, project_dir)\n\n for configuration in configurations.itervalues():\n _FinalizeMSBuildSettings(spec, configuration)\n\n # Add attributes to root element\n\n import_default_section = [\n ['Import', {'Project': r'$(VCTargetsPath)\\Microsoft.Cpp.Default.props'}]]\n import_cpp_props_section = [\n ['Import', {'Project': r'$(VCTargetsPath)\\Microsoft.Cpp.props'}]]\n import_cpp_targets_section = [\n ['Import', {'Project': r'$(VCTargetsPath)\\Microsoft.Cpp.targets'}]]\n import_masm_props_section = [\n ['Import',\n {'Project': r'$(VCTargetsPath)\\BuildCustomizations\\masm.props'}]]\n import_masm_targets_section = [\n ['Import',\n {'Project': r'$(VCTargetsPath)\\BuildCustomizations\\masm.targets'}]]\n macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]]\n\n content = [\n 'Project',\n {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003',\n 'ToolsVersion': version.ProjectVersion(),\n 'DefaultTargets': 'Build'\n }]\n\n content += _GetMSBuildProjectConfigurations(configurations)\n content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name)\n content += import_default_section\n content += _GetMSBuildConfigurationDetails(spec, project.build_file)\n if spec.get('msvs_enable_winphone'):\n content += _GetMSBuildLocalProperties('v120_wp81')\n else:\n content += _GetMSBuildLocalProperties(project.msbuild_toolset)\n content += import_cpp_props_section\n content += import_masm_props_section\n content += _GetMSBuildExtensions(props_files_of_rules)\n content += _GetMSBuildPropertySheets(configurations)\n content += macro_section\n content += _GetMSBuildConfigurationGlobalProperties(spec, configurations,\n project.build_file)\n content += _GetMSBuildToolSettingsSections(spec, configurations)\n content += _GetMSBuildSources(\n spec, sources, exclusions, rule_dependencies, extension_to_rule_name,\n actions_spec, sources_handled_by_action, list_excluded)\n content += _GetMSBuildProjectReferences(project)\n content += import_cpp_targets_section\n content += import_masm_targets_section\n content += _GetMSBuildExtensionTargets(targets_files_of_rules)\n\n if spec.get('msvs_external_builder'):\n content += _GetMSBuildExternalBuilderTargets(spec)\n\n # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS:\n # has_run_as = _WriteMSVSUserFile(project.path, version, spec)\n\n easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True)\n\n return missing_sources", "metadata": "root._GenerateMSBuildProject", "header": "['module', '___EOS___']", "index": 3214 } ]
[ { "span": "rtn ", "start_line": 1936, "start_column": 4, "end_line": 1936, "end_column": 7 }, { "span": "relative_path_of_gyp_file ", "start_line": 3221, "start_column": 2, "end_line": 3221, "end_column": 27 } ]
[]
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_", "Perform", "Build_", "(_", "data_", ",_", "configurations_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "=_", "params_", "[_", "'", "options", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msv", "s", "\\u", "version_", "=_", "params_", "[_", "'", "msv", "s", "\\u", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deve", "nv_", "=_", "os_", "._", "path_", "._", "join_", "(_", "msv", "s", "\\u", "version_", "._", "path_", ",_", "'", "Common", "7", "'_", ",_", "'", "IDE", "'_", ",_", "'", "deve", "nv", ".", "com", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "build", "\\u", "file_", ",_", "build", "\\u", "file", "\\u", "dict_", "in_", "data_", "._", "iteritems_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "build", "\\u", "file", "\\u", "root_", ",_", "build", "\\u", "file", "\\u", "ext_", ")_", "=_", "os_", "._", "path_", "._", "splitext_", "(_", "build", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "build", "\\u", "file", "\\u", "ext_", "!=_", "'.", "gyp", "'_", ":_", "\\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_", "sl", "n", "\\u", "path_", "=_", "build", "\\u", "file", "\\u", "root_", "+_", "options_", "._", "suffix_", "+_", "'.", "sl", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "generat", "or", "\\u", "output_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sl", "n", "\\u", "path_", "=_", "os_", "._", "path_", "._", "join_", "(_", "options_", "._", "generat", "or", "\\u", "output_", ",_", "sl", "n", "\\u", "path_", ")_", "\\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_", "config_", "in_", "configurations_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arguments_", "=_", "[_", "deve", "nv_", ",_", "sl", "n", "\\u", "path_", ",_", "'/", "Build", "'_", ",_", "config_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "Building", " ", "[", "%", "s", "]:", " ", "%", "s", "'_", "%_", "(_", "config_", ",_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rtn_", "=_", "subprocess_", "._", "check", "\\u", "call_", "(_", "arguments_", ")_", "\\u\\u\\uNEWLINE\\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", "Generate", "MS", "Build", "Project_", "(_", "project_", ",_", "options_", ",_", "version_", ",_", "generat", "or", "\\u", "flags_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spec_", "=_", "project_", "._", "spec_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "configurations_", "=_", "spec_", "[_", "'", "configura", "tion", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "project", "\\u", "dir_", ",_", "project", "\\u", "file", "\\u", "name_", "=_", "os_", "._", "path_", "._", "split_", "(_", "project_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gyp", "_", "._", "common_", "._", "Ensur", "e", "Dir", "Exists_", "(_", "project_", "._", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Prepare", " ", "list", " ", "of", " ", "source", "s", " ", "and", " ", "exclu", "ded", " ", "source", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "gyp", "\\u", "path_", "=_", "\\u", "Normalize", "d", "Source_", "(_", "project_", "._", "build", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "relative", "\\u", "path", "\\u", "of", "\\u", "gyp", "\\u", "file_", "=_", "gyp", "_", "._", "common_", "._", "Relative", "Path_", "(_", "gyp", "\\u", "path_", ",_", "project", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "gyp", "\\u", "file_", "=_", "os_", "._", "path_", "._", "split_", "(_", "project_", "._", "build", "\\u", "file_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sources_", ",_", "exclu", "ded", "\\u", "sources_", "=_", "\\u", "Prepare", "List", "Of", "Sources_", "(_", "spec_", ",_", "generat", "or", "\\u", "flags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gyp", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "rule", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "action", "s", "\\u", "to", "\\u", "add_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "props", "\\u", "files", "\\u", "of", "\\u", "rules_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "s", "\\u", "files", "\\u", "of", "\\u", "rules_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rule", "\\u", "dependencies_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extensi", "on", "\\u", "to", "\\u", "rule", "\\u", "name_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "list", "\\u", "excluded_", "=_", "generat", "or", "\\u", "flags_", "._", "get_", "(_", "'", "msv", "s", "\\u", "list", "\\u", "exclu", "ded", "\\u", "files", "'_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "generat", "e", " ", "rule", "s", " ", "if", " ", "we", " ", "are", " ", "usi", "ng", " ", "an", " ", "external", " ", "builde", "r", " ", "like", " ", "ninja", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "spec_", "._", "get_", "(_", "'", "msv", "s", "\\u", "external", "\\u", "builde", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Generate", "Rule", "s", "For", "MS", "Build_", "(_", "project", "\\u", "dir_", ",_", "options_", ",_", "spec_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sources_", ",_", "exclu", "ded", "\\u", "sources_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "props", "\\u", "files", "\\u", "of", "\\u", "rules_", ",_", "target", "s", "\\u", "files", "\\u", "of", "\\u", "rules_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action", "s", "\\u", "to", "\\u", "add_", ",_", "rule", "\\u", "dependencies_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extensi", "on", "\\u", "to", "\\u", "rule", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rules_", "=_", "spec_", "._", "get_", "(_", "'", "rule", "s", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Adjust", "Sou", "rce", "s", "For", "Rules_", "(_", "rules_", ",_", "sources_", ",_", "exclu", "ded", "\\u", "sources_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sources_", ",_", "exclu", "ded", "\\u", "sources_", ",_", "exclu", "ded", "\\u", "idl", "_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Adjust", "Sou", "rce", "s", "And", "Convert", "To", "Filter", "Hier", "arch", "y_", "(_", "spec_", ",_", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project", "\\u", "dir_", ",_", "sources_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "ded", "\\u", "sources_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "list", "\\u", "excluded_", ",_", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "add", " ", "action", "s", " ", "if", " ", "we", " ", "are", " ", "usi", "ng", " ", "an", " ", "external", " ", "builde", "r", " ", "like", " ", "ninja", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "spec_", "._", "get_", "(_", "'", "msv", "s", "\\u", "external", "\\u", "builde", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Add", "Actions_", "(_", "action", "s", "\\u", "to", "\\u", "add_", ",_", "spec_", ",_", "project_", "._", "build", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Add", "Copie", "s_", "(_", "action", "s", "\\u", "to", "\\u", "add_", ",_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "this", " ", "stanza", " ", "must", " ", "appear", " ", "after", " ", "all", " ", "action", "s", " ", "have", " ", "bee", "n", " ", "decide", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Don", "'", "t", " ", "exclu", "ded", " ", "source", "s", " ", "with", " ", "action", "s", " ", "attache", "d", ",", " ", "or", " ", "the", "y", " ", "won", "'", "t", " ", "run", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "ded", "\\u", "sources_", "=_", "\\u", "Filter", "Action", "s", "Fro", "m", "Exclude", "d_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "ded", "\\u", "sources_", ",_", "action", "s", "\\u", "to", "\\u", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exclusions", "_", "=_", "\\u", "Get", "Exclude", "d", "Files", "Fro", "m", "Build_", "(_", "spec_", ",_", "exclu", "ded", "\\u", "sources_", ",_", "exclu", "ded", "\\u", "idl", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action", "s", "\\u", "spec_", ",_", "source", "s", "\\u", "handle", "d\\u", "by", "\\u", "action_", "=_", "\\u", "Generate", "Action", "s", "For", "MS", "Build_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "spec_", ",_", "action", "s", "\\u", "to", "\\u", "add_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Generate", "MS", "Build", "Filter", "s", "File_", "(_", "project_", "._", "path_", "+_", "'.", "filter", "s", "'_", ",_", "sources_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "rule", "\\u", "dependencies_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "extensi", "on", "\\u", "to", "\\u", "rule", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "missi", "ng", "\\u", "sources_", "=_", "\\u", "Verify", "Sou", "rce", "s", "Exist_", "(_", "sources_", ",_", "project", "\\u", "dir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "configuration_", "in_", "configurations_", "._", "itervalues_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Finali", "ze", "MS", "Build", "Settings_", "(_", "spec_", ",_", "configuration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "attribute", "s", " ", "to", " ", "root", " ", "element_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import", "\\u", "default", "\\u", "section_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Import", "'_", ",_", "{_", "'", "Project", "'_", ":_", "r", "'$", "(", "VC", "Target", "s", "Path", ")\\\\", "Micro", "soft", ".", "Cp", "p", ".", "Default", ".", "props", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import", "\\u", "cpp", "\\u", "props", "\\u", "section_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Import", "'_", ",_", "{_", "'", "Project", "'_", ":_", "r", "'$", "(", "VC", "Target", "s", "Path", ")\\\\", "Micro", "soft", ".", "Cp", "p", ".", "props", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import", "\\u", "cpp", "\\u", "target", "s", "\\u", "section_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Import", "'_", ",_", "{_", "'", "Project", "'_", ":_", "r", "'$", "(", "VC", "Target", "s", "Path", ")\\\\", "Micro", "soft", ".", "Cp", "p", ".", "target", "s", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import", "\\u", "mas", "m", "\\u", "props", "\\u", "section_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Import", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "Project", "'_", ":_", "r", "'$", "(", "VC", "Target", "s", "Path", ")\\\\", "Build", "Customiz", "ation", "s", "\\\\", "mas", "m", ".", "props", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import", "\\u", "mas", "m", "\\u", "target", "s", "\\u", "section_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "Import", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "Project", "'_", ":_", "r", "'$", "(", "VC", "Target", "s", "Path", ")\\\\", "Build", "Customiz", "ation", "s", "\\\\", "mas", "m", ".", "target", "s", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "macro", "\\u", "section_", "=_", "[_", "[_", "'", "Proper", "ty", "Group", "'_", ",_", "{_", "'", "Label", "'_", ":_", "'", "User", "Macro", "s", "'_", "}_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Project", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "'", "xml", "ns", "'_", ":_", "'", "http", "://", "schema", "s", ".", "micros", "oft", ".", "com", "/", "developer", "/", "msb", "uild", "/", "2003", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Tool", "s", "Version", "'_", ":_", "version_", "._", "Project", "Version_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Default", "Target", "s", "'_", ":_", "'", "Build", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Project", "Configurations", "_", "(_", "configurations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Global", "Properties_", "(_", "spec_", ",_", "project_", "._", "guid_", ",_", "project", "\\u", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "import", "\\u", "default", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Configura", "tion", "Details_", "(_", "spec_", ",_", "project_", "._", "build", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "spec_", "._", "get_", "(_", "'", "msv", "s", "\\u", "enable", "\\u", "win", "phone", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "+=_", "\\u", "Get", "MS", "Build", "Local", "Properties_", "(_", "'", "v1", "20", "\\u", "wp", "8", "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 ", " _", "content_", "+=_", "\\u", "Get", "MS", "Build", "Local", "Properties_", "(_", "project_", "._", "msb", "uild", "\\u", "toolset", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "content_", "+=_", "import", "\\u", "cpp", "\\u", "props", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "import", "\\u", "mas", "m", "\\u", "props", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Extensions_", "(_", "props", "\\u", "files", "\\u", "of", "\\u", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Proper", "ty", "She", "ets_", "(_", "configurations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "macro", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Configura", "tion", "Global", "Properties_", "(_", "spec_", ",_", "configurations_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "project_", "._", "build", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Tool", "Sett", "ings", "Sections", "_", "(_", "spec_", ",_", "configurations_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Sources_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "spec_", ",_", "sources_", ",_", "exclusions", "_", ",_", "rule", "\\u", "dependencies_", ",_", "extensi", "on", "\\u", "to", "\\u", "rule", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "action", "s", "\\u", "spec_", ",_", "source", "s", "\\u", "handle", "d\\u", "by", "\\u", "action_", ",_", "list", "\\u", "excluded_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Project", "Reference", "s_", "(_", "project_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "import", "\\u", "cpp", "\\u", "target", "s", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "import", "\\u", "mas", "m", "\\u", "target", "s", "\\u", "section_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "+=_", "\\u", "Get", "MS", "Build", "Ext", "ensi", "on", "Targets_", "(_", "target", "s", "\\u", "files", "\\u", "of", "\\u", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "spec_", "._", "get_", "(_", "'", "msv", "s", "\\u", "external", "\\u", "builde", "r", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "+=_", "\\u", "Get", "MS", "Build", "Exter", "nal", "Build", "er", "Targets_", "(_", "spec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", "(", "je", "an", "luc", ")", " ", "File", " ", "a", " ", "bug", " ", "to", " ", "get", " ", "rid", " ", "of", " ", "runa", "s", ".", " ", " ", "We", " ", "had", " ", "in", " ", "MS", "VS", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", "\\u", "run", "\\u", "as", " ", "=", " ", "\\u", "Write", "MS", "VS", "User", "File", "(", "project", ".", "path", ",", " ", "version", ",", " ", "spec", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "easy", "\\u", "xml_", "._", "Write", "Xm", "l", "If", "Changed_", "(_", "content_", ",_", "project_", "._", "path_", ",_", "pretty_", "=_", "True_", ",_", "win32", "_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "missi", "ng", "\\u", "sources_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
ProgVal/Limnoria/plugins/GPG/plugin.py
[ { "content": "###\n# Copyright (c) 2015, Valentin Lorentz\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright notice,\n# this list of conditions, and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions, and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# * Neither the name of the author of this software nor the name of\n# contributors to this software may be used to endorse or promote products\n# derived from this software without specific prior written consent.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n\n###\n\nimport re\nimport sys\nimport time\nimport uuid\n\nimport supybot.gpg as gpg\nimport supybot.conf as conf\nimport supybot.utils as utils\nimport supybot.ircdb as ircdb\nfrom supybot.commands import *\nimport supybot.utils.minisix as minisix\nimport supybot.plugins as plugins\nimport supybot.ircutils as ircutils\nimport supybot.callbacks as callbacks\ntry:\n from supybot.i18n import PluginInternationalization\n _ = PluginInternationalization('GPG')\nexcept ImportError:\n # Placeholder that allows to run the plugin on a bot\n # without the i18n module\n _ = lambda x: x\n\n\n\n\nClass = GPG\n\n\n# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class GPG(callbacks.Plugin):\n \"\"\"Provides authentication based on GPG keys.\"\"\"\n class key(callbacks.Commands):\n def add(self, irc, msg, args, user, keyid, keyserver):\n \"\"\"<key id> <key server>\n\n Add a GPG key to your account.\"\"\"\n if keyid in user.gpgkeys:\n irc.error(_('This key is already associated with your '\n 'account.'))\n return\n result = gpg.keyring.recv_keys(keyserver, keyid)\n reply = format(_('%n imported, %i unchanged, %i not imported.'),\n (result.imported, _('key')),\n result.unchanged,\n result.not_imported,\n [x['fingerprint'] for x in result.results])\n if result.imported == 1:\n user.gpgkeys.append(keyid)\n irc.reply(reply)\n else:\n irc.error(reply)\n add = wrap(add, ['user',\n ('somethingWithoutSpaces',\n _('You must give a valid key id')),\n ('somethingWithoutSpaces',\n _('You must give a valid key server'))])\n\n def remove(self, irc, msg, args, user, fingerprint):\n \"\"\"<fingerprint>\n\n Remove a GPG key from your account.\"\"\"\n try:\n keyids = [x['keyid'] for x in gpg.keyring.list_keys()\n if x['fingerprint'] == fingerprint]\n if len(keyids) == 0:\n raise ValueError\n for keyid in keyids:\n try:\n user.gpgkeys.remove(keyid)\n except ValueError:\n user.gpgkeys.remove('0x' + keyid)\n gpg.keyring.delete_keys(fingerprint)\n irc.replySuccess()\n except ValueError:\n irc.error(_('GPG key not associated with your account.'))\n remove = wrap(remove, ['user', 'somethingWithoutSpaces'])\n\n def list(self, irc, msg, args, user):\n \"\"\"takes no arguments\n\n List your GPG keys.\"\"\"\n keyids = user.gpgkeys\n if len(keyids) == 0:\n irc.reply(_('No key is associated with your account.'))\n else:\n irc.reply(format('%L', keyids))\n list = wrap(list, ['user'])\n\n class signing(callbacks.Commands):\n def __init__(self, *args):\n super(GPG.signing, self).__init__(*args)\n self._tokens = {}\n\n def _expire_tokens(self):\n now = time.time()\n self._tokens = dict(filter(lambda x_y: x_y[1][1]>now,\n self._tokens.items()))\n\n def gettoken(self, irc, msg, args):\n \"\"\"takes no arguments\n\n Send you a token that you'll have to sign with your key.\"\"\"\n self._expire_tokens()\n token = '{%s}' % str(uuid.uuid4())\n lifetime = conf.supybot.plugins.GPG.auth.sign.TokenTimeout()\n self._tokens.update({token: (msg.prefix, time.time()+lifetime)})\n irc.reply(_('Your token is: %s. Please sign it with your '\n 'GPG key, paste it somewhere, and call the \\'auth\\' '\n 'command with the URL to the (raw) file containing the '\n 'signature.') % token)\n gettoken = wrap(gettoken, [])\n\n _auth_re = re.compile(r'-----BEGIN PGP SIGNED MESSAGE-----\\r?\\n'\n r'Hash: .*\\r?\\n\\r?\\n'\n r'\\s*({[0-9a-z-]+})\\s*\\r?\\n'\n r'-----BEGIN PGP SIGNATURE-----\\r?\\n.*'\n r'\\r?\\n-----END PGP SIGNATURE-----',\n re.S)\n \n def auth(self, irc, msg, args, url):\n \"\"\"<url>\n\n Check the GPG signature at the <url> and authenticates you if\n the key used is associated to a user.\"\"\"\n self._expire_tokens()\n content = utils.web.getUrl(url)\n if minisix.PY3 and isinstance(content, bytes):\n content = content.decode()\n match = self._auth_re.search(content)\n if not match:\n irc.error(_('Signature or token not found.'), Raise=True)\n data = match.group(0)\n token = match.group(1)\n if token not in self._tokens:\n irc.error(_('Unknown token. It may have expired before you '\n 'submit it.'), Raise=True)\n if self._tokens[token][0] != msg.prefix:\n irc.error(_('Your hostname/nick changed in the process. '\n 'Authentication aborted.'), Raise=True)\n verified = gpg.keyring.verify(data)\n if verified and verified.valid:\n keyid = verified.pubkey_fingerprint[-16:]\n prefix, expiry = self._tokens.pop(token)\n found = False\n for (id, user) in ircdb.users.items():\n if keyid in [x[-len(keyid):] for x in user.gpgkeys]:\n try:\n user.addAuth(msg.prefix)\n except ValueError:\n irc.error(_('Your secure flag is true and your '\n 'hostmask doesn\\'t match any of your '\n 'known hostmasks.'), Raise=True)\n ircdb.users.setUser(user, flush=False)\n irc.reply(_('You are now authenticated as %s.') %\n user.name)\n return\n irc.error(_('Unknown GPG key.'), Raise=True)\n else:\n irc.error(_('Signature could not be verified. Make sure '\n 'this is a valid GPG signature and the URL is valid.'))\n auth = wrap(auth, ['url'])", "metadata": "root.GPG", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "import sys", "start_line": 31, "start_column": 0, "end_line": 31, "end_column": 10 }, { "span": "import supybot.plugins as plugins", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 33 }, { "span": "import supybot.ircutils as ircutils", "start_line": 42, "start_column": 0, "end_line": 42, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "201", "5", ",", " ", "Val", "enti", "n", " ", "Lore", "ntz", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "author", " ", "of", " ", "this", " ", "software", " ", "nor", " ", "the", " ", "name", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "consent", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "gpg", "_", "as_", "gpg", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "conf_", "as_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "utils_", "as_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "irc", "db_", "as_", "irc", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sup", "ybo", "t_", "._", "commands_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "utils_", "._", "mini", "six_", "as_", "mini", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "plugins_", "as_", "plugins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "irc", "utils_", "as_", "irc", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sup", "ybo", "t_", "._", "callbacks_", "as_", "callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "sup", "ybo", "t_", "._", "i18n_", "import_", "Plug", "in", "Intern", "ation", "ali", "zation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", "=_", "Plug", "in", "Intern", "ation", "ali", "zation_", "(_", "'", "GPG", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Place", "holder", " ", "tha", "t", " ", "allow", "s", " ", "to", " ", "run", " ", "the", " ", "plugin", " ", "on", " ", "a", " ", "bot_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "with", "out", " ", "the", " ", "i18n", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u_", "=_", "lambda_", "x_", ":_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Class_", "=_", "GPG", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "vim", ":", "set", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "text", "widt", "h", "=", "7", "9", ":_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "GPG", "_", "(_", "callbacks_", "._", "Plugin_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Prov", "ides", " ", "authenticat", "ion", " ", "based", " ", "on", " ", "GPG", " ", "keys", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "key_", "(_", "callbacks_", "._", "Commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "add_", "(_", "self_", ",_", "irc_", ",_", "msg_", ",_", "args_", ",_", "user_", ",_", "keyid", "_", ",_", "keyse", "rver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "<", "key", " ", "id", ">", " ", "<", "key", " ", "server", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Add", " ", "a", " ", "GPG", " ", "key", " ", "to", " ", "your", " ", "account", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "keyid", "_", "in_", "user_", "._", "gpg", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "Thi", "s", " ", "key", " ", "is", " ", "alr", "ead", "y", " ", "associate", "d", " ", "with", " ", "your", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "account", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "result_", "=_", "gpg", "_", "._", "keyring_", "._", "recv", "\\u", "keys_", "(_", "keyse", "rver_", ",_", "keyid", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "=_", "format_", "(_", "\\u_", "(_", "'%", "n", " ", "import", "ed", ",", " ", "%", "i", " ", "unchanged", ",", " ", "%", "i", " ", "not", " ", "import", "ed", ".'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "result_", "._", "imported_", ",_", "\\u_", "(_", "'", "key", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "unchanged", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "._", "not", "\\u", "imported_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "x_", "[_", "'", "fingerprint", "'_", "]_", "for_", "x_", "in_", "result_", "._", "results_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "._", "imported_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", "._", "gpg", "keys_", "._", "append_", "(_", "keyid", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "irc_", "._", "reply_", "(_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "error_", "(_", "reply_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "add_", "=_", "wrap_", "(_", "add_", ",_", "[_", "'", "user", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "somet", "hing", "With", "out", "Spaces", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "You", " ", "must", " ", "give", " ", "a", " ", "valid", " ", "key", " ", "id", "'_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "somet", "hing", "With", "out", "Spaces", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u_", "(_", "'", "You", " ", "must", " ", "give", " ", "a", " ", "valid", " ", "key", " ", "server", "'_", ")_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "remove_", "(_", "self_", ",_", "irc_", ",_", "msg_", ",_", "args_", ",_", "user_", ",_", "fingerprint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "<", "fingerprint", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "a", " ", "GPG", " ", "key", " ", "from", " ", "your", " ", "account", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyid", "s_", "=_", "[_", "x_", "[_", "'", "keyid", "'_", "]_", "for_", "x_", "in_", "gpg", "_", "._", "keyring_", "._", "list", "\\u", "keys_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "x_", "[_", "'", "fingerprint", "'_", "]_", "==_", "fingerprint_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "keyid", "s_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "Value", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "keyid", "_", "in_", "keyid", "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 ", " ", " _", "user_", "._", "gpg", "keys_", "._", "remove_", "(_", "keyid", "_", ")_", "\\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 ", " ", " _", "user_", "._", "gpg", "keys_", "._", "remove_", "(_", "'", "0", "x", "'_", "+_", "keyid", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gpg", "_", "._", "keyring_", "._", "delete", "\\u", "keys_", "(_", "fingerprint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "irc_", "._", "repl", "y", "Success_", "(_", ")_", "\\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 ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "GPG", " ", "key", " ", "not", " ", "associate", "d", " ", "with", " ", "your", " ", "account", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "remove_", "=_", "wrap_", "(_", "remove_", ",_", "[_", "'", "user", "'_", ",_", "'", "somet", "hing", "With", "out", "Spaces", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "list_", "(_", "self_", ",_", "irc_", ",_", "msg_", ",_", "args_", ",_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "take", "s", " ", "no", " ", "argu", "ment", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "your", " ", "GPG", " ", "keys", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keyid", "s_", "=_", "user_", "._", "gpg", "keys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "keyid", "s_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "reply_", "(_", "\\u_", "(_", "'", "No", " ", "key", " ", "is", " ", "associate", "d", " ", "with", " ", "your", " ", "account", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "reply_", "(_", "format_", "(_", "'%", "L", "'_", ",_", "keyid", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "list_", "=_", "wrap_", "(_", "list_", ",_", "[_", "'", "user", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "signin", "g_", "(_", "callbacks_", "._", "Commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "GPG", "_", "._", "signin", "g_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tokens_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "expir", "e\\u", "tokens_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tokens_", "=_", "dict_", "(_", "filter_", "(_", "lambda_", "x", "\\u", "y_", ":_", "x", "\\u", "y_", "[_", "1_", "]_", "[_", "1_", "]_", ">_", "now_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "tokens_", "._", "items_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gett", "oken", "_", "(_", "self_", ",_", "irc_", ",_", "msg_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "take", "s", " ", "no", " ", "argu", "ment", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Sen", "d", " ", "you", " ", "a", " ", "token", " ", "tha", "t", " ", "you", "'", "ll", " ", "have", " ", "to", " ", "sign", " ", "with", " ", "your", " ", "key", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "expir", "e\\u", "tokens_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "'{", "%", "s", "}'_", "%_", "str_", "(_", "uuid_", "._", "uuid4_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lifetime_", "=_", "conf_", "._", "sup", "ybo", "t_", "._", "plugins_", "._", "GPG", "_", "._", "auth_", "._", "sign_", "._", "Token", "Timeout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tokens_", "._", "update_", "(_", "{_", "token_", ":_", "(_", "msg_", "._", "prefix_", ",_", "time_", "._", "time_", "(_", ")_", "+_", "lifetime_", ")_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "irc_", "._", "reply_", "(_", "\\u_", "(_", "'", "You", "r", " ", "token", " ", "is", ":", " ", "%", "s", ".", " ", "Ple", "ase", " ", "sign", " ", "it", " ", "with", " ", "your", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "GPG", " ", "key", ",", " ", "paste", " ", "it", " ", "some", "where", ",", " ", "and", " ", "call", " ", "the", " ", "\\\\'", "auth", "\\\\'", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "command", " ", "with", " ", "the", " ", "URL", " ", "to", " ", "the", " ", "(", "raw", ")", " ", "file", " ", "contain", "ing", " ", "the", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "signa", "ture", ".'_", ")_", "%_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "gett", "oken", "_", "=_", "wrap_", "(_", "gett", "oken", "_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "auth", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "r", "'-----", "BEGIN", " ", "PGP", " ", "SIGN", "ED", " ", "MESSAGE", "-----", "\\\\", "r", "?\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'", "Hash", ":", " ", ".*\\\\", "r", "?\\\\", "n", "\\\\", "r", "?\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'\\\\", "s", "*(", "{[", "0", "-", "9", "a", "-", "z", "-]+", "})\\\\", "s", "*\\\\", "r", "?\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'-----", "BEGIN", " ", "PGP", " ", "SIGNATURE", "-----", "\\\\", "r", "?\\\\", "n", ".*'_", "\\u\\u\\uNL\\u\\u\\u_", "r", "'\\\\", "r", "?\\\\", "n", "-----", "END", " ", "PGP", " ", "SIGNATURE", "-----", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "re_", "._", "S_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "auth_", "(_", "self_", ",_", "irc_", ",_", "msg_", ",_", "args_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "<", "url", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "the", " ", "GPG", " ", "signa", "ture", " ", "at", " ", "the", " ", "<", "url", ">", " ", "and", " ", "authenticat", "es", " ", "you", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "key", " ", "used", " ", "is", " ", "associate", "d", " ", "to", " ", "a", " ", "user", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "expir", "e\\u", "tokens_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "utils_", "._", "web_", "._", "get", "Url_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mini", "six_", "._", "PY", "3_", "and_", "isinstance_", "(_", "content_", ",_", "bytes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content_", "=_", "content_", "._", "decode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "match_", "=_", "self_", "._", "\\u", "auth", "\\u", "re_", "._", "search_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "Sign", "ature", " ", "or", " ", "token", " ", "not", " ", "found", ".'_", ")_", ",_", "Raise_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "match_", "._", "group_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "token_", "=_", "match_", "._", "group_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "token_", "not_", "in_", "self_", "._", "\\u", "tokens_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "Un", "know", "n", " ", "token", ".", " ", "It", " ", "may", " ", "have", " ", "expir", "ed", " ", "bef", "ore", " ", "you", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "submit", " ", "it", ".'_", ")_", ",_", "Raise_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "\\u", "tokens_", "[_", "token_", "]_", "[_", "0_", "]_", "!=_", "msg_", "._", "prefix_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "You", "r", " ", "host", "name", "/", "nick", " ", "change", "d", " ", "in", " ", "the", " ", "process", ".", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Auth", "entica", "tion", " ", "abort", "ed", ".'_", ")_", ",_", "Raise_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "verified_", "=_", "gpg", "_", "._", "keyring_", "._", "verify_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "verified_", "and_", "verified_", "._", "valid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keyid", "_", "=_", "verified_", "._", "pubkey", "\\u", "fingerprint_", "[_", "-_", "16_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "prefix_", ",_", "expiry_", "=_", "self_", "._", "\\u", "tokens_", "._", "pop_", "(_", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "id_", ",_", "user_", ")_", "in_", "irc", "db_", "._", "users_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "keyid", "_", "in_", "[_", "x_", "[_", "-_", "len_", "(_", "keyid", "_", ")_", ":_", "]_", "for_", "x_", "in_", "user_", "._", "gpg", "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_", "._", "add", "Auth_", "(_", "msg_", "._", "prefix_", ")_", "\\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 ", " ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "You", "r", " ", "secure", " ", "flag", " ", "is", " ", "true", " ", "and", " ", "your", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "host", "mask", " ", "doe", "sn", "\\\\'", "t", " ", "match", " ", "any", " ", "of", " ", "your", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "know", "n", " ", "host", "mask", "s", ".'_", ")_", ",_", "Raise_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "irc", "db_", "._", "users_", "._", "set", "User_", "(_", "user_", ",_", "flush_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "irc_", "._", "reply_", "(_", "\\u_", "(_", "'", "You", " ", "are", " ", "now", " ", "authenticat", "ed", " ", "as", " ", "%", "s", ".'_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "user_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "Un", "know", "n", " ", "GPG", " ", "key", ".'_", ")_", ",_", "Raise_", "=_", "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 ", " _", "irc_", "._", "error_", "(_", "\\u_", "(_", "'", "Sign", "ature", " ", "coul", "d", " ", "not", " ", "be", " ", "verifie", "d", ".", " ", "Make", " ", "sure", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "this", " ", "is", " ", "a", " ", "valid", " ", "GPG", " ", "signa", "ture", " ", "and", " ", "the", " ", "URL", " ", "is", " ", "valid", ".'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "auth_", "=_", "wrap_", "(_", "auth_", ",_", "[_", "'", "url", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Testing equality to None
doozr/Xdebug-for-Vim/plugin/debugger.py
[ { "content": " def isprepared(self):\n \"\"\" check window is OK \"\"\"\n if self.buffer == None or len(dir(self.buffer)) == 0 or self.getwinnr() == -1:\n return 0\n return 1", "metadata": "root.VimWindow.isprepared", "header": "['class', 'VimWindow', ':', '___EOS___']", "index": 138 }, { "content": " def destroy(self):\n \"\"\" destroy window \"\"\"\n if self.buffer == None or len(dir(self.buffer)) == 0:\n return\n #if self.name == 'LOG___WINDOW':\n # self.command('hide')\n #else:\n self.command('bdelete ' + self.name)\n self.firstwrite = 1", "metadata": "root.VimWindow.destroy", "header": "['class', 'VimWindow', ':', '___EOS___']", "index": 196 } ]
[ { "span": "self.buffer == None ", "start_line": 140, "start_column": 7, "end_line": 140, "end_column": 26 }, { "span": "self.buffer == None ", "start_line": 198, "start_column": 7, "end_line": 198, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Test", "ing_", "equality", "_", "to_", "None_", "[SEP]_", "class_", "Vi", "m", "Window_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "isp", "repar", "ed_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "check", " ", "window", " ", "is", " ", "OK", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "buffer_", "==_", "None_", "or_", "len_", "(_", "dir_", "(_", "self_", "._", "buffer_", ")_", ")_", "==_", "0_", "or_", "self_", "._", "getw", "inn", "r_", "(_", ")_", "==_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Vi", "m", "Window_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "destroy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "destroy", " ", "window", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "buffer_", "==_", "None_", "or_", "len_", "(_", "dir_", "(_", "self_", "._", "buffer_", ")_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "self", ".", "name", " ", "==", " ", "'", "LOG", "\\u\\u\\u", "WIND", "OW", "':", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "self", ".", "command", "('", "hide", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "else", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "command_", "(_", "'", "bde", "lete", " ", "'_", "+_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "first", "write_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
KaySackey/Nemo/nemo/nodes.py
[ { "content": " def add_child(self, node):\n raise NotImplemented()", "metadata": "root.Node.add_child", "header": "['class', 'Node', '(', 'object', ')', ':', '___EOS___']", "index": 17 }, { "content": " def write(self, buffer):\n raise NotImplemented()", "metadata": "root.Node.write", "header": "['class', 'Node', '(', 'object', ')', ':', '___EOS___']", "index": 30 } ]
[ { "span": "NotImplemented(", "start_line": 18, "start_column": 14, "end_line": 18, "end_column": 28 }, { "span": "NotImplemented(", "start_line": 31, "start_column": 14, "end_line": 31, "end_column": 28 } ]
[]
1
true
[ "[CLS]_", "Not", "Implemented_", "is_", "not_", "an_", "Exception_", "[SEP]_", "class_", "Node_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "\\u", "child_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write_", "(_", "self_", ",_", "buffer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_", "(_", ")_", "\\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, 0, 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, 0, 1, 2, 2, 2 ]
Unused import
ImageEngine/gaffer/python/GafferSceneTest/FreezeTransformTest.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2014, John Haddon. 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 GafferScene\nimport GafferSceneTest\n\n\nif __name__ == \"__main__\":\n\tunittest.main()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class FreezeTransformTest( GafferSceneTest.SceneTestCase ) :\n\n\n", "metadata": "root.FreezeTransformTest", "header": "['module', '___EOS___']", "index": 44 }, { "content": "\tdef test( self ) :\n\n\t\tp = GafferScene.Plane()\n\t\tp[\"transform\"][\"translate\"].setValue( IECore.V3f( 1, 2, 3 ) )\n\n\t\tt = GafferScene.FreezeTransform()\n\t\tt[\"in\"].setInput( p[\"out\"] )\n\n\t\tself.assertSceneValid( t[\"out\"] )\n\n\t\tself.assertEqual( t[\"out\"].transform( \"/plane\" ), IECore.M44f() )\n\t\tself.assertEqual( t[\"out\"].bound( \"/plane\" ), IECore.Box3f( IECore.V3f( 0.5, 1.5, 3 ), IECore.V3f( 1.5, 2.5, 3 ) ) )\n\t\tself.assertEqual( t[\"out\"].object( \"/plane\" ).bound(), IECore.Box3f( IECore.V3f( 0.5, 1.5, 3 ), IECore.V3f( 1.5, 2.5, 3 ) ) )", "metadata": "root.FreezeTransformTest.test", "header": "['class', 'FreezeTransformTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 46 }, { "content": "\tdef testFilter( self ) :\n\n\t\tp1 = GafferScene.Plane()\n\t\tp1[\"transform\"][\"translate\"].setValue( IECore.V3f( 1, 2, 3 ) )\n\n\t\tp2 = GafferScene.Plane()\n\t\tp2[\"transform\"][\"translate\"].setValue( IECore.V3f( 1, 2, 3 ) )\n\n\t\tg = GafferScene.Group()\n\t\tg[\"transform\"][\"translate\"].setValue( IECore.V3f( 1, 0, 0 ) )\n\t\tg[\"in\"][0].setInput( p1[\"out\"] )\n\t\tg[\"in\"][1].setInput( p2[\"out\"] )\n\n\t\tf = GafferScene.PathFilter()\n\t\tf[\"paths\"].setValue( IECore.StringVectorData( [ \"/group/plane\" ] ) )\n\n\t\tt = GafferScene.FreezeTransform()\n\t\tt[\"in\"].setInput( g[\"out\"] )\n\t\tt[\"filter\"].setInput( f[\"out\"] )\n\n\t\tself.assertSceneValid( t[\"out\"] )\n\n\t\tself.assertEqual( t[\"out\"].transform( \"/group\" ), IECore.M44f.createTranslated( IECore.V3f( 1, 0, 0 ) ) )\n\t\tself.assertEqual( t[\"out\"].transform( \"/group/plane\" ), IECore.M44f() )\n\t\tself.assertEqual( t[\"out\"].transform( \"/group/plane1\" ), IECore.M44f.createTranslated( IECore.V3f( 1, 2, 3 ) ) )\n\n\t\tself.assertEqual( t[\"out\"].bound( \"/group/plane\" ), IECore.Box3f( IECore.V3f( 0.5, 1.5, 3 ), IECore.V3f( 1.5, 2.5, 3 ) ) )\n\t\tself.assertEqual( t[\"out\"].bound( \"/group/plane1\" ), IECore.Box3f( IECore.V3f( -0.5, -0.5, 0 ), IECore.V3f( 0.5, 0.5, 0 ) ) )\n\n\t\tself.assertEqual( t[\"out\"].object( \"/group/plane\" ).bound(), IECore.Box3f( IECore.V3f( 0.5, 1.5, 3 ), IECore.V3f( 1.5, 2.5, 3 ) ) )\n\t\tself.assertEqual( t[\"out\"].object( \"/group/plane1\" ).bound(), IECore.Box3f( IECore.V3f( -0.5, -0.5, 0 ), IECore.V3f( 0.5, 0.5, 0 ) ) )\n\n\t\tf[\"paths\"].setValue( IECore.StringVectorData( [ \"/group\", \"/group/plane\" ] ) )\n\n\t\tself.assertSceneValid( t[\"out\"] )\n\n\t\tself.assertEqual( t[\"out\"].transform( \"/group\" ), IECore.M44f() )\n\t\tself.assertEqual( t[\"out\"].transform( \"/group/plane\" ), IECore.M44f() )\n\t\tself.assertEqual( t[\"out\"].transform( \"/group/plane1\" ), IECore.M44f.createTranslated( IECore.V3f( 1, 2, 3 ) ) )\n\n\t\tself.assertEqual( t[\"out\"].bound( \"/group/plane\" ), IECore.Box3f( IECore.V3f( 1.5, 1.5, 3 ), IECore.V3f( 2.5, 2.5, 3 ) ) )\n\t\tself.assertEqual( t[\"out\"].bound( \"/group/plane1\" ), IECore.Box3f( IECore.V3f( 0.5, -0.5, 0 ), IECore.V3f( 1.5, 0.5, 0 ) ) )", "metadata": "root.FreezeTransformTest.testFilter", "header": "['class', 'FreezeTransformTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 60 }, { "content": "\tdef testAffects( self ) :\n\n\t\tt = GafferScene.FreezeTransform()\n\t\tself.assertEqual( set( t.affects( t[\"in\"][\"object\"] ) ), set( [ t[\"out\"][\"object\"] ] ) )", "metadata": "root.FreezeTransformTest.testAffects", "header": "['class', 'FreezeTransformTest', '(', 'GafferSceneTest', '.', 'SceneTestCase', ')', ':', '___EOS___']", "index": 103 } ]
[ { "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", ",", " ", "Joh", "n", " ", "Had", "don", ".", " ", "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", "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_", "Freez", "e", "Transform", "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_", "[SEP]_", "class_", "Freez", "e", "Transform", "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_", "p_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "[_", "\"", "transform", "\"_", "]_", "[_", "\"", "translat", "e", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "Ga", "ffer", "Scene_", "._", "Freez", "e", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "p_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "bound_", "(_", "\"/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "1.5_", ",_", "3_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "2.5_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "object_", "(_", "\"/", "plane", "\"_", ")_", "._", "bound_", "(_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "1.5_", ",_", "3_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "2.5_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Freez", "e", "Transform", "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", "Filter_", "(_", "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_", "p1_", "[_", "\"", "transform", "\"_", "]_", "[_", "\"", "translat", "e", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "p2_", "=_", "Ga", "ffer", "Scene_", "._", "Plane_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p2_", "[_", "\"", "transform", "\"_", "]_", "[_", "\"", "translat", "e", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "g_", "=_", "Ga", "ffer", "Scene_", "._", "Group_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "g_", "[_", "\"", "transform", "\"_", "]_", "[_", "\"", "translat", "e", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "0_", ",_", "0_", ")_", ")_", "\\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_", "f_", "=_", "Ga", "ffer", "Scene_", "._", "Path", "Filter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "t_", "=_", "Ga", "ffer", "Scene_", "._", "Freez", "e", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "\"", "in", "\"_", "]_", "._", "set", "Input_", "(_", "g_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "[_", "\"", "filter", "\"_", "]_", "._", "set", "Input_", "(_", "f_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "._", "create", "Translate", "d_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "0_", ",_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "._", "create", "Translate", "d_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "bound_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "1.5_", ",_", "3_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "2.5_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "bound_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "-_", "0.5_", ",_", "-_", "0.5_", ",_", "0_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "0.5_", ",_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "object_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", "._", "bound_", "(_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "1.5_", ",_", "3_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "2.5_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "object_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", "._", "bound_", "(_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "-_", "0.5_", ",_", "-_", "0.5_", ",_", "0_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "0.5_", ",_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "f_", "[_", "\"", "path", "s", "\"_", "]_", "._", "set", "Value_", "(_", "IE", "Core_", "._", "String", "Vector", "Data_", "(_", "[_", "\"/", "group", "\"_", ",_", "\"/", "group", "/", "plane", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Scen", "e", "Valid_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "transform_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ",_", "IE", "Core_", "._", "M", "4", "4f", "_", "._", "create", "Translate", "d_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1_", ",_", "2_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "bound_", "(_", "\"/", "group", "/", "plane", "\"_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "1.5_", ",_", "3_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "2.5_", ",_", "2.5_", ",_", "3_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "t_", "[_", "\"", "out", "\"_", "]_", "._", "bound_", "(_", "\"/", "group", "/", "plane", "1", "\"_", ")_", ",_", "IE", "Core_", "._", "Box", "3f", "_", "(_", "IE", "Core_", "._", "V3", "f_", "(_", "0.5_", ",_", "-_", "0.5_", ",_", "0_", ")_", ",_", "IE", "Core_", "._", "V3", "f_", "(_", "1.5_", ",_", "0.5_", ",_", "0_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Freez", "e", "Transform", "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_", "t_", "=_", "Ga", "ffer", "Scene_", "._", "Freez", "e", "Transform_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "set_", "(_", "t_", "._", "affect", "s_", "(_", "t_", "[_", "\"", "in", "\"_", "]_", "[_", "\"", "object", "\"_", "]_", ")_", ")_", ",_", "set_", "(_", "[_", "t_", "[_", "\"", "out", "\"_", "]_", "[_", "\"", "object", "\"_", "]_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
nasa/mplStyle/mplStyle/types/StyleProperty.py
[ { "content": "#===========================================================================\n#\n# Copyright (c) 2014, California Institute of Technology.\n# U.S. Government Sponsorship under NASA Contract NAS7-03001 is\n# acknowledged. 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# 1. Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# \n# 2. Redistributions in binary form must reproduce the above copyright\n# notice, this list of conditions and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# \n# 3. Neither the name of the copyright holder nor the names of its\n# contributors may be used to endorse or promote products derived from\n# this software without specific prior written permission.\n# \n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n#===========================================================================\n\n\"\"\": StyleProperty module.\"\"\"\n\n__version__ = \"$Revision: #1 $\"\n\n#===========================================================================\nfrom . import util\nimport weakref\nfrom copy import copy\n#===========================================================================\n\n__all__ = [ 'StyleProperty' ]\n\n#===========================================================================\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class StyleProperty( object ):\n \"\"\": The base class of all style types.\n\n Derivations of this class should overload the 'validate' method to\n determine what is a valid value for that Style property type.\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.StyleProperty", "header": "['module', '___EOS___']", "index": 48 }, { "content": " def __init__( self, default, validator = None, doc = \"\" ):\n \"\"\": Create a new Style object.\n\n = INPUT VARIABLES\n - default The default value that instances will be initialized with.\n \"\"\"\n # The default value for the class instance\n self._default = None\n\n # The name of the property. This will be set by the class creator.\n self._name = None\n\n # The class this property is associated with\n self._owner = None\n\n # An optional callable object that will validate an object assigned\n # to this property.\n self.validator = validator\n\n # Set the docstring for this property.\n self.__doc__ = doc\n\n # Set and validate the default value\n self.default = default", "metadata": "root.StyleProperty.__init__", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 56 }, { "content": " @property\n def name( self ):\n \"\"\": The name of the instance of this property type.\n \"\"\"\n # We really-really do not want anybody changing the name of each property\n # instance, so we make this read-only.\n return self._name", "metadata": "root.StyleProperty.name", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 82 }, { "content": " @property\n def owner( self ):\n \"\"\": The class that owns this property instance.\n \"\"\"\n # We really-really do not want anybody changing the this of each property\n # instance, so we make this read-only.\n return self._owner", "metadata": "root.StyleProperty.owner", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": " @property\n def default( self ):\n \"\"\": The default value for instances of this property type.\n \"\"\"\n return self._default", "metadata": "root.StyleProperty.default", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 100 }, { "content": " @default.setter\n def default( self, value ):\n \"\"\": Validate and set the default value.\n\n = INPUT VARIABLES\n - value The value to use for the default.\n \"\"\"\n self._default = self.validate( value )", "metadata": "root.StyleProperty.default", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 106 }, { "content": " def initialize( self, instance, memberName, kwargs ):\n \"\"\": Set the named property to the default value.\n\n = INPUT VARIABLES\n - instance The class instance that contains the property to be set.\n - memberName The name of the member to be set to the default value.\n - kwargs A dictionary of possible initial values to search for an\n initial value to use for this property. If a value is\n found for this property, it will be removed from the\n dictionary.\n \"\"\"\n # Determine the initial value\n if memberName in kwargs:\n value = kwargs.pop( memberName )\n else:\n # We must create a copy of the default value, otherwise we\n # might accidentally change the default value. This is\n # particularly true if the default is a container object.\n value = copy( self.default )\n\n # Set the new copy as an instance member.\n # This will end up calling __set__.\n setattr( instance, memberName, value )", "metadata": "root.StyleProperty.initialize", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 116 }, { "content": " def validate( self, value ):\n \"\"\": Validate and return a valid value\n\n = ERROR CONDITIONS\n - Will throw an exception if the specified value is invalid.\n\n = INPUT VARIABLES\n - value The value to set the instance of this property to.\n\n = RETURN VALUE\n - Returns a valid value.\n \"\"\"\n if self.validator:\n try:\n result = self.validator( value )\n return result\n except Exception, e:\n name = self.name\n if self.owner:\n name = \"%s.%s\" % ( self.owner.__name__, name )\n msg = \"Error trying to validate the '%s' property.\" % name\n raise util.mergeExceptions( e, msg )\n else:\n # accept whatever it is given.\n return value", "metadata": "root.StyleProperty.validate", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 141 }, { "content": " def __call__( self, value ):\n \"\"\": This will perform validation of the value\n\n = ERROR CONDITIONS\n - Will throw an exception if the specified value is invalid.\n\n = INPUT VARIABLES\n - value The value to set the instance of this property to.\n\n = RETURN VALUE\n - Returns a valid value.\n \"\"\"\n return self.validate( value )", "metadata": "root.StyleProperty.__call__", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 168 }, { "content": " def __str__( self ):\n \"\"\": Get a string representation of this instance.\n\n = RETURN VALUE\n - Returns a string represnetation of this property.\n \"\"\"\n if self.owner:\n return \"%s: %s.%s\" % \\\n ( self.__class__.__name__,\n self.owner.__name__,\n self.name )\n elif self.name:\n return \"%s: %s\" % ( self.__class__.__name__, self.name )\n else:\n return \"%s\" % ( self.__class__.__name__ )", "metadata": "root.StyleProperty.__str__", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 183 }, { "content": " def __get__( self, instance, owner ):\n \"\"\": Get the value stored for the instance of this class.\n\n The presence of the __get__ and __set__ methods let python know that\n this is a 'descriptor' class. This allows us to control how \n instances of this class act when being get and/or set.\n\n The actual value is stored in the instance's __dict__\n\n = INPUT VARIABLES\n - instance The class (or container) instance that owns an instance\n of this class. Since the StyleProperty class is only used\n to define style properties in sub-classes of SubStyle,\n we can assume that the instance is a sub-class of SubStyle.\n - owner The class type of the instance that owns an instance of\n this class.\n\n = RETURN VALUE\n - Returns the value for this stype type instance.\n \"\"\"\n if instance:\n # Return the value stored in the class instance\n return instance.__dict__[ self.name ]\n\n else:\n # We are getting the value from the class and not from the\n # class instance.\n return self", "metadata": "root.StyleProperty.__get__", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 200 }, { "content": " def __set__( self, instance, value ):\n \"\"\": Set the value stored for the instance of this class.\n\n The presence of the __get__ and __set__ methods let python know that\n this is a 'descriptor' class. This allows us to control how \n instances of this class act when being get and/or set.\n\n Oddly enough, when we call 'setattr' on the class instance that cotains\n this instance, this function is called and the value is never set in \n the instance class' __dict__. So we store the actual value in the\n instance's __dict__\n\n = INPUT VARIABLES\n - instance The class (or container) instance that owns an instance\n of this class. Since the StyleProperty class is only used\n to define style properties in sub-classes of SubStyle,\n we can assume that the instance is a sub-class of SubStyle.\n - value The value to set. This will be validated first.\n\n \"\"\"\n instance.__dict__[ self.name ] = self.validate( value )", "metadata": "root.StyleProperty.__set__", "header": "['class', 'StyleProperty', '(', 'object', ')', ':', '___EOS___']", "index": 230 } ]
[ { "span": "import weakref", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 14 } ]
[]
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", ",", " ", "Cali", "for", "nia", " ", "Institut", "e", " ", "of", " ", "Techno", "log", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "U", ".", "S", ".", " ", "Gov", "ern", "ment", " ", "Spo", "nsor", "ship", " ", "under", " ", "NAS", "A", " ", "Contract", " ", "NAS", "7", "-0", "3001", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "acknowledge", "d", ".", " ", " ", "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_", "#", " ", "1", ".", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyright_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "3", ".", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "copyr", "ight", " ", "holder", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products", " ", "derive", "d", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "permissi", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "AS", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIGHT_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HOLD", "ER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "OF", " ", "THIS", " ", "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_", "\"\"\"", ":", " ", "Style", "Proper", "ty", " ", "module", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "\"$", "Revi", "sion", ":", " ", "#", "1", " ", "$\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "=====", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "weakref_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "copy_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "=====", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "all\\u\\u_", "=_", "[_", "'", "Style", "Proper", "ty", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "==============", "==============", "==============", "==============", "==============", "=====", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "The", " ", "base", " ", "class", " ", "of", " ", "all", " ", "style", " ", "types", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "Derivati", "ons", " ", "of", " ", "this", " ", "class", " ", "shou", "ld", " ", "overload", " ", "the", " ", "'", "validat", "e", "'", " ", "method", " ", "to", "\\", "10", ";", " ", " ", " ", "dete", "rmin", "e", " ", "what", " ", "is", " ", "a", " ", "valid", " ", "value", " ", "for", " ", "tha", "t", " ", "Style", " ", "property", " ", "type", ".", "\\", "10", ";", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "--------------", "--------------", "--------------", "--------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "default_", ",_", "validator_", "=_", "None_", ",_", "doc_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Creat", "e", " ", "a", " ", "new", " ", "Style", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "default", " ", "The", " ", "default", " ", "value", " ", "tha", "t", " ", "instance", "s", " ", "will", " ", "be", " ", "initialize", "d", " ", "with", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "default", " ", "value", " ", "for", " ", "the", " ", "class", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "default_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "property", ".", " ", " ", "Thi", "s", " ", "will", " ", "be", " ", "set", " ", "by", " ", "the", " ", "class", " ", "creat", "or", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "name_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "class", " ", "this", " ", "property", " ", "is", " ", "associate", "d", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "owner_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "option", "al", " ", "calla", "ble", " ", "object", " ", "tha", "t", " ", "will", " ", "validat", "e", " ", "an", " ", "object", " ", "assigned_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "this", " ", "property", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "validator_", "=_", "validator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "docstr", "ing", " ", "for", " ", "this", " ", "property", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "doc\\u\\u_", "=_", "doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "and", " ", "validat", "e", " ", "the", " ", "default", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "default_", "=_", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "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_", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "The", " ", "name", " ", "of", " ", "the", " ", "instance", " ", "of", " ", "this", " ", "property", " ", "type", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "reall", "y", "-", "reall", "y", " ", "do", " ", "not", " ", "want", " ", "any", "body", " ", "chang", "ing", " ", "the", " ", "name", " ", "of", " ", "each", " ", "property_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", ",", " ", "so", " ", "we", " ", "make", " ", "this", " ", "read", "-", "only", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "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_", "owner_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "The", " ", "class", " ", "tha", "t", " ", "owns", " ", "this", " ", "property", " ", "instance", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "reall", "y", "-", "reall", "y", " ", "do", " ", "not", " ", "want", " ", "any", "body", " ", "chang", "ing", " ", "the", " ", "this", " ", "of", " ", "each", " ", "property_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "instance", ",", " ", "so", " ", "we", " ", "make", " ", "this", " ", "read", "-", "only", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "owner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "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_", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "The", " ", "default", " ", "value", " ", "for", " ", "instance", "s", " ", "of", " ", "this", " ", "property", " ", "type", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "default_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "default_", "._", "setter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "default_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Validate", " ", "and", " ", "set", " ", "the", " ", "default", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "value", " ", " ", " ", "The", " ", "value", " ", "to", " ", "use", " ", "for", " ", "the", " ", "default", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "default_", "=_", "self_", "._", "validate_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "initialize_", "(_", "self_", ",_", "instance_", ",_", "member", "Name_", ",_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Set", " ", "the", " ", "named", " ", "property", " ", "to", " ", "the", " ", "default", " ", "value", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "instance", " ", " ", " ", " ", "The", " ", "class", " ", "instance", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "property", " ", "to", " ", "be", " ", "set", ".", "\\", "10", ";", " ", " ", "-", " ", "member", "Name", " ", " ", "The", " ", "name", " ", "of", " ", "the", " ", "member", " ", "to", " ", "be", " ", "set", " ", "to", " ", "the", " ", "default", " ", "value", ".", "\\", "10", ";", " ", " ", "-", " ", "kwarg", "s", " ", " ", "A", " ", "dictionar", "y", " ", "of", " ", "possib", "le", " ", "initial", " ", "values", " ", "to", " ", "search", " ", "for", " ", "an", "\\", "10", ";", " ", " ", "initial", " ", "value", " ", "to", " ", "use", " ", "for", " ", "this", " ", "property", ".", " ", " ", "If", " ", "a", " ", "value", " ", "is", "\\", "10", ";", " ", " ", "found", " ", "for", " ", "this", " ", "property", ",", " ", "it", " ", "will", " ", "be", " ", "remove", "d", " ", "from", " ", "the", "\\", "10", ";", " ", " ", "dictionar", "y", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Det", "erm", "ine", " ", "the", " ", "initial", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "member", "Name_", "in_", "kwargs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "kwargs_", "._", "pop_", "(_", "member", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "must", " ", "create", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "default", " ", "value", ",", " ", "other", "wis", "e", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "mig", "ht", " ", "accident", "ally", " ", "change", " ", "the", " ", "default", " ", "value", ".", " ", " ", "Thi", "s", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "partic", "ular", "ly", " ", "true", " ", "if", " ", "the", " ", "default", " ", "is", " ", "a", " ", "container", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "copy_", "(_", "self_", "._", "default_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "new", " ", "copy", " ", "as", " ", "an", " ", "instance", " ", "member", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "will", " ", "end", " ", "up", " ", "calling", " ", "\\u\\u", "set\\u", "\\u.", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "setattr_", "(_", "instance_", ",_", "member", "Name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "validate_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Validate", " ", "and", " ", "return", " ", "a", " ", "valid", " ", "value", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "ERROR", " ", "CONDITION", "S", "\\", "10", ";", " ", " ", "-", " ", "Wil", "l", " ", "throw", " ", "an", " ", "exception", " ", "if", " ", "the", " ", "specified", " ", "value", " ", "is", " ", "invalid", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "value", " ", " ", " ", "The", " ", "value", " ", "to", " ", "set", " ", "the", " ", "instance", " ", "of", " ", "this", " ", "property", " ", "to", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "RETURN", " ", "VALU", "E", "\\", "10", ";", " ", " ", "-", " ", "Return", "s", " ", "a", " ", "valid", " ", "value", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "validator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "validator_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "result_", "\\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 ", " _", "name_", "=_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "owner_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "self_", "._", "owner_", "._", "\\u\\u", "name\\u\\u_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"", "Error", " ", "try", "ing", " ", "to", " ", "validat", "e", " ", "the", " ", "'%", "s", "'", " ", "property", ".\"_", "%_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "util_", "._", "merge", "Exceptions_", "(_", "e_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "accept", " ", "what", "ever", " ", "it", " ", "is", " ", "give", "n", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Thi", "s", " ", "will", " ", "perform", " ", "validation", " ", "of", " ", "the", " ", "value", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "ERROR", " ", "CONDITION", "S", "\\", "10", ";", " ", " ", "-", " ", "Wil", "l", " ", "throw", " ", "an", " ", "exception", " ", "if", " ", "the", " ", "specified", " ", "value", " ", "is", " ", "invalid", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "value", " ", " ", " ", "The", " ", "value", " ", "to", " ", "set", " ", "the", " ", "instance", " ", "of", " ", "this", " ", "property", " ", "to", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "RETURN", " ", "VALU", "E", "\\", "10", ";", " ", " ", "-", " ", "Return", "s", " ", "a", " ", "valid", " ", "value", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "validate_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "str\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Get", " ", "a", " ", "string", " ", "represent", "ation", " ", "of", " ", "this", " ", "instance", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "RETURN", " ", "VALU", "E", "\\", "10", ";", " ", " ", "-", " ", "Return", "s", " ", "a", " ", "string", " ", "repr", "esn", "eta", "tion", " ", "of", " ", "this", " ", "property", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "owner_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", ":", " ", "%", "s", ".", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "owner_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "self_", "._", "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 ", " _", "return_", "\"%", "s", "\"_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "get\\u\\u_", "(_", "self_", ",_", "instance_", ",_", "owner_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Get", " ", "the", " ", "value", " ", "store", "d", " ", "for", " ", "the", " ", "instance", " ", "of", " ", "this", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "The", " ", "presen", "ce", " ", "of", " ", "the", " ", "\\u\\u", "get", "\\u\\u", " ", "and", " ", "\\u\\u", "set\\u", "\\u", " ", "method", "s", " ", "let", " ", "python", " ", "know", " ", "tha", "t", "\\", "10", ";", " ", " ", "this", " ", "is", " ", "a", " ", "'", "descrip", "tor", "'", " ", "class", ".", " ", " ", "Thi", "s", " ", "allow", "s", " ", "us", " ", "to", " ", "control", " ", "how", " ", "\\", "10", ";", " ", " ", "instance", "s", " ", "of", " ", "this", " ", "class", " ", "act", " ", "whe", "n", " ", "bei", "ng", " ", "get", " ", "and", "/", "or", " ", "set", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "The", " ", "actual", " ", "value", " ", "is", " ", "store", "d", " ", "in", " ", "the", " ", "instance", "'", "s", " ", "\\u\\u", "dict", "\\u\\u", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "instance", " ", " ", " ", " ", "The", " ", "class", " ", "(", "or", " ", "container", ")", " ", "instance", " ", "tha", "t", " ", "owns", " ", "an", " ", "instance", "\\", "10", ";", " ", " ", "of", " ", "this", " ", "class", ".", " ", " ", "Sin", "ce", " ", "the", " ", "Style", "Proper", "ty", " ", "class", " ", "is", " ", "only", " ", "used", "\\", "10", ";", " ", " ", "to", " ", "defin", "e", " ", "style", " ", "proper", "ties", " ", "in", " ", "sub", "-", "classe", "s", " ", "of", " ", "Sub", "Style", ",", "\\", "10", ";", " ", " ", "we", " ", "can", " ", "assume", " ", "tha", "t", " ", "the", " ", "instance", " ", "is", " ", "a", " ", "sub", "-", "class", " ", "of", " ", "Sub", "Style", ".", "\\", "10", ";", " ", " ", "-", " ", "owner", " ", " ", " ", "The", " ", "class", " ", "type", " ", "of", " ", "the", " ", "instance", " ", "tha", "t", " ", "owns", " ", "an", " ", "instance", " ", "of", "\\", "10", ";", " ", " ", "this", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "RETURN", " ", "VALU", "E", "\\", "10", ";", " ", " ", "-", " ", "Return", "s", " ", "the", " ", "value", " ", "for", " ", "this", " ", "sty", "pe", " ", "type", " ", "instance", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "instance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Return", " ", "the", " ", "value", " ", "store", "d", " ", "in", " ", "the", " ", "class", " ", "instance_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "instance_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", " ", "are", " ", "getti", "ng", " ", "the", " ", "value", " ", "from", " ", "the", " ", "class", " ", "and", " ", "not", " ", "from", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "class", " ", "instance", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Style", "Property_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "set\\u", "\\u_", "(_", "self_", ",_", "instance_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", ":", " ", "Set", " ", "the", " ", "value", " ", "store", "d", " ", "for", " ", "the", " ", "instance", " ", "of", " ", "this", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "The", " ", "presen", "ce", " ", "of", " ", "the", " ", "\\u\\u", "get", "\\u\\u", " ", "and", " ", "\\u\\u", "set\\u", "\\u", " ", "method", "s", " ", "let", " ", "python", " ", "know", " ", "tha", "t", "\\", "10", ";", " ", " ", "this", " ", "is", " ", "a", " ", "'", "descrip", "tor", "'", " ", "class", ".", " ", " ", "Thi", "s", " ", "allow", "s", " ", "us", " ", "to", " ", "control", " ", "how", " ", "\\", "10", ";", " ", " ", "instance", "s", " ", "of", " ", "this", " ", "class", " ", "act", " ", "whe", "n", " ", "bei", "ng", " ", "get", " ", "and", "/", "or", " ", "set", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "Od", "dl", "y", " ", "eno", "ugh", ",", " ", "whe", "n", " ", "we", " ", "call", " ", "'", "setattr", "'", " ", "on", " ", "the", " ", "class", " ", "instance", " ", "tha", "t", " ", "cot", "ain", "s", "\\", "10", ";", " ", " ", "this", " ", "instance", ",", " ", "this", " ", "function", " ", "is", " ", "call", "ed", " ", "and", " ", "the", " ", "value", " ", "is", " ", "neve", "r", " ", "set", " ", "in", " ", "\\", "10", ";", " ", " ", "the", " ", "instance", " ", "class", "'", " ", "\\u\\u", "dict", "\\u\\u", ".", " ", "So", " ", "we", " ", "store", " ", "the", " ", "actual", " ", "value", " ", "in", " ", "the", "\\", "10", ";", " ", " ", "instance", "'", "s", " ", "\\u\\u", "dict", "\\u\\u", "\\", "10", ";", "\\", "10", ";", " ", " ", "=", " ", "INPUT", " ", "VARIABLES", "\\", "10", ";", " ", " ", "-", " ", "instance", " ", " ", " ", " ", "The", " ", "class", " ", "(", "or", " ", "container", ")", " ", "instance", " ", "tha", "t", " ", "owns", " ", "an", " ", "instance", "\\", "10", ";", " ", " ", "of", " ", "this", " ", "class", ".", " ", " ", "Sin", "ce", " ", "the", " ", "Style", "Proper", "ty", " ", "class", " ", "is", " ", "only", " ", "used", "\\", "10", ";", " ", " ", "to", " ", "defin", "e", " ", "style", " ", "proper", "ties", " ", "in", " ", "sub", "-", "classe", "s", " ", "of", " ", "Sub", "Style", ",", "\\", "10", ";", " ", " ", "we", " ", "can", " ", "assume", " ", "tha", "t", " ", "the", " ", "instance", " ", "is", " ", "a", " ", "sub", "-", "class", " ", "of", " ", "Sub", "Style", ".", "\\", "10", ";", " ", " ", "-", " ", "value", " ", " ", " ", "The", " ", "value", " ", "to", " ", "set", ".", " ", " ", "Thi", "s", " ", "will", " ", "be", " ", "validat", "ed", " ", "first", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instance_", "._", "\\u\\u", "dict\\u\\u_", "[_", "self_", "._", "name_", "]_", "=_", "self_", "._", "validate_", "(_", "value_", ")_", "\\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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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 ]
Unused import
enthought/envisage/envisage/ui/tasks/tasks_application.py
[ { "content": "# Standard library imports.\nimport logging\nimport os.path\n\n# Enthought library imports.\nfrom envisage.api import Application, ExtensionPoint\nfrom pyface.api import GUI, SplashScreen\nfrom pyface.image_resource import ImageResource\nfrom pyface.tasks.api import TaskLayout, TaskWindowLayout\nfrom traits.api import Bool, Callable, Directory, Event, HasStrictTraits, \\\n Instance, Int, List, Property, Str, Unicode, Vetoable\nfrom traits.etsconfig.api import ETSConfig\n\n# Local imports\nfrom .task_window import TaskWindow\nfrom .task_window_event import TaskWindowEvent, VetoableTaskWindowEvent\nfrom envisage._compat import pickle, STRING_BASE_CLASS\n\n\n# Logging.\nlogger = logging.getLogger(__name__)\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TasksApplication(Application):\n \"\"\" The entry point for an Envisage Tasks application.\n\n This class handles the common case for Tasks applications and is intended to\n be subclassed to modify its start/stop behavior, etc.\n \"\"\"\n\n # Extension point IDs.\n TASK_FACTORIES = 'envisage.ui.tasks.tasks'\n TASK_EXTENSIONS = 'envisage.ui.tasks.task_extensions'\n\n #### 'TasksApplication' interface #########################################\n\n # The active task window (the last one to get focus).\n active_window = Instance(TaskWindow)\n\n # The PyFace GUI for the application.\n gui = Instance(GUI)\n\n # Icon for the whole application. Will be used to override all taskWindows\n # icons to have the same.\n icon = Instance(ImageResource, allow_none=True) #Any\n\n # The name of the application (also used on window title bars).\n name = Unicode\n\n # The splash screen for the application. By default, there is no splash\n # screen.\n splash_screen = Instance(SplashScreen)\n\n # The directory on the local file system used to persist window layout\n # information.\n state_location = Directory\n\n # Contributed task factories. This attribute is primarily for run-time\n # inspection; to instantiate a task, use the 'create_task' method.\n task_factories = ExtensionPoint(id=TASK_FACTORIES)\n\n # Contributed task extensions.\n task_extensions = ExtensionPoint(id=TASK_EXTENSIONS)\n\n # The list of task windows created by the application.\n windows = List(TaskWindow)\n\n # The factory for creating task windows.\n window_factory = Callable(TaskWindow)\n\n #### Application layout ###################################################\n\n # The default layout for the application. If not specified, a single window\n # will be created with the first available task factory.\n default_layout = List(TaskWindowLayout)\n\n # Whether to always apply the default *application level* layout when the\n # application is started. Even if this is False, the layout state of\n # individual tasks will be restored.\n always_use_default_layout = Bool(False)\n\n #### Application lifecycle events #########################################\n\n # Fired after the initial windows have been created and the GUI event loop\n # has been started.\n application_initialized = Event\n\n # Fired immediately before the extant windows are destroyed and the GUI\n # event loop is terminated.\n application_exiting = Event\n\n # Fired when a task window has been created.\n window_created = Event(TaskWindowEvent)\n\n # Fired when a task window is opening.\n window_opening = Event(VetoableTaskWindowEvent)\n\n # Fired when a task window has been opened.\n window_opened = Event(TaskWindowEvent)\n\n # Fired when a task window is closing.\n window_closing = Event(VetoableTaskWindowEvent)\n\n # Fired when a task window has been closed.\n window_closed = Event(TaskWindowEvent)\n\n #### Protected interface ##################################################\n\n # An 'explicit' exit is when the the 'exit' method is called.\n # An 'implicit' exit is when the user closes the last open window.\n _explicit_exit = Bool(False)\n\n # Application state.\n _state = Instance('envisage.ui.tasks.tasks_application.'\n 'TasksApplicationState')\n\n ###########################################################################\n # 'IApplication' interface.\n ###########################################################################\n\n\n ###########################################################################\n # 'TasksApplication' interface.\n ###########################################################################\n\n\n\n\n ###########################################################################\n # Protected interface.\n ###########################################################################\n\n\n\n\n\n\n\n #### Trait initializers ###################################################\n\n\n\n\n #### Trait change handlers ################################################\n\n\n\n\n", "metadata": "root.TasksApplication", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def run(self):\n \"\"\" Run the application.\n\n Returns:\n --------\n Whether the application started successfully (i.e., without a veto).\n \"\"\"\n # Make sure the GUI has been created (so that, if required, the splash\n # screen is shown).\n gui = self.gui\n\n started = self.start()\n if started:\n # Create windows from the default or saved application layout.\n self._create_windows()\n\n # Start the GUI event loop.\n gui.set_trait_later(self, 'application_initialized', self)\n gui.start_event_loop()\n\n return started", "metadata": "root.TasksApplication.run", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 120 }, { "content": " def create_task(self, id):\n \"\"\" Creates the Task with the specified ID.\n\n Returns:\n --------\n The new Task, or None if there is not a suitable TaskFactory.\n \"\"\"\n # Get the factory for the task.\n factory = self._get_task_factory(id)\n if factory is None:\n return None\n\n # Create the task using suitable task extensions.\n extensions = [ ext for ext in self.task_extensions\n if ext.task_id == id or not ext.task_id ]\n task = factory.create_with_extensions(extensions)\n task.id = factory.id\n return task", "metadata": "root.TasksApplication.create_task", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 146 }, { "content": " def create_window(self, layout=None, restore=True, **traits):\n \"\"\" Creates a new TaskWindow, possibly with some Tasks.\n\n Parameters:\n -----------\n layout : TaskWindowLayout, optional\n The layout to use for the window. The tasks described in the layout\n will be created and added to the window automatically. If not\n specified, the window will contain no tasks.\n\n restore : bool, optional (default True)\n If set, the application will restore old size and positions for the\n window and its panes, if possible. If a layout is not provided,\n this parameter has no effect.\n\n **traits : dict, optional\n Additional parameters to pass to ``window_factory()`` when creating\n the TaskWindow.\n\n Returns:\n --------\n The new TaskWindow.\n \"\"\"\n window = self.window_factory(application=self, **traits)\n\n # Listen for the window events.\n window.on_trait_change(self._on_window_activated, 'activated')\n window.on_trait_change(self._on_window_opening, 'opening')\n window.on_trait_change(self._on_window_opened, 'opened')\n window.on_trait_change(self._on_window_closing, 'closing')\n window.on_trait_change(self._on_window_closed, 'closed')\n\n # Event notification.\n self.window_created = TaskWindowEvent(window=window)\n\n if layout:\n # Create and add tasks.\n for task_id in layout.get_tasks():\n task = self.create_task(task_id)\n if task:\n window.add_task(task)\n else:\n logger.error('Missing factory for task with ID %r', task_id)\n\n # Apply a suitable layout.\n if restore:\n layout = self._restore_layout_from_state(layout)\n else:\n # Create an empty layout to set default size and position only\n layout = TaskWindowLayout()\n\n window.set_window_layout(layout)\n\n return window", "metadata": "root.TasksApplication.create_window", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 165 }, { "content": " def exit(self, force=False):\n \"\"\" Exits the application, closing all open task windows.\n\n Each window is sent a veto-able closing event. If any window vetoes the\n close request, no window will be closed. Otherwise, all windows will be\n closed and the GUI event loop will terminate.\n\n This method is not called when the user clicks the close button on a\n window or otherwise closes a window through his or her window\n manager. It is only called via the File->Exit menu item. It can also, of\n course, be called programatically.\n\n Parameters:\n -----------\n force : bool, optional (default False)\n If set, windows will receive no closing events and will be destroyed\n unconditionally. This can be useful for reliably tearing down\n regression tests, but should be used with caution.\n\n Returns:\n --------\n A boolean indicating whether the application exited.\n \"\"\"\n self._explicit_exit = True\n try:\n if not force:\n for window in reversed(self.windows):\n window.closing = event = Vetoable()\n if event.veto:\n return False\n\n self._prepare_exit()\n for window in reversed(self.windows):\n window.destroy()\n window.closed = True\n finally:\n self._explicit_exit = False\n return True", "metadata": "root.TasksApplication.exit", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 220 }, { "content": " def _create_windows(self):\n \"\"\" Called at startup to create TaskWindows from the default or saved\n application layout.\n \"\"\"\n # Build a list of TaskWindowLayouts.\n self._load_state()\n if self.always_use_default_layout or \\\n not self._state.previous_window_layouts:\n window_layouts = self.default_layout\n else:\n # Choose the stored TaskWindowLayouts, but only if all the task IDs\n # are still valid.\n window_layouts = self._state.previous_window_layouts\n for layout in window_layouts:\n for task_id in layout.get_tasks():\n if not self._get_task_factory(task_id):\n logger.warning('Saved application layout references '\n 'non-existent task %r. Falling back to '\n 'default application layout.' % task_id)\n window_layouts = self.default_layout\n break\n else:\n continue\n break\n\n # Create a TaskWindow for each TaskWindowLayout.\n for window_layout in window_layouts:\n window = self.create_window(window_layout,\n restore=self.always_use_default_layout)\n window.open()", "metadata": "root.TasksApplication._create_windows", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 263 }, { "content": " def _get_task_factory(self, id):\n \"\"\" Returns the TaskFactory with the specified ID, or None.\n \"\"\"\n for factory in self.task_factories:\n if factory.id == id:\n return factory\n return None", "metadata": "root.TasksApplication._get_task_factory", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 294 }, { "content": " def _prepare_exit(self):\n \"\"\" Called immediately before the extant windows are destroyed and the\n GUI event loop is terminated.\n \"\"\"\n self.application_exiting = self\n self._save_state()", "metadata": "root.TasksApplication._prepare_exit", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 302 }, { "content": " def _load_state(self):\n \"\"\" Loads saved application state, if possible.\n \"\"\"\n state = TasksApplicationState()\n filename = os.path.join(self.state_location, 'application_memento')\n if os.path.exists(filename):\n # Attempt to unpickle the saved application state.\n try:\n with open(filename, 'r') as f:\n restored_state = pickle.load(f)\n if state.version == restored_state.version:\n state = restored_state\n else:\n logger.warn('Discarding outdated application layout')\n except:\n # If anything goes wrong, log the error and continue.\n logger.exception('Restoring application layout from %s',\n filename)\n self._state = state", "metadata": "root.TasksApplication._load_state", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 309 }, { "content": " def _restore_layout_from_state(self, layout):\n \"\"\" Restores an equivalent layout from saved application state.\n \"\"\"\n # First, see if a window layout matches exactly.\n match = self._state.get_equivalent_window_layout(layout)\n if match:\n # The active task is not part of the equivalency relation, so we\n # ensure that it is correct.\n match.active_task = layout.get_active_task()\n layout = match\n\n # If that fails, at least try to restore the layout of individual tasks.\n else:\n layout = layout.clone_traits()\n for i, item in enumerate(layout.items):\n id = item if isinstance(item, STRING_BASE_CLASS) else item.id\n match = self._state.get_task_layout(id)\n if match:\n layout.items[i] = match\n\n return layout", "metadata": "root.TasksApplication._restore_layout_from_state", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 329 }, { "content": " def _save_state(self):\n \"\"\" Saves the application state.\n \"\"\"\n # Grab the current window layouts.\n window_layouts = [ w.get_window_layout() for w in self.windows ]\n self._state.previous_window_layouts = window_layouts\n\n # Attempt to pickle the application state.\n filename = os.path.join(self.state_location, 'application_memento')\n try:\n with open(filename, 'w') as f:\n pickle.dump(self._state, f)\n except:\n # If anything goes wrong, log the error and continue.\n logger.exception('Saving application layout')", "metadata": "root.TasksApplication._save_state", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 351 }, { "content": " def _default_layout_default(self):\n window_layout = TaskWindowLayout()\n if self.task_factories:\n window_layout.items = [ self.task_factories[0].id ]\n return [ window_layout ]", "metadata": "root.TasksApplication._default_layout_default", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 369 }, { "content": " def _gui_default(self):\n return GUI(splash_screen=self.splash_screen)", "metadata": "root.TasksApplication._gui_default", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 375 }, { "content": " def _state_location_default(self):\n state_location = os.path.join(ETSConfig.application_home,\n 'tasks', ETSConfig.toolkit)\n if not os.path.exists(state_location):\n os.makedirs(state_location)\n\n logger.debug('Tasks state location is %s', state_location)\n\n return state_location", "metadata": "root.TasksApplication._state_location_default", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 378 }, { "content": " def _on_window_activated(self, window, trait_name, event):\n self.active_window = window", "metadata": "root.TasksApplication._on_window_activated", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 390 }, { "content": " def _on_window_opening(self, window, trait_name, event):\n # Event notification.\n self.window_opening = window_event = VetoableTaskWindowEvent(\n window=window)\n\n if window_event.veto:\n event.veto = True", "metadata": "root.TasksApplication._on_window_opening", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 393 }, { "content": " def _on_window_opened(self, window, trait_name, event):\n self.windows.append(window)\n\n # Event notification.\n self.window_opened = TaskWindowEvent(window=window)", "metadata": "root.TasksApplication._on_window_opened", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 401 }, { "content": " def _on_window_closing(self, window, trait_name, event):\n # Event notification.\n self.window_closing = window_event = VetoableTaskWindowEvent(\n window=window)\n\n if window_event.veto:\n event.veto = True\n else:\n # Store the layout of the window.\n window_layout = window.get_window_layout()\n self._state.push_window_layout(window_layout)\n\n # If we're exiting implicitly and this is the last window, save\n # state, because we won't get another chance.\n if len(self.windows) == 1 and not self._explicit_exit:\n self._prepare_exit()", "metadata": "root.TasksApplication._on_window_closing", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 407 }, { "content": " def _on_window_closed(self, window, trait_name, event):\n self.windows.remove(window)\n\n # Event notification.\n self.window_closed = TaskWindowEvent(window=window)\n\n # Was this the last window?\n if len(self.windows) == 0:\n self.stop()", "metadata": "root.TasksApplication._on_window_closed", "header": "['class', 'TasksApplication', '(', 'Application', ')', ':', '___EOS___']", "index": 424 }, { "content": "class TasksApplicationState(HasStrictTraits):\n \"\"\" A class used internally by TasksApplication for saving and restoring\n application state.\n \"\"\"\n\n # TaskWindowLayouts for the windows extant at application exit. Only used if\n # 'always_use_default_layout' is disabled.\n previous_window_layouts = List(TaskWindowLayout)\n\n # A list of TaskWindowLayouts accumulated throughout the application's\n # lifecycle.\n window_layouts = List(TaskWindowLayout)\n\n # The \"version\" for the state data. This should be incremented whenever a\n # backwards incompatible change is made to this class or any of the layout\n # classes. This ensures that loading application state is always safe.\n version = Int(1)\n\n\n", "metadata": "root.TasksApplicationState", "header": "['module', '___EOS___']", "index": 435 }, { "content": " def get_equivalent_window_layout(self, window_layout):\n \"\"\" Gets an equivalent TaskWindowLayout, if there is one.\n \"\"\"\n for layout in self.window_layouts:\n if layout.is_equivalent_to(window_layout):\n return layout\n return None", "metadata": "root.TasksApplicationState.get_equivalent_window_layout", "header": "['class', 'TasksApplicationState', '(', 'HasStrictTraits', ')', ':', '___EOS___']", "index": 453 }, { "content": " def get_task_layout(self, task_id):\n \"\"\" Gets a TaskLayout with the specified ID, there is one.\n \"\"\"\n for window_layout in self.window_layouts:\n for layout in window_layout.items:\n if layout.id == task_id:\n return layout\n return None", "metadata": "root.TasksApplicationState.get_task_layout", "header": "['class', 'TasksApplicationState', '(', 'HasStrictTraits', ')', ':', '___EOS___']", "index": 461 }, { "content": " def push_window_layout(self, window_layout):\n \"\"\" Merge a TaskWindowLayout into the accumulated list.\n \"\"\"\n self.window_layouts = [ layout for layout in self.window_layouts\n if not layout.is_equivalent_to(window_layout) ]\n self.window_layouts.insert(0, window_layout)", "metadata": "root.TasksApplicationState.push_window_layout", "header": "['class', 'TasksApplicationState', '(', 'HasStrictTraits', ')', ':', '___EOS___']", "index": 470 } ]
[ { "span": "from pyface.tasks.api import TaskLayout, TaskWindowLayout", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 57 }, { "span": "from traits.api import Bool, Callable, Directory, Event, HasStrictTraits, \\\n Instance, Int, List, Property, Str, Unicode, Vetoable", "start_line": 9, "start_column": 0, "end_line": 10, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Standard", " ", "librar", "y", " ", "import", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ent", "hou", "ght", " ", "librar", "y", " ", "import", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "envi", "sage", "_", "._", "api_", "import_", "Application_", ",_", "Ext", "ensi", "on", "Point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyf", "ace_", "._", "api_", "import_", "GUI_", ",_", "Spl", "ash", "Screen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyf", "ace_", "._", "image", "\\u", "resource_", "import_", "Image", "Resource_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyf", "ace_", "._", "tasks_", "._", "api_", "import_", "Task", "Layout_", ",_", "Task", "Window", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "traits_", "._", "api_", "import_", "Bool_", ",_", "Callable_", ",_", "Directory_", ",_", "Event_", ",_", "Has", "Stri", "ct", "Trait", "s_", ",_", "Instance_", ",_", "Int_", ",_", "List_", ",_", "Property_", ",_", "Str_", ",_", "Unicode_", ",_", "Vet", "oa", "ble_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "traits_", "._", "ets", "config_", "._", "api_", "import_", "ET", "SC", "onfig_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Local", " ", "imports_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "task", "\\u", "window_", "import_", "Task", "Window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "task", "\\u", "window", "\\u", "event_", "import_", "Task", "Window", "Event_", ",_", "Vet", "oa", "ble", "Task", "Window", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "envi", "sage", "_", "._", "\\u", "compat_", "import_", "pickle_", ",_", "STRING", "\\u", "BASE", "\\u", "CLASS_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Log", "ging", "._", "\\u\\u\\uNL\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "The", " ", "entry", " ", "point", " ", "for", " ", "an", " ", "Env", "isa", "ge", " ", "Task", "s", " ", "applica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "class", " ", "handle", "s", " ", "the", " ", "common", " ", "case", " ", "for", " ", "Task", "s", " ", "applica", "tion", "s", " ", "and", " ", "is", " ", "inten", "ded", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "subclass", "ed", " ", "to", " ", "modif", "y", " ", "its", " ", "start", "/", "stop", " ", "behavior", ",", " ", "etc", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ext", "ensi", "on", " ", "point", " ", "ID", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "TASK", "\\u", "FACTOR", "IES_", "=_", "'", "envi", "sage", ".", "ui", ".", "task", "s", ".", "task", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "TASK", "\\u", "EXTENSIONS_", "=_", "'", "envi", "sage", ".", "ui", ".", "task", "s", ".", "task", "\\u", "extensi", "ons", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "#", " ", "'", "Task", "s", "Applica", "tion", "'", " ", "interface", " ", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "active", " ", "task", " ", "window", " ", "(", "the", " ", "last", " ", "one", " ", "to", " ", "get", " ", "foc", "us", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "active", "\\u", "window_", "=_", "Instance_", "(_", "Task", "Window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "Py", "Face", " ", "GU", "I", " ", "for", " ", "the", " ", "applica", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "gui_", "=_", "Instance_", "(_", "GUI_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ico", "n", " ", "for", " ", "the", " ", "whole", " ", "applica", "tion", ".", " ", "Wil", "l", " ", "be", " ", "used", " ", "to", " ", "override", " ", "all", " ", "task", "Windows_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "icons", " ", "to", " ", "have", " ", "the", " ", "same", "._", "\\u\\u\\uNL\\u\\u\\u_", "icon_", "=_", "Instance_", "(_", "Image", "Resource_", ",_", "allow", "\\u", "none_", "=_", "True_", ")_", "#", "Any_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "applica", "tion", " ", "(", "als", "o", " ", "used", " ", "on", " ", "window", " ", "title", " ", "bar", "s", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "Unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "splash", " ", "screen", " ", "for", " ", "the", " ", "applica", "tion", ".", " ", "By", " ", "default", ",", " ", "there", " ", "is", " ", "no", " ", "splash", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "screen", "._", "\\u\\u\\uNL\\u\\u\\u_", "splash", "\\u", "screen_", "=_", "Instance_", "(_", "Spl", "ash", "Screen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "director", "y", " ", "on", " ", "the", " ", "local", " ", "file", " ", "system", " ", "used", " ", "to", " ", "persist", " ", "window", " ", "layout_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "informati", "on", "._", "\\u\\u\\uNL\\u\\u\\u_", "state", "\\u", "location_", "=_", "Directory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Contrib", "ute", "d", " ", "task", " ", "factori", "es", ".", " ", "Thi", "s", " ", "attribute", " ", "is", " ", "prima", "ri", "ly", " ", "for", " ", "run", "-", "time_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "inspection", ";", " ", "to", " ", "instantiate", " ", "a", " ", "task", ",", " ", "use", " ", "the", " ", "'", "create", "\\u", "task", "'", " ", "method", "._", "\\u\\u\\uNL\\u\\u\\u_", "task", "\\u", "factories_", "=_", "Ext", "ensi", "on", "Point_", "(_", "id_", "=_", "TASK", "\\u", "FACTOR", "IES_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Contrib", "ute", "d", " ", "task", " ", "extensi", "ons", "._", "\\u\\u\\uNL\\u\\u\\u_", "task", "\\u", "extensions_", "=_", "Ext", "ensi", "on", "Point_", "(_", "id_", "=_", "TASK", "\\u", "EXTENSIONS_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "list", " ", "of", " ", "task", " ", "windows", " ", "created", " ", "by", " ", "the", " ", "applica", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "windows_", "=_", "List_", "(_", "Task", "Window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "factor", "y", " ", "for", " ", "creati", "ng", " ", "task", " ", "windows", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "factory_", "=_", "Callable_", "(_", "Task", "Window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "#", " ", "Applica", "tion", " ", "layout", " ", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "default", " ", "layout", " ", "for", " ", "the", " ", "applica", "tion", ".", " ", "If", " ", "not", " ", "specified", ",", " ", "a", " ", "single", " ", "window_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "be", " ", "created", " ", "with", " ", "the", " ", "first", " ", "avail", "able", " ", "task", " ", "factor", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "default", "\\u", "layout_", "=_", "List_", "(_", "Task", "Window", "Layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Whe", "ther", " ", "to", " ", "alw", "ay", "s", " ", "appl", "y", " ", "the", " ", "default", " ", "*", "applica", "tion", " ", "level", "*", " ", "layout", " ", "whe", "n", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "applica", "tion", " ", "is", " ", "start", "ed", ".", " ", "Even", " ", "if", " ", "this", " ", "is", " ", "Fal", "se", ",", " ", "the", " ", "layout", " ", "state", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "individual", " ", "task", "s", " ", "will", " ", "be", " ", "restore", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "alw", "ay", "s", "\\u", "use", "\\u", "default", "\\u", "layout_", "=_", "Bool_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "#", " ", "Applica", "tion", " ", "lifecycle", " ", "events", " ", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "after", " ", "the", " ", "initial", " ", "windows", " ", "have", " ", "bee", "n", " ", "created", " ", "and", " ", "the", " ", "GU", "I", " ", "event", " ", "loop_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "bee", "n", " ", "start", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "applica", "tion", "\\u", "initialized_", "=_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "immediate", "ly", " ", "bef", "ore", " ", "the", " ", "ext", "ant", " ", "windows", " ", "are", " ", "destroy", "ed", " ", "and", " ", "the", " ", "GUI_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "event", " ", "loop", " ", "is", " ", "terminate", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "applica", "tion", "\\u", "exit", "ing_", "=_", "Event_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "whe", "n", " ", "a", " ", "task", " ", "window", " ", "has", " ", "bee", "n", " ", "created", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "created_", "=_", "Event_", "(_", "Task", "Window", "Event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "whe", "n", " ", "a", " ", "task", " ", "window", " ", "is", " ", "opening", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "opening", "_", "=_", "Event_", "(_", "Vet", "oa", "ble", "Task", "Window", "Event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "whe", "n", " ", "a", " ", "task", " ", "window", " ", "has", " ", "bee", "n", " ", "opene", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "opened_", "=_", "Event_", "(_", "Task", "Window", "Event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "whe", "n", " ", "a", " ", "task", " ", "window", " ", "is", " ", "clos", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "closing_", "=_", "Event_", "(_", "Vet", "oa", "ble", "Task", "Window", "Event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fire", "d", " ", "whe", "n", " ", "a", " ", "task", " ", "window", " ", "has", " ", "bee", "n", " ", "close", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "closed_", "=_", "Event_", "(_", "Task", "Window", "Event_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "#", " ", "Protect", "ed", " ", "interface", " ", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "'", "explicit", "'", " ", "exit", " ", "is", " ", "whe", "n", " ", "the", " ", "the", " ", "'", "exit", "'", " ", "method", " ", "is", " ", "call", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "'", "implicit", "'", " ", "exit", " ", "is", " ", "whe", "n", " ", "the", " ", "user", " ", "closes", " ", "the", " ", "last", " ", "open", " ", "window", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "explicit", "\\u", "exit_", "=_", "Bool_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Applica", "tion", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "state_", "=_", "Instance_", "(_", "'", "envi", "sage", ".", "ui", ".", "task", "s", ".", "task", "s", "\\u", "applica", "tion", ".'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Task", "s", "Applica", "tion", "State", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "IA", "ppl", "ication", "'", " ", "interface", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "Task", "s", "Applica", "tion", "'", " ", "interface", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Protect", "ed", " ", "interface", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "#", " ", "Trait", " ", "initializer", "s", " ", "###########", "###########", "###########", "###########", "######", "#", "_", "\\u\\u\\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_", "###", "#", " ", "Trait", " ", "change", " ", "handler", "s", " ", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\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_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Run", " ", "the", " ", "applica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", "Whe", "ther", " ", "the", " ", "applica", "tion", " ", "start", "ed", " ", "success", "full", "y", " ", "(", "i", ".", "e", ".,", " ", "with", "out", " ", "a", " ", "vet", "o", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "the", " ", "GU", "I", " ", "has", " ", "bee", "n", " ", "created", " ", "(", "so", " ", "tha", "t", ",", " ", "if", " ", "require", "d", ",", " ", "the", " ", "splash", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "screen", " ", "is", " ", "shown", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "gui_", "=_", "self_", "._", "gui_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "started_", "=_", "self_", "._", "start_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "started_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "windows", " ", "from", " ", "the", " ", "default", " ", "or", " ", "saved", " ", "applica", "tion", " ", "layout", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "create", "\\u", "windows_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Start", " ", "the", " ", "GU", "I", " ", "event", " ", "loop", "._", "\\u\\u\\uNL\\u\\u\\u_", "gui_", "._", "set\\u", "tra", "it", "\\u", "later_", "(_", "self_", ",_", "'", "applica", "tion", "\\u", "initialize", "d", "'_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gui_", "._", "start", "\\u", "event", "\\u", "loop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "started_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "task_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "es", " ", "the", " ", "Task", " ", "with", " ", "the", " ", "specified", " ", "ID", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "new", " ", "Task", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "there", " ", "is", " ", "not", " ", "a", " ", "suit", "able", " ", "Task", "Factor", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "the", " ", "factor", "y", " ", "for", " ", "the", " ", "task", "._", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "self_", "._", "\\u", "get", "\\u", "task", "\\u", "factory_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "factory_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "the", " ", "task", " ", "usi", "ng", " ", "suit", "able", " ", "task", " ", "extensi", "ons", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "extensions_", "=_", "[_", "ext_", "for_", "ext_", "in_", "self_", "._", "task", "\\u", "extensions_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ext_", "._", "task", "\\u", "id_", "==_", "id_", "or_", "not_", "ext_", "._", "task", "\\u", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "=_", "factory_", "._", "create", "\\u", "with", "\\u", "extensions_", "(_", "extensions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "id_", "=_", "factory_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "window_", "(_", "self_", ",_", "layout_", "=_", "None_", ",_", "restore_", "=_", "True_", ",_", "**_", "traits_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "es", " ", "a", " ", "new", " ", "Task", "Window", ",", " ", "possib", "ly", " ", "with", " ", "some", " ", "Task", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-----------", "\\", "10", ";", " ", " ", " ", " ", "layout", " ", ":", " ", "Task", "Window", "Lay", "out", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", " ", "The", " ", "layout", " ", "to", " ", "use", " ", "for", " ", "the", " ", "window", ".", " ", "The", " ", "task", "s", " ", "descri", "bed", " ", "in", " ", "the", " ", "layout", "\\", "10", ";", " ", " ", " ", " ", " ", "will", " ", "be", " ", "created", " ", "and", " ", "adde", "d", " ", "to", " ", "the", " ", "window", " ", "automati", "call", "y", ".", " ", "If", " ", "not", "\\", "10", ";", " ", " ", " ", " ", " ", "specified", ",", " ", "the", " ", "window", " ", "will", " ", "contain", " ", "no", " ", "task", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "restore", " ", ":", " ", "bool", ",", " ", "option", "al", " ", "(", "default", " ", "Tru", "e", ")", "\\", "10", ";", " ", " ", " ", " ", " ", "If", " ", "set", ",", " ", "the", " ", "applica", "tion", " ", "will", " ", "restore", " ", "old", " ", "size", " ", "and", " ", "position", "s", " ", "for", " ", "the", "\\", "10", ";", " ", " ", " ", " ", " ", "window", " ", "and", " ", "its", " ", "pane", "s", ",", " ", "if", " ", "possib", "le", ".", " ", "If", " ", "a", " ", "layout", " ", "is", " ", "not", " ", "provided", ",", "\\", "10", ";", " ", " ", " ", " ", " ", "this", " ", "parameter", " ", "has", " ", "no", " ", "effect", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "**", "traits", " ", ":", " ", "dict", ",", " ", "option", "al", "\\", "10", ";", " ", " ", " ", " ", " ", "Addition", "al", " ", "parameter", "s", " ", "to", " ", "pass", " ", "to", " ", "``", "window", "\\u", "factor", "y", "()``", " ", "whe", "n", " ", "creati", "ng", "\\", "10", ";", " ", " ", " ", " ", " ", "the", " ", "Task", "Window", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "new", " ", "Task", "Window", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "=_", "self_", "._", "window", "\\u", "factory_", "(_", "application_", "=_", "self_", ",_", "**_", "traits_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Listen", " ", "for", " ", "the", " ", "window", " ", "events", "._", "\\u\\u\\uNL\\u\\u\\u_", "window_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "\\u", "on", "\\u", "window", "\\u", "activated_", ",_", "'", "activat", "ed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "\\u", "on", "\\u", "window", "\\u", "opening", "_", ",_", "'", "opening", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "\\u", "on", "\\u", "window", "\\u", "opened_", ",_", "'", "opene", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "\\u", "on", "\\u", "window", "\\u", "closing_", ",_", "'", "clos", "ing", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "on", "\\u", "tra", "it", "\\u", "change_", "(_", "self_", "._", "\\u", "on", "\\u", "window", "\\u", "closed_", ",_", "'", "close", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", " ", "notification", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "window", "\\u", "created_", "=_", "Task", "Window", "Event_", "(_", "window_", "=_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "layout_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Creat", "e", " ", "and", " ", "add", " ", "task", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "task", "\\u", "id_", "in_", "layout_", "._", "get", "\\u", "tasks_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "task_", "=_", "self_", "._", "create", "\\u", "task_", "(_", "task", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "task_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "window_", "._", "add", "\\u", "task_", "(_", "task_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logger_", "._", "error_", "(_", "'", "Missing", " ", "factor", "y", " ", "for", " ", "task", " ", "with", " ", "ID", " ", "%", "r", "'_", ",_", "task", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Apply", " ", "a", " ", "suit", "able", " ", "layout", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "restore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layout_", "=_", "self_", "._", "\\u", "restore", "\\u", "layout", "\\u", "from", "\\u", "state_", "(_", "layout_", ")_", "\\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_", "#", " ", "Creat", "e", " ", "an", " ", "empty", " ", "layout", " ", "to", " ", "set", " ", "default", " ", "size", " ", "and", " ", "position", " ", "only_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layout_", "=_", "Task", "Window", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "window_", "._", "set\\u", "window", "\\u", "layout_", "(_", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exit_", "(_", "self_", ",_", "force_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Exi", "ts", " ", "the", " ", "applica", "tion", ",", " ", "clos", "ing", " ", "all", " ", "open", " ", "task", " ", "windows", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Ea", "ch", " ", "window", " ", "is", " ", "sent", " ", "a", " ", "vet", "o", "-", "able", " ", "clos", "ing", " ", "event", ".", " ", "If", " ", "any", " ", "window", " ", "vet", "oes", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "close", " ", "request", ",", " ", "no", " ", "window", " ", "will", " ", "be", " ", "close", "d", ".", " ", "Ot", "her", "wis", "e", ",", " ", "all", " ", "windows", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "close", "d", " ", "and", " ", "the", " ", "GU", "I", " ", "event", " ", "loop", " ", "will", " ", "terminate", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "is", " ", "not", " ", "call", "ed", " ", "whe", "n", " ", "the", " ", "user", " ", "clicks", " ", "the", " ", "close", " ", "button", " ", "on", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "window", " ", "or", " ", "other", "wis", "e", " ", "closes", " ", "a", " ", "window", " ", "through", " ", "his", " ", "or", " ", "her", " ", "window", "\\", "10", ";", " ", " ", " ", " ", "manage", "r", ".", " ", "It", " ", "is", " ", "only", " ", "call", "ed", " ", "via", " ", "the", " ", "File", "->", "Exi", "t", " ", "menu", " ", "item", ".", " ", "It", " ", "can", " ", "als", "o", ",", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "course", ",", " ", "be", " ", "call", "ed", " ", "programa", "tica", "ll", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-----------", "\\", "10", ";", " ", " ", " ", " ", "force", " ", ":", " ", "bool", ",", " ", "option", "al", " ", "(", "default", " ", "Fal", "se", ")", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "set", ",", " ", "windows", " ", "will", " ", "receive", " ", "no", " ", "clos", "ing", " ", "events", " ", "and", " ", "will", " ", "be", " ", "destroy", "ed", "\\", "10", ";", " ", " ", " ", " ", "uncon", "dition", "ally", ".", " ", "Thi", "s", " ", "can", " ", "be", " ", "usef", "ul", " ", "for", " ", "reliab", "ly", " ", "tear", "ing", " ", "down", "\\", "10", ";", " ", " ", " ", " ", "regress", "ion", " ", "tests", ",", " ", "but", " ", "shou", "ld", " ", "be", " ", "used", " ", "with", " ", "cau", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "--------", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "boolean", " ", "indicati", "ng", " ", "whe", "ther", " ", "the", " ", "applica", "tion", " ", "exit", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "explicit", "\\u", "exit_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "force_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "window_", "in_", "reversed_", "(_", "self_", "._", "windows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "window_", "._", "closing_", "=_", "event_", "=_", "Vet", "oa", "ble_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "event_", "._", "vet", "o_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "prepar", "e\\u", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "window_", "in_", "reversed_", "(_", "self_", "._", "windows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "closed_", "=_", "True_", "\\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 ", " _", "self_", "._", "\\u", "explicit", "\\u", "exit_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "create", "\\u", "windows_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Call", "ed", " ", "at", " ", "start", "up", " ", "to", " ", "create", " ", "Task", "Window", "s", " ", "from", " ", "the", " ", "default", " ", "or", " ", "saved", "\\", "10", ";", " ", " ", " ", " ", "applica", "tion", " ", "layout", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Build", " ", "a", " ", "list", " ", "of", " ", "Task", "Window", "Lay", "outs", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "load", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "alw", "ay", "s", "\\u", "use", "\\u", "default", "\\u", "layout_", "or_", "not_", "self_", "._", "\\u", "state_", "._", "previ", "ous", "\\u", "window", "\\u", "layouts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window", "\\u", "layouts", "_", "=_", "self_", "._", "default", "\\u", "layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Choose", " ", "the", " ", "store", "d", " ", "Task", "Window", "Lay", "outs", ",", " ", "but", " ", "only", " ", "if", " ", "all", " ", "the", " ", "task", " ", "ID", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "still", " ", "valid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window", "\\u", "layouts", "_", "=_", "self_", "._", "\\u", "state_", "._", "previ", "ous", "\\u", "window", "\\u", "layouts", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layout_", "in_", "window", "\\u", "layouts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "task", "\\u", "id_", "in_", "layout_", "._", "get", "\\u", "tasks_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "not_", "self_", "._", "\\u", "get", "\\u", "task", "\\u", "factory_", "(_", "task", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "logger_", "._", "warning_", "(_", "'", "Save", "d", " ", "applica", "tion", " ", "layout", " ", "reference", "s", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "non", "-", "existen", "t", " ", "task", " ", "%", "r", ".", " ", "Fall", "ing", " ", "back", " ", "to", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "default", " ", "applica", "tion", " ", "layout", ".'_", "%_", "task", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window", "\\u", "layouts", "_", "=_", "self_", "._", "default", "\\u", "layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "a", " ", "Task", "Window", " ", "for", " ", "each", " ", "Task", "Window", "Lay", "out", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "window", "\\u", "layout_", "in_", "window", "\\u", "layouts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window_", "=_", "self_", "._", "create", "\\u", "window_", "(_", "window", "\\u", "layout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "restore_", "=_", "self_", "._", "alw", "ay", "s", "\\u", "use", "\\u", "default", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "window_", "._", "open_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "task", "\\u", "factory_", "(_", "self_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Return", "s", " ", "the", " ", "Task", "Factor", "y", " ", "with", " ", "the", " ", "specified", " ", "ID", ",", " ", "or", " ", "Non", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factory_", "in_", "self_", "._", "task", "\\u", "factories_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "factory_", "._", "id_", "==_", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "prepar", "e\\u", "exit_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Call", "ed", " ", "immediate", "ly", " ", "bef", "ore", " ", "the", " ", "ext", "ant", " ", "windows", " ", "are", " ", "destroy", "ed", " ", "and", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "GU", "I", " ", "event", " ", "loop", " ", "is", " ", "terminate", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "applica", "tion", "\\u", "exit", "ing_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "save", "\\u", "state_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "load", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Load", "s", " ", "saved", " ", "applica", "tion", " ", "state", ",", " ", "if", " ", "possib", "le", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "Task", "s", "Applica", "tion", "State_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "state", "\\u", "location_", ",_", "'", "applica", "tion", "\\u", "meme", "nto", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "unpickle", " ", "the", " ", "saved", " ", "applica", "tion", " ", "state", "._", "\\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 ", " _", "with_", "open_", "(_", "filename_", ",_", "'", "r", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "restore", "d\\u", "state_", "=_", "pickle_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "state_", "._", "version_", "==_", "restore", "d\\u", "state_", "._", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "state_", "=_", "restore", "d\\u", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logger_", "._", "warn_", "(_", "'", "Discard", "ing", " ", "outdate", "d", " ", "applica", "tion", " ", "layout", "'_", ")_", "\\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_", "#", " ", "If", " ", "anyt", "hing", " ", "go", "es", " ", "wrong", ",", " ", "log", " ", "the", " ", "error", " ", "and", " ", "continue", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "'", "Restor", "ing", " ", "applica", "tion", " ", "layout", " ", "from", " ", "%", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "state_", "=_", "state_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "restore", "\\u", "layout", "\\u", "from", "\\u", "state_", "(_", "self_", ",_", "layout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Restor", "es", " ", "an", " ", "equivalent", " ", "layout", " ", "from", " ", "saved", " ", "applica", "tion", " ", "state", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fi", "rst", ",", " ", "see", " ", "if", " ", "a", " ", "window", " ", "layout", " ", "matche", "s", " ", "exact", "ly", "._", "\\u\\u\\uNL\\u\\u\\u_", "match_", "=_", "self_", "._", "\\u", "state_", "._", "get", "\\u", "equivalent", "\\u", "window", "\\u", "layout_", "(_", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "active", " ", "task", " ", "is", " ", "not", " ", "part", " ", "of", " ", "the", " ", "equivale", "nc", "y", " ", "relation", ",", " ", "so", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ensure", " ", "tha", "t", " ", "it", " ", "is", " ", "correct", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "._", "active", "\\u", "task_", "=_", "layout_", "._", "get", "\\u", "active", "\\u", "task_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layout_", "=_", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "tha", "t", " ", "fail", "s", ",", " ", "at", " ", "leas", "t", " ", "try", " ", "to", " ", "restore", " ", "the", " ", "layout", " ", "of", " ", "individual", " ", "task", "s", "._", "\\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 ", " _", "layout_", "=_", "layout_", "._", "clone", "\\u", "traits_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "item_", "in_", "enumerate_", "(_", "layout_", "._", "items_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "item_", "if_", "isinstance_", "(_", "item_", ",_", "STRING", "\\u", "BASE", "\\u", "CLASS_", ")_", "else_", "item_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "self_", "._", "\\u", "state_", "._", "get", "\\u", "task", "\\u", "layout_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "layout_", "._", "items_", "[_", "i_", "]_", "=_", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "save", "\\u", "state_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Save", "s", " ", "the", " ", "applica", "tion", " ", "state", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Grab", " ", "the", " ", "current", " ", "window", " ", "layouts", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "layouts", "_", "=_", "[_", "w_", "._", "get", "\\u", "window", "\\u", "layout_", "(_", ")_", "for_", "w_", "in_", "self_", "._", "windows_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "state_", "._", "previ", "ous", "\\u", "window", "\\u", "layouts", "_", "=_", "window", "\\u", "layouts", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Atte", "mpt", " ", "to", " ", "pickle", " ", "the", " ", "applica", "tion", " ", "state", "._", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "state", "\\u", "location_", ",_", "'", "applica", "tion", "\\u", "meme", "nto", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "open_", "(_", "filename_", ",_", "'", "w", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pickle_", "._", "dump_", "(_", "self_", "._", "\\u", "state_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "anyt", "hing", " ", "go", "es", " ", "wrong", ",", " ", "log", " ", "the", " ", "error", " ", "and", " ", "continue", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "exception_", "(_", "'", "Sav", "ing", " ", "applica", "tion", " ", "layout", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\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", "default", "\\u", "layout", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window", "\\u", "layout_", "=_", "Task", "Window", "Layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "task", "\\u", "factories_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window", "\\u", "layout_", "._", "items_", "=_", "[_", "self_", "._", "task", "\\u", "factories_", "[_", "0_", "]_", "._", "id_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "window", "\\u", "layout_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "gui", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "GUI_", "(_", "splash", "\\u", "screen_", "=_", "self_", "._", "splash", "\\u", "screen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "state", "\\u", "location", "\\u", "default_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "state", "\\u", "location_", "=_", "os_", "._", "path_", "._", "join_", "(_", "ET", "SC", "onfig_", "._", "applica", "tion", "\\u", "home_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "task", "s", "'_", ",_", "ET", "SC", "onfig_", "._", "toolkit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "state", "\\u", "location_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "state", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logger_", "._", "debug_", "(_", "'", "Task", "s", " ", "state", " ", "location", " ", "is", " ", "%", "s", "'_", ",_", "state", "\\u", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "state", "\\u", "location_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "on", "\\u", "window", "\\u", "activated_", "(_", "self_", ",_", "window_", ",_", "tra", "it", "\\u", "name_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "active", "\\u", "window_", "=_", "window_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "on", "\\u", "window", "\\u", "opening", "_", "(_", "self_", ",_", "window_", ",_", "tra", "it", "\\u", "name_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Event", " ", "notification", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "window", "\\u", "opening", "_", "=_", "window", "\\u", "event_", "=_", "Vet", "oa", "ble", "Task", "Window", "Event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "window_", "=_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "window", "\\u", "event_", "._", "vet", "o_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event_", "._", "vet", "o_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\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", "on", "\\u", "window", "\\u", "opened_", "(_", "self_", ",_", "window_", ",_", "tra", "it", "\\u", "name_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "windows_", "._", "append_", "(_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", " ", "notification", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "window", "\\u", "opened_", "=_", "Task", "Window", "Event_", "(_", "window_", "=_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "on", "\\u", "window", "\\u", "closing_", "(_", "self_", ",_", "window_", ",_", "tra", "it", "\\u", "name_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Event", " ", "notification", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "window", "\\u", "closing_", "=_", "window", "\\u", "event_", "=_", "Vet", "oa", "ble", "Task", "Window", "Event_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "window_", "=_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "window", "\\u", "event_", "._", "vet", "o_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event_", "._", "vet", "o_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Stor", "e", " ", "the", " ", "layout", " ", "of", " ", "the", " ", "window", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "window", "\\u", "layout_", "=_", "window_", "._", "get", "\\u", "window", "\\u", "layout_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "state_", "._", "push", "\\u", "window", "\\u", "layout_", "(_", "window", "\\u", "layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "exit", "ing", " ", "implicit", "ly", " ", "and", " ", "this", " ", "is", " ", "the", " ", "last", " ", "window", ",", " ", "save_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "state", ",", " ", "bec", "aus", "e", " ", "we", " ", "won", "'", "t", " ", "get", " ", "anot", "her", " ", "chan", "ce", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "windows_", ")_", "==_", "1_", "and_", "not_", "self_", "._", "\\u", "explicit", "\\u", "exit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "prepar", "e\\u", "exit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Application_", "(_", "Application_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "on", "\\u", "window", "\\u", "closed_", "(_", "self_", ",_", "window_", ",_", "tra", "it", "\\u", "name_", ",_", "event_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "windows_", "._", "remove_", "(_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Event", " ", "notification", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "window", "\\u", "closed_", "=_", "Task", "Window", "Event_", "(_", "window_", "=_", "window_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Wa", "s", " ", "this", " ", "the", " ", "last", " ", "window", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "self_", "._", "windows_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Task", "s", "Applica", "tion", "State_", "(_", "Has", "Stri", "ct", "Trait", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "A", " ", "class", " ", "used", " ", "internal", "ly", " ", "by", " ", "Task", "s", "Applica", "tion", " ", "for", " ", "saving", " ", "and", " ", "resto", "ring", "\\", "10", ";", " ", " ", " ", " ", "applica", "tion", " ", "state", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Task", "Window", "Lay", "outs", " ", "for", " ", "the", " ", "windows", " ", "ext", "ant", " ", "at", " ", "applica", "tion", " ", "exit", ".", " ", "On", "ly", " ", "used", " ", "if_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "'", "alw", "ay", "s", "\\u", "use", "\\u", "default", "\\u", "layout", "'", " ", "is", " ", "disable", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "previ", "ous", "\\u", "window", "\\u", "layouts", "_", "=_", "List_", "(_", "Task", "Window", "Layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "Task", "Window", "Lay", "outs", " ", "accumulated", " ", "through", "out", " ", "the", " ", "applica", "tion", "'", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lifecycle", "._", "\\u\\u\\uNL\\u\\u\\u_", "window", "\\u", "layouts", "_", "=_", "List_", "(_", "Task", "Window", "Layout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "\"", "version", "\"", " ", "for", " ", "the", " ", "state", " ", "data", ".", " ", "Thi", "s", " ", "shou", "ld", " ", "be", " ", "increment", "ed", " ", "whe", "neve", "r", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "ward", "s", " ", "incomp", "atible", " ", "change", " ", "is", " ", "made", " ", "to", " ", "this", " ", "class", " ", "or", " ", "any", " ", "of", " ", "the", " ", "layout_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "classe", "s", ".", " ", "Thi", "s", " ", "ensure", "s", " ", "tha", "t", " ", "load", "ing", " ", "applica", "tion", " ", "state", " ", "is", " ", "alw", "ay", "s", " ", "safe", "._", "\\u\\u\\uNL\\u\\u\\u_", "version_", "=_", "Int_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Applica", "tion", "State_", "(_", "Has", "Stri", "ct", "Trait", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "equivalent", "\\u", "window", "\\u", "layout_", "(_", "self_", ",_", "window", "\\u", "layout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", "s", " ", "an", " ", "equivalent", " ", "Task", "Window", "Lay", "out", ",", " ", "if", " ", "there", " ", "is", " ", "one", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "layout_", "in_", "self_", "._", "window", "\\u", "layouts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "layout_", "._", "is", "\\u", "equivalent", "\\u", "to_", "(_", "window", "\\u", "layout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Applica", "tion", "State_", "(_", "Has", "Stri", "ct", "Trait", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "task", "\\u", "layout_", "(_", "self_", ",_", "task", "\\u", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Get", "s", " ", "a", " ", "Task", "Lay", "out", " ", "with", " ", "the", " ", "specified", " ", "ID", ",", " ", "there", " ", "is", " ", "one", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "window", "\\u", "layout_", "in_", "self_", "._", "window", "\\u", "layouts", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "layout_", "in_", "window", "\\u", "layout_", "._", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "layout_", "._", "id_", "==_", "task", "\\u", "id_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "s", "Applica", "tion", "State_", "(_", "Has", "Stri", "ct", "Trait", "s_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "push", "\\u", "window", "\\u", "layout_", "(_", "self_", ",_", "window", "\\u", "layout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Merge", " ", "a", " ", "Task", "Window", "Lay", "out", " ", "int", "o", " ", "the", " ", "accumulated", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "window", "\\u", "layouts", "_", "=_", "[_", "layout_", "for_", "layout_", "in_", "self_", "._", "window", "\\u", "layouts", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "layout_", "._", "is", "\\u", "equivalent", "\\u", "to_", "(_", "window", "\\u", "layout_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "window", "\\u", "layouts", "_", "._", "insert_", "(_", "0_", ",_", "window", "\\u", "layout_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
caseywstark/colab/colab/apps/account/models.py
[ { "content": "def create_account(sender, instance=None, **kwargs):\n if instance is None:\n return\n account, created = Account.objects.get_or_create(user=instance)", "metadata": "root.create_account", "header": "['module', '___EOS___']", "index": 72 } ]
[ { "span": "account,", "start_line": 75, "start_column": 4, "end_line": 75, "end_column": 11 }, { "span": "created ", "start_line": 75, "start_column": 13, "end_line": 75, "end_column": 20 } ]
[]
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_", "create", "\\u", "account_", "(_", "sender_", ",_", "instance_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "instance_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "account_", ",_", "created_", "=_", "Account_", "._", "objects_", "._", "get", "\\u", "or", "\\u", "create_", "(_", "user_", "=_", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
rcbops/glance-buildpackage/glance/common/client.py
[ { "content": "# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Copyright 2010-2011 OpenStack, LLC\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n# HTTPSClientAuthConnection code comes courtesy of ActiveState website:\n# http://code.activestate.com/recipes/\n# 577548-https-httplib-client-connection-with-certificate-v/\n\nimport collections\nimport functools\nimport httplib\nimport logging\nimport os\nimport urllib\nimport urlparse\n\ntry:\n from eventlet.green import socket, ssl\nexcept ImportError:\n import socket\n import ssl\n\nfrom glance.common import auth\nfrom glance.common import exception\n\n\n# common chunk size for get and put\nCHUNKSIZE = 65536\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def handle_unauthorized(func):\n \"\"\"\n Wrap a function to re-authenticate and retry.\n \"\"\"\n @functools.wraps(func)\n def wrapped(self, *args, **kwargs):\n try:\n return func(self, *args, **kwargs)\n except exception.NotAuthorized:\n self._authenticate(force_reauth=True)\n return func(self, *args, **kwargs)\n return wrapped", "metadata": "root.handle_unauthorized", "header": "['module', '___EOS___']", "index": 43 }, { "content": "def handle_redirects(func):\n \"\"\"\n Wrap the _do_request function to handle HTTP redirects.\n \"\"\"\n MAX_REDIRECTS = 5\n\n @functools.wraps(func)\n def wrapped(self, method, url, body, headers):\n for _ in xrange(MAX_REDIRECTS):\n try:\n return func(self, method, url, body, headers)\n except exception.RedirectException as redirect:\n if redirect.url is None:\n raise exception.InvalidRedirect()\n url = redirect.url\n raise exception.MaxRedirectsExceeded(redirects=MAX_REDIRECTS)\n return wrapped", "metadata": "root.handle_redirects", "header": "['module', '___EOS___']", "index": 57 }, { "content": "class ImageBodyIterator(object):\n\n \"\"\"\n A class that acts as an iterator over an image file's\n chunks of data. This is returned as part of the result\n tuple from `glance.client.Client.get_image`\n \"\"\"\n\n", "metadata": "root.ImageBodyIterator", "header": "['module', '___EOS___']", "index": 76 }, { "content": " def __init__(self, source):\n \"\"\"\n Constructs the object from a readable image source\n (such as an HTTPResponse or file-like object)\n \"\"\"\n self.source = source", "metadata": "root.ImageBodyIterator.__init__", "header": "['class', 'ImageBodyIterator', '(', 'object', ')', ':', '___EOS___']", "index": 84 }, { "content": " def __iter__(self):\n \"\"\"\n Exposes an iterator over the chunks of data in the\n image file.\n \"\"\"\n while True:\n chunk = self.source.read(CHUNKSIZE)\n if chunk:\n yield chunk\n else:\n break", "metadata": "root.ImageBodyIterator.__iter__", "header": "['class', 'ImageBodyIterator', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": "class HTTPSClientAuthConnection(httplib.HTTPSConnection):\n \"\"\"\n Class to make a HTTPS connection, with support for\n full client-based SSL Authentication\n\n :see http://code.activestate.com/recipes/\n 577548-https-httplib-client-connection-with-certificate-v/\n \"\"\"\n\n", "metadata": "root.HTTPSClientAuthConnection", "header": "['module', '___EOS___']", "index": 104 }, { "content": " def __init__(self, host, port, key_file, cert_file,\n ca_file, timeout=None):\n httplib.HTTPSConnection.__init__(self, host, port, key_file=key_file,\n cert_file=cert_file)\n self.key_file = key_file\n self.cert_file = cert_file\n self.ca_file = ca_file\n self.timeout = timeout", "metadata": "root.HTTPSClientAuthConnection.__init__", "header": "['class', 'HTTPSClientAuthConnection', '(', 'httplib', '.', 'HTTPSConnection', ')', ':', '___EOS___']", "index": 113 }, { "content": " def connect(self):\n \"\"\"\n Connect to a host on a given (SSL) port.\n If ca_file is pointing somewhere, use it to check Server Certificate.\n\n Redefined/copied and extended from httplib.py:1105 (Python 2.6.x).\n This is needed to pass cert_reqs=ssl.CERT_REQUIRED as parameter to\n ssl.wrap_socket(), which forces SSL to check server certificate against\n our client certificate.\n \"\"\"\n sock = socket.create_connection((self.host, self.port), self.timeout)\n if self._tunnel_host:\n self.sock = sock\n self._tunnel()\n # If there's no CA File, don't force Server Certificate Check\n if self.ca_file:\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n ca_certs=self.ca_file,\n cert_reqs=ssl.CERT_REQUIRED)\n else:\n self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,\n cert_reqs=ssl.CERT_NONE)", "metadata": "root.HTTPSClientAuthConnection.connect", "header": "['class', 'HTTPSClientAuthConnection', '(', 'httplib', '.', 'HTTPSConnection', ')', ':', '___EOS___']", "index": 122 }, { "content": "class BaseClient(object):\n\n \"\"\"A base client class\"\"\"\n\n DEFAULT_PORT = 80\n DEFAULT_DOC_ROOT = None\n\n OK_RESPONSE_CODES = (\n httplib.OK,\n httplib.CREATED,\n httplib.ACCEPTED,\n httplib.NO_CONTENT,\n )\n\n REDIRECT_RESPONSE_CODES = (\n httplib.MOVED_PERMANENTLY,\n httplib.FOUND,\n httplib.SEE_OTHER,\n httplib.USE_PROXY,\n httplib.TEMPORARY_REDIRECT,\n )\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BaseClient", "header": "['module', '___EOS___']", "index": 146 }, { "content": " def __init__(self, host, port=None, use_ssl=False, auth_tok=None,\n creds=None, doc_root=None,\n key_file=None, cert_file=None, ca_file=None):\n \"\"\"\n Creates a new client to some service.\n\n :param host: The host where service resides\n :param port: The port where service resides\n :param use_ssl: Should we use HTTPS?\n :param auth_tok: The auth token to pass to the server\n :param creds: The credentials to pass to the auth plugin\n :param doc_root: Prefix for all URLs we request from host\n :param key_file: Optional PEM-formatted file that contains the private\n key.\n If use_ssl is True, and this param is None (the\n default), then an environ variable\n GLANCE_CLIENT_KEY_FILE is looked for. If no such\n environ variable is found, ClientConnectionError\n will be raised.\n :param cert_file: Optional PEM-formatted certificate chain file.\n If use_ssl is True, and this param is None (the\n default), then an environ variable\n GLANCE_CLIENT_CERT_FILE is looked for. If no such\n environ variable is found, ClientConnectionError\n will be raised.\n :param ca_file: Optional CA cert file to use in SSL connections\n If use_ssl is True, and this param is None (the\n default), then an environ variable\n GLANCE_CLIENT_CA_FILE is looked for.\n \"\"\"\n self.host = host\n self.port = port or self.DEFAULT_PORT\n self.use_ssl = use_ssl\n self.auth_tok = auth_tok\n self.creds = creds or {}\n self.connection = None\n # doc_root can be a nullstring, which is valid, and why we\n # cannot simply do doc_root or self.DEFAULT_DOC_ROOT below.\n self.doc_root = (doc_root if doc_root is not None\n else self.DEFAULT_DOC_ROOT)\n self.auth_plugin = self.make_auth_plugin(self.creds)\n self.connect_kwargs = {}\n\n if use_ssl:\n if not key_file:\n if not os.environ.get('GLANCE_CLIENT_KEY_FILE'):\n msg = _(\"You have selected to use SSL in connecting, \"\n \"however you have failed to supply either a \"\n \"key_file parameter or set the \"\n \"GLANCE_CLIENT_KEY_FILE environ variable\")\n raise exception.ClientConnectionError(msg)\n key_file = os.environ.get('GLANCE_CLIENT_KEY_FILE')\n\n if not os.path.exists(key_file):\n msg = _(\"The key file you specified %s does not \"\n \"exist\") % key_file\n raise exception.ClientConnectionError(msg)\n self.connect_kwargs['key_file'] = key_file\n\n if not cert_file:\n if not os.environ.get('GLANCE_CLIENT_CERT_FILE'):\n msg = _(\"You have selected to use SSL in connecting, \"\n \"however you have failed to supply either a \"\n \"cert_file parameter or set the \"\n \"GLANCE_CLIENT_CERT_FILE environ variable\")\n raise exception.ClientConnectionError(msg)\n cert_file = os.environ.get('GLANCE_CLIENT_CERT_FILE')\n\n if not os.path.exists(cert_file):\n msg = _(\"The key file you specified %s does not \"\n \"exist\") % cert_file\n raise exception.ClientConnectionError(msg)\n self.connect_kwargs['cert_file'] = cert_file\n\n if not ca_file:\n ca_file = os.environ.get('GLANCE_CLIENT_CA_FILE')\n\n self.connect_kwargs['ca_file'] = ca_file", "metadata": "root.BaseClient.__init__", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 168 }, { "content": " def set_auth_token(self, auth_tok):\n \"\"\"\n Updates the authentication token for this client connection.\n \"\"\"\n # FIXME(sirp): Nova image/glance.py currently calls this. Since this\n # method isn't really doing anything useful[1], we should go ahead and\n # rip it out, first in Nova, then here. Steps:\n #\n # 1. Change auth_tok in Glance to auth_token\n # 2. Change image/glance.py in Nova to use client.auth_token\n # 3. Remove this method\n #\n # [1] http://mail.python.org/pipermail/tutor/2003-October/025932.html\n self.auth_tok = auth_tok", "metadata": "root.BaseClient.set_auth_token", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 247 }, { "content": " def configure_from_url(self, url):\n \"\"\"\n Setups the connection based on the given url.\n\n The form is:\n\n <http|https>://<host>:port/doc_root\n \"\"\"\n parsed = urlparse.urlparse(url)\n self.use_ssl = parsed.scheme == 'https'\n self.host = parsed.hostname\n self.port = parsed.port or 80\n self.doc_root = parsed.path", "metadata": "root.BaseClient.configure_from_url", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 262 }, { "content": " def make_auth_plugin(self, creds):\n \"\"\"\n Returns an instantiated authentication plugin.\n \"\"\"\n strategy = creds.get('strategy', 'noauth')\n plugin_class = auth.get_plugin_from_strategy(strategy)\n plugin = plugin_class(creds)\n return plugin", "metadata": "root.BaseClient.make_auth_plugin", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 276 }, { "content": " def get_connection_type(self):\n \"\"\"\n Returns the proper connection type\n \"\"\"\n if self.use_ssl:\n return HTTPSClientAuthConnection\n else:\n return httplib.HTTPConnection", "metadata": "root.BaseClient.get_connection_type", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 285 }, { "content": " def _authenticate(self, force_reauth=False):\n \"\"\"\n Use the authentication plugin to authenticate and set the auth token.\n\n :param force_reauth: For re-authentication to bypass cache.\n \"\"\"\n auth_plugin = self.auth_plugin\n\n if not auth_plugin.is_authenticated or force_reauth:\n auth_plugin.authenticate()\n\n self.auth_tok = auth_plugin.auth_token\n\n management_url = auth_plugin.management_url\n if management_url:\n self.configure_from_url(management_url)", "metadata": "root.BaseClient._authenticate", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 294 }, { "content": " @handle_unauthorized\n def do_request(self, method, action, body=None, headers=None,\n params=None):\n \"\"\"\n Make a request, returning an HTTP response object.\n\n :param method: HTTP verb (GET, POST, PUT, etc.)\n :param action: Requested path to append to self.doc_root\n :param body: Data to send in the body of the request\n :param headers: Headers to send with the request\n :param params: Key/value pairs to use in query string\n :returns: HTTP response object\n \"\"\"\n if not self.auth_tok:\n self._authenticate()\n\n url = self._construct_url(action, params)\n\n return self._do_request(method=method, url=url, body=body,\n headers=headers)", "metadata": "root.BaseClient.do_request", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 311 }, { "content": " def _construct_url(self, action, params=None):\n \"\"\"\n Create a URL object we can use to pass to _do_request().\n \"\"\"\n path = '/'.join([self.doc_root or '', action.lstrip('/')])\n scheme = \"https\" if self.use_ssl else \"http\"\n netloc = \"%s:%d\" % (self.host, self.port)\n\n if isinstance(params, dict):\n for (key, value) in params.items():\n if value is None:\n del params[key]\n query = urllib.urlencode(params)\n else:\n query = None\n\n return urlparse.ParseResult(scheme, netloc, path, '', query, '')", "metadata": "root.BaseClient._construct_url", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 332 }, { "content": " @handle_redirects\n def _do_request(self, method, url, body, headers):\n \"\"\"\n Connects to the server and issues a request. Handles converting\n any returned HTTP error status codes to OpenStack/Glance exceptions\n and closing the server connection. Returns the result data, or\n raises an appropriate exception.\n\n :param method: HTTP method (\"GET\", \"POST\", \"PUT\", etc...)\n :param url: urlparse.ParsedResult object with URL information\n :param body: data to send (as string, filelike or iterable),\n or None (default)\n :param headers: mapping of key/value pairs to add as headers\n\n :note\n\n If the body param has a read attribute, and method is either\n POST or PUT, this method will automatically conduct a chunked-transfer\n encoding and use the body as a file object or iterable, transferring\n chunks of data using the connection's send() method. This allows large\n objects to be transferred efficiently without buffering the entire\n body in memory.\n \"\"\"\n if url.query:\n path = url.path + \"?\" + url.query\n else:\n path = url.path\n\n try:\n connection_type = self.get_connection_type()\n headers = headers or {}\n\n if 'x-auth-token' not in headers and self.auth_tok:\n headers['x-auth-token'] = self.auth_tok\n\n c = connection_type(url.hostname, url.port, **self.connect_kwargs)\n\n def _pushing(method):\n return method.lower() in ('post', 'put')\n\n def _simple(body):\n return body is None or isinstance(body, basestring)\n\n def _filelike(body):\n return hasattr(body, 'read')\n\n def _iterable(body):\n return isinstance(body, collections.Iterable)\n\n # Do a simple request or a chunked request, depending\n # on whether the body param is file-like or iterable and\n # the method is PUT or POST\n #\n if not _pushing(method) or _simple(body):\n # Simple request...\n c.request(method, path, body, headers)\n elif _filelike(body) or _iterable(body):\n # Chunk it, baby...\n c.putrequest(method, path)\n\n for header, value in headers.items():\n c.putheader(header, value)\n c.putheader('Transfer-Encoding', 'chunked')\n c.endheaders()\n\n iter = body if _iterable(body) else ImageBodyIterator(body)\n\n for chunk in iter:\n c.send('%x\\r\\n%s\\r\\n' % (len(chunk), chunk))\n c.send('0\\r\\n\\r\\n')\n else:\n raise TypeError('Unsupported image type: %s' % body.__class__)\n\n res = c.getresponse()\n status_code = self.get_status_code(res)\n if status_code in self.OK_RESPONSE_CODES:\n return res\n elif status_code in self.REDIRECT_RESPONSE_CODES:\n raise exception.RedirectException(res.getheader('Location'))\n elif status_code == httplib.UNAUTHORIZED:\n raise exception.NotAuthorized(res.read())\n elif status_code == httplib.FORBIDDEN:\n raise exception.NotAuthorized(res.read())\n elif status_code == httplib.NOT_FOUND:\n raise exception.NotFound(res.read())\n elif status_code == httplib.CONFLICT:\n raise exception.Duplicate(res.read())\n elif status_code == httplib.BAD_REQUEST:\n raise exception.Invalid(res.read())\n elif status_code == httplib.MULTIPLE_CHOICES:\n raise exception.MultipleChoices(body=res.read())\n elif status_code == httplib.INTERNAL_SERVER_ERROR:\n raise Exception(\"Internal Server error: %s\" % res.read())\n else:\n raise Exception(\"Unknown error occurred! %s\" % res.read())\n\n except (socket.error, IOError), e:\n raise exception.ClientConnectionError(e)", "metadata": "root.BaseClient._do_request", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 350 }, { "content": " def get_status_code(self, response):\n \"\"\"\n Returns the integer status code from the response, which\n can be either a Webob.Response (used in testing) or httplib.Response\n \"\"\"\n if hasattr(response, 'status_int'):\n return response.status_int\n else:\n return response.status", "metadata": "root.BaseClient.get_status_code", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 449 }, { "content": " def _extract_params(self, actual_params, allowed_params):\n \"\"\"\n Extract a subset of keys from a dictionary. The filters key\n will also be extracted, and each of its values will be returned\n as an individual param.\n\n :param actual_params: dict of keys to filter\n :param allowed_params: list of keys that 'actual_params' will be\n reduced to\n :retval subset of 'params' dict\n \"\"\"\n try:\n # expect 'filters' param to be a dict here\n result = dict(actual_params.get('filters'))\n except TypeError:\n result = {}\n\n for allowed_param in allowed_params:\n if allowed_param in actual_params:\n result[allowed_param] = actual_params[allowed_param]\n\n return result", "metadata": "root.BaseClient._extract_params", "header": "['class', 'BaseClient', '(', 'object', ')', ':', '___EOS___']", "index": 459 } ]
[ { "span": "import logging", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "vim", ":", " ", "tabs", "top", "=", "4", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2010", "-", "2011", " ", "Open", "Stack", ",", " ", "LLC", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "Rig", "hts", " ", "Reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", " ", "you", " ", "may", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", " ", "You", " ", "may", " ", "obtain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", " ", "WITH", "OUT_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", " ", "limit", "ations_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HTTP", "SC", "lien", "t", "Auth", "Connect", "ion", " ", "code", " ", "come", "s", " ", "court", "es", "y", " ", "of", " ", "Activ", "e", "State", " ", "webs", "ite", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "577", "548", "-", "https", "-", "http", "lib", "-", "client", "-", "connecti", "on", "-", "with", "-", "certifica", "te", "-", "v", "/_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "httplib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "eventlet_", "._", "green_", "import_", "socket_", ",_", "ssl_", "\\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_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ssl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "glance_", "._", "common_", "import_", "auth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "glance_", "._", "common_", "import_", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "common", " ", "chunk", " ", "size", " ", "for", " ", "get", " ", "and", " ", "put_", "\\u\\u\\uNL\\u\\u\\u_", "CHUNK", "SIZE_", "=_", "65536_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "handle", "\\u", "unauthorized", "_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wra", "p", " ", "a", " ", "function", " ", "to", " ", "re", "-", "authenticat", "e", " ", "and", " ", "retr", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "functools_", "._", "wraps_", "(_", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "wrapped_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "func_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Not", "Authorized", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "authenticate_", "(_", "force", "\\u", "rea", "uth_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "func_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\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_", "handle", "\\u", "redirects_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Wra", "p", " ", "the", " ", "\\u", "do", "\\u", "request", " ", "function", " ", "to", " ", "handle", " ", "HTTP", " ", "redirec", "ts", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "MAX", "\\u", "REDIRECT", "S_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "functools_", "._", "wraps_", "(_", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "wrapped_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "\\u_", "in_", "xrange_", "(_", "MAX", "\\u", "REDIRECT", "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_", "func_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "exception_", "._", "Redirect", "Exception_", "as_", "redirect_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "redirect_", "._", "url_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "exception_", "._", "Inva", "lid", "Redirect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "redirect_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "exception_", "._", "Max", "Redirect", "s", "Exce", "eded", "_", "(_", "redirects_", "=_", "MAX", "\\u", "REDIRECT", "S_", ")_", "\\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_", "Image", "Bod", "y", "Iterator_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "class", " ", "tha", "t", " ", "acts", " ", "as", " ", "an", " ", "iter", "ator", " ", "over", " ", "an", " ", "image", " ", "file", "'", "s", "\\", "10", ";", " ", " ", " ", " ", "chunks", " ", "of", " ", "data", ".", " ", " ", "Thi", "s", " ", "is", " ", "return", "ed", " ", "as", " ", "part", " ", "of", " ", "the", " ", "result", "\\", "10", ";", " ", " ", " ", " ", "tuple", " ", "from", " ", "`", "gla", "nce", ".", "client", ".", "Client", ".", "get", "\\u", "image", "`", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Image", "Bod", "y", "Iterator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "source_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Construct", "s", " ", "the", " ", "object", " ", "from", " ", "a", " ", "reada", "ble", " ", "image", " ", "source", "\\", "10", ";", " ", " ", " ", " ", "(", "suc", "h", " ", "as", " ", "an", " ", "HTTP", "Respons", "e", " ", "or", " ", "file", "-", "like", " ", "object", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source_", "=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Bod", "y", "Iterator_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Expos", "es", " ", "an", " ", "iter", "ator", " ", "over", " ", "the", " ", "chunks", " ", "of", " ", "data", " ", "in", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "image", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chunk_", "=_", "self_", "._", "source_", "._", "read_", "(_", "CHUNK", "SIZE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "chunk_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "chunk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "HTTP", "SC", "lien", "t", "Auth", "Connection_", "(_", "httplib_", "._", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Class", " ", "to", " ", "make", " ", "a", " ", "HTTP", "S", " ", "connecti", "on", ",", " ", "with", " ", "support", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "full", " ", "client", "-", "based", " ", "SS", "L", " ", "Auth", "entica", "tion", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "see", " ", "http", "://", "code", ".", "active", "state", ".", "com", "/", "recip", "es", "/", "\\", "10", ";", " ", " ", " ", " ", "577", "548", "-", "https", "-", "http", "lib", "-", "client", "-", "connecti", "on", "-", "with", "-", "certifica", "te", "-", "v", "/", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "SC", "lien", "t", "Auth", "Connection_", "(_", "httplib_", "._", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "port_", ",_", "key", "\\u", "file_", ",_", "cert", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ca", "\\u", "file_", ",_", "timeout_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "httplib_", "._", "HTTP", "SC", "onnect", "ion_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "port_", ",_", "key", "\\u", "file_", "=_", "key", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cert", "\\u", "file_", "=_", "cert", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "key", "\\u", "file_", "=_", "key", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cert", "\\u", "file_", "=_", "cert", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ca", "\\u", "file_", "=_", "ca", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "timeout_", "=_", "timeout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "HTTP", "SC", "lien", "t", "Auth", "Connection_", "(_", "httplib_", "._", "HTTP", "SC", "onnect", "ion_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "connect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", " ", "to", " ", "a", " ", "host", " ", "on", " ", "a", " ", "give", "n", " ", "(", "SS", "L", ")", " ", "port", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "ca", "\\u", "file", " ", "is", " ", "pointi", "ng", " ", "some", "where", ",", " ", "use", " ", "it", " ", "to", " ", "check", " ", "Server", " ", "Certificat", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Red", "efin", "ed", "/", "copie", "d", " ", "and", " ", "extend", "ed", " ", "from", " ", "http", "lib", ".", "py", ":", "110", "5", " ", "(", "Pyth", "on", " ", "2.6", ".", "x", ").", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "need", "ed", " ", "to", " ", "pass", " ", "cert", "\\u", "reqs", "=", "ssl", ".", "CERT", "\\u", "REQUIRE", "D", " ", "as", " ", "parameter", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "ssl", ".", "wrap", "\\u", "socket", "()", ",", " ", "whi", "ch", " ", "force", "s", " ", "SS", "L", " ", "to", " ", "check", " ", "server", " ", "certifica", "te", " ", "against", "\\", "10", ";", " ", " ", " ", " ", "our", " ", "client", " ", "certifica", "te", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sock_", "=_", "socket_", "._", "create", "\\u", "connection_", "(_", "(_", "self_", "._", "host_", ",_", "self_", "._", "port_", ")_", ",_", "self_", "._", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "tunnel", "\\u", "host_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "=_", "sock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "tunnel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "there", "'", "s", " ", "no", " ", "CA", " ", "File", ",", " ", "don", "'", "t", " ", "force", " ", "Server", " ", "Certificat", "e", " ", "Check_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ca", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sock_", "=_", "ssl_", "._", "wrap", "\\u", "socket_", "(_", "sock_", ",_", "self_", "._", "key", "\\u", "file_", ",_", "self_", "._", "cert", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ca", "\\u", "certs_", "=_", "self_", "._", "ca", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cert", "\\u", "reqs_", "=_", "ssl_", "._", "CERT", "\\u", "REQUIRED_", ")_", "\\u\\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_", "._", "sock_", "=_", "ssl_", "._", "wrap", "\\u", "socket_", "(_", "sock_", ",_", "self_", "._", "key", "\\u", "file_", ",_", "self_", "._", "cert", "\\u", "file_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cert", "\\u", "reqs_", "=_", "ssl_", "._", "CERT", "\\u", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "A", " ", "base", " ", "client", " ", "class", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "PORT_", "=_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "DEF", "AUL", "T", "\\u", "DOC", "\\u", "ROOT_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "OK", "\\u", "RESPONSE", "\\u", "CODES_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "OK_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "CREATED_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "ACCEPTED", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "NO", "\\u", "CONTENT_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "REDIRECT", "\\u", "RESPONSE", "\\u", "CODES_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "MOVE", "D", "\\u", "PERM", "AN", "ENT", "LY_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "FOUND_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "SEE", "\\u", "OTHER", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "USE", "\\u", "PROX", "Y_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "httplib_", "._", "TEMP", "ORA", "RY", "\\u", "REDIRECT", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", ",_", "port_", "=_", "None_", ",_", "use", "\\u", "ssl_", "=_", "False_", ",_", "auth", "\\u", "tok_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "creds_", "=_", "None_", ",_", "doc", "\\u", "root_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "file_", "=_", "None_", ",_", "cert", "\\u", "file_", "=_", "None_", ",_", "ca", "\\u", "file_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "es", " ", "a", " ", "new", " ", "client", " ", "to", " ", "some", " ", "service", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "host", ":", " ", "The", " ", "host", " ", "where", " ", "service", " ", "reside", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "port", ":", " ", "The", " ", "port", " ", "where", " ", "service", " ", "reside", "s", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "use", "\\u", "ssl", ":", " ", "Sho", "ul", "d", " ", "we", " ", "use", " ", "HTTP", "S", "?", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "auth", "\\u", "tok", ":", " ", "The", " ", "auth", " ", "token", " ", "to", " ", "pass", " ", "to", " ", "the", " ", "server", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "creds", ":", " ", "The", " ", "cred", "ential", "s", " ", "to", " ", "pass", " ", "to", " ", "the", " ", "auth", " ", "plugin", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "doc", "\\u", "root", ":", " ", "Pref", "ix", " ", "for", " ", "all", " ", "URL", "s", " ", "we", " ", "request", " ", "from", " ", "host", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "key", "\\u", "file", ":", " ", "Optio", "nal", " ", "PEM", "-", "format", "ted", " ", "file", " ", "tha", "t", " ", "contain", "s", " ", "the", " ", "private", "\\", "10", ";", " ", " ", " ", "key", ".", "\\", "10", ";", " ", " ", " ", "If", " ", "use", "\\u", "ssl", " ", "is", " ", "Tru", "e", ",", " ", "and", " ", "this", " ", "param", " ", "is", " ", "Non", "e", " ", "(", "the", "\\", "10", ";", " ", " ", " ", "default", "),", " ", "then", " ", "an", " ", "environ", " ", "variab", "le", "\\", "10", ";", " ", " ", " ", "GL", "ANCE", "\\u", "CLIENT", "\\u", "KEY", "\\u", "FILE", " ", "is", " ", "looke", "d", " ", "for", ".", " ", "If", " ", "no", " ", "suc", "h", "\\", "10", ";", " ", " ", " ", "environ", " ", "variab", "le", " ", "is", " ", "found", ",", " ", "Client", "Connect", "ion", "Error", "\\", "10", ";", " ", " ", " ", "will", " ", "be", " ", "raise", "d", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "cert", "\\u", "file", ":", " ", "Optio", "nal", " ", "PEM", "-", "format", "ted", " ", "certifica", "te", " ", "chain", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "use", "\\u", "ssl", " ", "is", " ", "Tru", "e", ",", " ", "and", " ", "this", " ", "param", " ", "is", " ", "Non", "e", " ", "(", "the", "\\", "10", ";", " ", " ", " ", " ", "default", "),", " ", "then", " ", "an", " ", "environ", " ", "variab", "le", "\\", "10", ";", " ", " ", " ", " ", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CERT", "\\u", "FILE", " ", "is", " ", "looke", "d", " ", "for", ".", " ", "If", " ", "no", " ", "suc", "h", "\\", "10", ";", " ", " ", " ", " ", "environ", " ", "variab", "le", " ", "is", " ", "found", ",", " ", "Client", "Connect", "ion", "Error", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "raise", "d", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "ca", "\\u", "file", ":", " ", "Optio", "nal", " ", "CA", " ", "cert", " ", "file", " ", "to", " ", "use", " ", "in", " ", "SS", "L", " ", "connections", "\\", "10", ";", " ", " ", "If", " ", "use", "\\u", "ssl", " ", "is", " ", "Tru", "e", ",", " ", "and", " ", "this", " ", "param", " ", "is", " ", "Non", "e", " ", "(", "the", "\\", "10", ";", " ", " ", "default", "),", " ", "then", " ", "an", " ", "environ", " ", "variab", "le", "\\", "10", ";", " ", " ", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CA", "\\u", "FILE", " ", "is", " ", "looke", "d", " ", "for", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "host_", "=_", "host_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port_", "=_", "port_", "or_", "self_", "._", "DEF", "AUL", "T", "\\u", "PORT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "use", "\\u", "ssl_", "=_", "use", "\\u", "ssl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth", "\\u", "tok_", "=_", "auth", "\\u", "tok_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "creds_", "=_", "creds_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "doc", "\\u", "root", " ", "can", " ", "be", " ", "a", " ", "null", "string", ",", " ", "whi", "ch", " ", "is", " ", "valid", ",", " ", "and", " ", "wh", "y", " ", "we", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "cann", "ot", " ", "simp", "ly", " ", "do", " ", "doc", "\\u", "root", " ", "or", " ", "self", ".", "DEF", "AUL", "T", "\\u", "DOC", "\\u", "ROO", "T", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "doc", "\\u", "root_", "=_", "(_", "doc", "\\u", "root_", "if_", "doc", "\\u", "root_", "is_", "not_", "None_", "\\u\\u\\uNL\\u\\u\\u_", "else_", "self_", "._", "DEF", "AUL", "T", "\\u", "DOC", "\\u", "ROOT_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "auth", "\\u", "plugin_", "=_", "self_", "._", "make", "\\u", "auth", "\\u", "plugin_", "(_", "self_", "._", "creds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connect", "\\u", "kwargs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "use", "\\u", "ssl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "key", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "environ_", "._", "get_", "(_", "'", "GL", "ANCE", "\\u", "CLIENT", "\\u", "KEY", "\\u", "FILE", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "\\u_", "(_", "\"", "You", " ", "have", " ", "selecte", "d", " ", "to", " ", "use", " ", "SS", "L", " ", "in", " ", "connecti", "ng", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "how", "ever", " ", "you", " ", "have", " ", "fail", "ed", " ", "to", " ", "supply", " ", "eit", "her", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "\\u", "file", " ", "parameter", " ", "or", " ", "set", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "GL", "ANCE", "\\u", "CLIENT", "\\u", "KEY", "\\u", "FILE", " ", "environ", " ", "variab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exception_", "._", "Client", "Connect", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "key", "\\u", "file_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "GL", "ANCE", "\\u", "CLIENT", "\\u", "KEY", "\\u", "FILE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "key", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\\u_", "(_", "\"", "The", " ", "key", " ", "file", " ", "you", " ", "specified", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "\"_", ")_", "%_", "key", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exception_", "._", "Client", "Connect", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connect", "\\u", "kwargs_", "[_", "'", "key", "\\u", "file", "'_", "]_", "=_", "key", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "cert", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "environ_", "._", "get_", "(_", "'", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CERT", "\\u", "FILE", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "\\u_", "(_", "\"", "You", " ", "have", " ", "selecte", "d", " ", "to", " ", "use", " ", "SS", "L", " ", "in", " ", "connecti", "ng", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "how", "ever", " ", "you", " ", "have", " ", "fail", "ed", " ", "to", " ", "supply", " ", "eit", "her", " ", "a", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cert", "\\u", "file", " ", "parameter", " ", "or", " ", "set", " ", "the", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CERT", "\\u", "FILE", " ", "environ", " ", "variab", "le", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exception_", "._", "Client", "Connect", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cert", "\\u", "file_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CERT", "\\u", "FILE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "cert", "\\u", "file_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\\u_", "(_", "\"", "The", " ", "key", " ", "file", " ", "you", " ", "specified", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "exist", "\"_", ")_", "%_", "cert", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "exception_", "._", "Client", "Connect", "ion", "Error_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connect", "\\u", "kwargs_", "[_", "'", "cert", "\\u", "file", "'_", "]_", "=_", "cert", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "ca", "\\u", "file_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ca", "\\u", "file_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "GL", "ANCE", "\\u", "CLIENT", "\\u", "CA", "\\u", "FILE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connect", "\\u", "kwargs_", "[_", "'", "ca", "\\u", "file", "'_", "]_", "=_", "ca", "\\u", "file_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "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", "auth", "\\u", "token_", "(_", "self_", ",_", "auth", "\\u", "tok_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Update", "s", " ", "the", " ", "authenticat", "ion", " ", "token", " ", "for", " ", "this", " ", "client", " ", "connecti", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "FIX", "ME", "(", "sir", "p", "):", " ", "Nov", "a", " ", "image", "/", "gla", "nce", ".", "py", " ", "currentl", "y", " ", "calls", " ", "this", ".", " ", "Sin", "ce", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "method", " ", "isn", "'", "t", " ", "reall", "y", " ", "doi", "ng", " ", "anyt", "hing", " ", "usef", "ul", "[", "1", "],", " ", "we", " ", "shou", "ld", " ", "go", " ", "ahe", "ad", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rip", " ", "it", " ", "out", ",", " ", "first", " ", "in", " ", "Nov", "a", ",", " ", "then", " ", "here", ".", " ", "Step", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "1", ".", " ", "Change", " ", "auth", "\\u", "tok", " ", "in", " ", "Glance", " ", "to", " ", "auth", "\\u", "token_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "2", ".", " ", "Change", " ", "image", "/", "gla", "nce", ".", "py", " ", "in", " ", "Nov", "a", " ", "to", " ", "use", " ", "client", ".", "auth", "\\u", "token_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "3", ".", " ", "Remove", " ", "this", " ", "method_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "[", "1", "]", " ", "http", "://", "mail", ".", "python", ".", "org", "/", "pipe", "rma", "il", "/", "tut", "or", "/", "2003", "-", "Oct", "obe", "r", "/", "025", "932", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "auth", "\\u", "tok_", "=_", "auth", "\\u", "tok_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "configur", "e\\u", "from", "\\u", "url_", "(_", "self_", ",_", "url_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "ups", " ", "the", " ", "connecti", "on", " ", "based", " ", "on", " ", "the", " ", "give", "n", " ", "url", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "form", " ", "is", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "<", "http", "|", "https", ">:", "//", "<", "host", ">:", "port", "/", "doc", "\\u", "root", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parsed_", "=_", "urlparse_", "._", "urlparse_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "use", "\\u", "ssl_", "=_", "parsed_", "._", "scheme_", "==_", "'", "https", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "host_", "=_", "parsed_", "._", "hostname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "port_", "=_", "parsed_", "._", "port_", "or_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "doc", "\\u", "root_", "=_", "parsed_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "make", "\\u", "auth", "\\u", "plugin_", "(_", "self_", ",_", "creds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "an", " ", "instantiate", "d", " ", "authenticat", "ion", " ", "plugin", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "strategy_", "=_", "creds_", "._", "get_", "(_", "'", "strat", "eg", "y", "'_", ",_", "'", "noa", "uth", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugin", "\\u", "class_", "=_", "auth_", "._", "get", "\\u", "plugin", "\\u", "from", "\\u", "strategy_", "(_", "strategy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plugin_", "=_", "plugin", "\\u", "class_", "(_", "creds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "connecti", "on", "\\u", "type_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "proper", " ", "connecti", "on", " ", "type", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "use", "\\u", "ssl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "HTTP", "SC", "lien", "t", "Auth", "Connection_", "\\u\\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_", "httplib_", "._", "HTTP", "Connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "authenticate_", "(_", "self_", ",_", "force", "\\u", "rea", "uth_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "the", " ", "authenticat", "ion", " ", "plugin", " ", "to", " ", "authenticat", "e", " ", "and", " ", "set", " ", "the", " ", "auth", " ", "token", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "force", "\\u", "rea", "uth", ":", " ", "For", " ", "re", "-", "authenticat", "ion", " ", "to", " ", "bypass", " ", "cache", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "auth", "\\u", "plugin_", "=_", "self_", "._", "auth", "\\u", "plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "auth", "\\u", "plugin_", "._", "is", "\\u", "authenticated_", "or_", "force", "\\u", "rea", "uth_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "auth", "\\u", "plugin_", "._", "authenticate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "auth", "\\u", "tok_", "=_", "auth", "\\u", "plugin_", "._", "auth", "\\u", "token_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "manage", "ment", "\\u", "url_", "=_", "auth", "\\u", "plugin_", "._", "manage", "ment", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "manage", "ment", "\\u", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "configur", "e\\u", "from", "\\u", "url_", "(_", "manage", "ment", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "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_", "@_", "handle", "\\u", "unauthorized", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "do", "\\u", "request_", "(_", "self_", ",_", "method_", ",_", "action_", ",_", "body_", "=_", "None_", ",_", "headers_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "a", " ", "request", ",", " ", "return", "ing", " ", "an", " ", "HTTP", " ", "response", " ", "object", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "method", ":", " ", "HTTP", " ", "verb", " ", "(", "GET", ",", " ", "POST", ",", " ", "PU", "T", ",", " ", "etc", ".)", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "action", ":", " ", "Requeste", "d", " ", "path", " ", "to", " ", "append", " ", "to", " ", "self", ".", "doc", "\\u", "root", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "body", ":", " ", "Data", " ", "to", " ", "send", " ", "in", " ", "the", " ", "body", " ", "of", " ", "the", " ", "request", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "header", "s", ":", " ", "Head", "ers", " ", "to", " ", "send", " ", "with", " ", "the", " ", "request", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "params", ":", " ", "Key", "/", "value", " ", "pair", "s", " ", "to", " ", "use", " ", "in", " ", "query", " ", "string", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "HTTP", " ", "response", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "auth", "\\u", "tok_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "authenticate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "self_", "._", "\\u", "construct", "\\u", "url_", "(_", "action_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "\\u", "do", "\\u", "request_", "(_", "method_", "=_", "method_", ",_", "url_", "=_", "url_", ",_", "body_", "=_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "construct", "\\u", "url_", "(_", "self_", ",_", "action_", ",_", "params_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "URL", " ", "object", " ", "we", " ", "can", " ", "use", " ", "to", " ", "pass", " ", "to", " ", "\\u", "do", "\\u", "request", "()", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "path_", "=_", "'/'_", "._", "join_", "(_", "[_", "self_", "._", "doc", "\\u", "root_", "or_", "''_", ",_", "action_", "._", "lstrip_", "(_", "'/'_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scheme_", "=_", "\"", "https", "\"_", "if_", "self_", "._", "use", "\\u", "ssl_", "else_", "\"", "http", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "netloc_", "=_", "\"%", "s", ":", "%", "d", "\"_", "%_", "(_", "self_", "._", "host_", ",_", "self_", "._", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "params_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "(_", "key_", ",_", "value_", ")_", "in_", "params_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "value_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "params_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "query_", "=_", "urllib_", "._", "urlencode_", "(_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "urlparse_", "._", "Pars", "e", "Result_", "(_", "scheme_", ",_", "netloc_", ",_", "path_", ",_", "''_", ",_", "query_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "handle", "\\u", "redirects_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "do", "\\u", "request_", "(_", "self_", ",_", "method_", ",_", "url_", ",_", "body_", ",_", "headers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Connect", "s", " ", "to", " ", "the", " ", "server", " ", "and", " ", "issue", "s", " ", "a", " ", "request", ".", " ", " ", "Handle", "s", " ", "convert", "ing", "\\", "10", ";", " ", " ", " ", " ", "any", " ", "return", "ed", " ", "HTTP", " ", "error", " ", "status", " ", "codes", " ", "to", " ", "Open", "Stack", "/", "Glance", " ", "exception", "s", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "clos", "ing", " ", "the", " ", "server", " ", "connecti", "on", ".", " ", "Return", "s", " ", "the", " ", "result", " ", "data", ",", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "raise", "s", " ", "an", " ", "appropr", "iate", " ", "exception", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "method", ":", " ", "HTTP", " ", "method", " ", "(\"", "GET", "\",", " ", "\"", "POST", "\",", " ", "\"", "PU", "T", "\",", " ", "etc", "...)", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "url", ":", " ", "urlpa", "rse", ".", "Pars", "ed", "Result", " ", "object", " ", "with", " ", "URL", " ", "informati", "on", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "body", ":", " ", "data", " ", "to", " ", "send", " ", "(", "as", " ", "string", ",", " ", "fileli", "ke", " ", "or", " ", "iterable", "),", "\\", "10", ";", " ", " ", " ", "or", " ", "Non", "e", " ", "(", "default", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "header", "s", ":", " ", "mapping", " ", "of", " ", "key", "/", "value", " ", "pair", "s", " ", "to", " ", "add", " ", "as", " ", "header", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "note", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "the", " ", "body", " ", "param", " ", "has", " ", "a", " ", "read", " ", "attribute", ",", " ", "and", " ", "method", " ", "is", " ", "eit", "her", "\\", "10", ";", " ", " ", " ", " ", "POST", " ", "or", " ", "PU", "T", ",", " ", "this", " ", "method", " ", "will", " ", "automati", "call", "y", " ", "conduct", " ", "a", " ", "chunked", "-", "transfer", "\\", "10", ";", " ", " ", " ", " ", "encoding", " ", "and", " ", "use", " ", "the", " ", "body", " ", "as", " ", "a", " ", "file", " ", "object", " ", "or", " ", "iterable", ",", " ", "transfer", "ring", "\\", "10", ";", " ", " ", " ", " ", "chunks", " ", "of", " ", "data", " ", "usi", "ng", " ", "the", " ", "connecti", "on", "'", "s", " ", "send", "()", " ", "method", ".", " ", "Thi", "s", " ", "allow", "s", " ", "large", "\\", "10", ";", " ", " ", " ", " ", "object", "s", " ", "to", " ", "be", " ", "transferred", " ", "efficien", "tl", "y", " ", "with", "out", " ", "bufferi", "ng", " ", "the", " ", "entire", "\\", "10", ";", " ", " ", " ", " ", "body", " ", "in", " ", "memory", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "url_", "._", "query_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "url_", "._", "path_", "+_", "\"?\"_", "+_", "url_", "._", "query_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "path_", "=_", "url_", "._", "path_", "\\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 ", " _", "connecti", "on", "\\u", "type_", "=_", "self_", "._", "get", "\\u", "connecti", "on", "\\u", "type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "headers_", "=_", "headers_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "x", "-", "auth", "-", "token", "'_", "not_", "in_", "headers_", "and_", "self_", "._", "auth", "\\u", "tok_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "[_", "'", "x", "-", "auth", "-", "token", "'_", "]_", "=_", "self_", "._", "auth", "\\u", "tok_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "connecti", "on", "\\u", "type_", "(_", "url_", "._", "hostname_", ",_", "url_", "._", "port_", ",_", "**_", "self_", "._", "connect", "\\u", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "push", "ing_", "(_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "method_", "._", "lower_", "(_", ")_", "in_", "(_", "'", "post", "'_", ",_", "'", "put", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "simple_", "(_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "body_", "is_", "None_", "or_", "isinstance_", "(_", "body_", ",_", "basestring_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "fileli", "ke_", "(_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "hasattr_", "(_", "body_", ",_", "'", "read", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "iterable_", "(_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "body_", ",_", "collections_", "._", "Iterable_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "a", " ", "simple", " ", "request", " ", "or", " ", "a", " ", "chunked", " ", "request", ",", " ", "depend", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "on", " ", "whe", "ther", " ", "the", " ", "body", " ", "param", " ", "is", " ", "file", "-", "like", " ", "or", " ", "iterable", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "method", " ", "is", " ", "PU", "T", " ", "or", " ", "POST_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "\\u", "push", "ing_", "(_", "method_", ")_", "or_", "\\u", "simple_", "(_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Simple", " ", "request", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "request_", "(_", "method_", ",_", "path_", ",_", "body_", ",_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "\\u", "fileli", "ke_", "(_", "body_", ")_", "or_", "\\u", "iterable_", "(_", "body_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Chunk", " ", "it", ",", " ", "baby", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "put", "request_", "(_", "method_", ",_", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "header_", ",_", "value_", "in_", "headers_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "c_", "._", "put", "header_", "(_", "header_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "._", "put", "header_", "(_", "'", "Transfer", "-", "Enco", "ding", "'_", ",_", "'", "chunked", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "end", "headers_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "iter_", "=_", "body_", "if_", "\\u", "iterable_", "(_", "body_", ")_", "else_", "Image", "Bod", "y", "Iterator_", "(_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "chunk_", "in_", "iter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "c_", "._", "send_", "(_", "'%", "x", "\\\\", "r", "\\\\", "n", "%", "s", "\\\\", "r", "\\\\", "n", "'_", "%_", "(_", "len_", "(_", "chunk_", ")_", ",_", "chunk_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "._", "send_", "(_", "'", "0", "\\\\", "r", "\\\\", "n", "\\\\", "r", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Type", "Error_", "(_", "'", "Unsu", "ppo", "rted", " ", "image", " ", "type", ":", " ", "%", "s", "'_", "%_", "body_", "._", "\\u\\u", "class\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "c_", "._", "getresponse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "status", "\\u", "code_", "=_", "self_", "._", "get", "\\u", "status", "\\u", "code_", "(_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "status", "\\u", "code_", "in_", "self_", "._", "OK", "\\u", "RESPONSE", "\\u", "CODES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "in_", "self_", "._", "REDIRECT", "\\u", "RESPONSE", "\\u", "CODES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Redirect", "Exception_", "(_", "res_", "._", "getheader_", "(_", "'", "Locat", "ion", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "UNA", "UTH", "ORI", "ZED", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Not", "Authorized", "_", "(_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "FORB", "IDD", "EN_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Not", "Authorized", "_", "(_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "NOT", "\\u", "FOUND_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Not", "Found_", "(_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "CONF", "LIC", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Duplicate", "_", "(_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "BAD", "\\u", "REQUEST_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Invalid_", "(_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "MULTIPLE", "\\u", "CHOICES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Multipl", "e", "Choices_", "(_", "body_", "=_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "status", "\\u", "code_", "==_", "httplib_", "._", "INTERN", "AL", "\\u", "SERVER", "\\u", "ERROR_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Intern", "al", " ", "Server", " ", "error", ":", " ", "%", "s", "\"_", "%_", "res_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "\"", "Un", "know", "n", " ", "error", " ", "occur", "red", "!", " ", "%", "s", "\"_", "%_", "res_", "._", "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_", "(_", "socket_", "._", "error_", ",_", "IO", "Error_", ")_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "exception_", "._", "Client", "Connect", "ion", "Error_", "(_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "status", "\\u", "code_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "integ", "er", " ", "status", " ", "code", " ", "from", " ", "the", " ", "response", ",", " ", "whi", "ch", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "eit", "her", " ", "a", " ", "Web", "ob", ".", "Respons", "e", " ", "(", "used", " ", "in", " ", "testi", "ng", ")", " ", "or", " ", "http", "lib", ".", "Respons", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "response_", ",_", "'", "status", "\\u", "int", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "status", "\\u", "int_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "response_", "._", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Client_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "extract", "\\u", "params_", "(_", "self_", ",_", "actual", "\\u", "params_", ",_", "allow", "ed", "\\u", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Extract", " ", "a", " ", "subse", "t", " ", "of", " ", "keys", " ", "from", " ", "a", " ", "dictionar", "y", ".", " ", "The", " ", "filter", "s", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "als", "o", " ", "be", " ", "extracted", ",", " ", "and", " ", "each", " ", "of", " ", "its", " ", "values", " ", "will", " ", "be", " ", "return", "ed", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "an", " ", "individual", " ", "param", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "actual", "\\u", "params", ":", " ", "dict", " ", "of", " ", "keys", " ", "to", " ", "filter", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "allow", "ed", "\\u", "params", ":", " ", "list", " ", "of", " ", "keys", " ", "tha", "t", " ", "'", "actual", "\\u", "params", "'", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", " ", "reduce", "d", " ", "to", "\\", "10", ";", " ", " ", " ", " ", ":", "ret", "val", " ", "subse", "t", " ", "of", " ", "'", "params", "'", " ", "dict", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "expect", " ", "'", "filter", "s", "'", " ", "param", " ", "to", " ", "be", " ", "a", " ", "dict", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "dict_", "(_", "actual", "\\u", "params_", "._", "get_", "(_", "'", "filter", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "allow", "ed", "\\u", "param_", "in_", "allow", "ed", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "allow", "ed", "\\u", "param_", "in_", "actual", "\\u", "params_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "[_", "allow", "ed", "\\u", "param_", "]_", "=_", "actual", "\\u", "params_", "[_", "allow", "ed", "\\u", "param_", "]_", "\\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_", "result_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
inpho/topic-explorer/topicexplorer/extensions/htrc.py
[ { "content": "from collections import defaultdict\nimport json\nimport os.path\nimport numpy as np\n\nfrom vsm.viewer.wrappers import doc_label_name, def_label_fn\nfrom topicexplorer.lib.hathitrust import parse_marc, get_volume_from_marc\n\nlda_v = None\nmetadata = None\ncontext_type = None\n\n\nctx_md = keydefaultdict(lambda ctx: lda_v.corpus.view_metadata(ctx))\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class keydefaultdict(defaultdict):\n # http://stackoverflow.com/a/2912455", "metadata": "root.keydefaultdict", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __missing__(self, key):\n if self.default_factory is None:\n raise KeyError( key )\n else:\n ret = self[key] = self.default_factory(key)\n return ret", "metadata": "root.keydefaultdict.__missing__", "header": "['class', 'keydefaultdict', '(', 'defaultdict', ')', ':', '___NEWLINE___', '# http://stackoverflow.com/a/2912455', '___NL___', '___EOS___']", "index": 14 }, { "content": "def init(viewer, config, args):\n global metadata\n global lda_v\n global context_type\n \n lda_v = viewer\n\n model_path = config.get('main', 'path')\n context_type = config.get('main', 'context_type')\n\n filename = os.path.join(model_path,'../metadata.json')\n print \"Loading HTRC metadata from\", filename\n\n with open(filename) as f:\n metadata = json.load(f)", "metadata": "root.init", "header": "['module', '___EOS___']", "index": 23 }, { "content": "def label(doc):\n if context_type == 'book':\n try:\n md = metadata[doc]\n return md['title'][0]\n except:\n return doc\n elif context_type == 'page':\n context_md = ctx_md['page']\n where = np.squeeze(np.where(np.in1d(context_md['page_label'], [doc])))\n page_no = context_md['file'][where]\n page_no = page_no.split('/')[-1]\n page_no = page_no.replace('.txt','')\n page_no = int(page_no)\n\n book_label = context_md['book_label'][where]\n md = metadata[book_label]\n try:\n xml = parse_marc(md['fullrecord'].encode('utf8'))\n vol = get_volume_from_marc(xml[0])\n return \"p%s of %s of %s\" % (page_no, vol, md['title'][0])\n except:\n pass\n try:\n return \"p%s of %s\" % (page_no, md['title'][0])\n except:\n return doc", "metadata": "root.label", "header": "['module', '___EOS___']", "index": 39 }, { "content": "def id_fn(md):\n context_md = lda_v.corpus.view_metadata(context_type)\n ctx_label = doc_label_name(context_type)\n return context_md[ctx_label] ", "metadata": "root.id_fn", "header": "['module', '___EOS___']", "index": 67 } ]
[ { "span": "from vsm.viewer.wrappers import doc_label_name, def_label_fn", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 60 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "collections_", "import_", "defaultdict_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "._", "path_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "vs", "m_", "._", "viewer_", "._", "wrappers_", "import_", "doc", "\\u", "label", "\\u", "name_", ",_", "def", "\\u", "label", "\\u", "fn_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "topic", "explorer", "_", "._", "lib_", "._", "hat", "hit", "rust", "_", "import_", "parse", "\\u", "marc", "_", ",_", "get", "\\u", "volume", "\\u", "from", "\\u", "marc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lda", "\\u", "v_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx", "\\u", "md_", "=_", "keyd", "efa", "ult", "dict_", "(_", "lambda_", "ctx_", ":_", "lda", "\\u", "v_", "._", "corpus_", "._", "view", "\\u", "metadata_", "(_", "ctx_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "class_", "keyd", "efa", "ult", "dict_", "(_", "defaultdict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "291", "245", "5_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "keyd", "efa", "ult", "dict_", "(_", "defaultdict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "http", "://", "stack", "overflow", ".", "com", "/", "a", "/", "291", "245", "5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "missi", "ng", "\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "default", "\\u", "factory_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "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 ", " _", "ret_", "=_", "self_", "[_", "key_", "]_", "=_", "self_", "._", "default", "\\u", "factory_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "init_", "(_", "viewer_", ",_", "config_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "metadata_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "lda", "\\u", "v_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "context", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lda", "\\u", "v_", "=_", "viewer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "path_", "=_", "config_", "._", "get_", "(_", "'", "main", "'_", ",_", "'", "path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context", "\\u", "type_", "=_", "config_", "._", "get_", "(_", "'", "main", "'_", ",_", "'", "context", "\\u", "type", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "model", "\\u", "path_", ",_", "'../", "metadata", ".", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"", "Load", "ing", " ", "HT", "RC", " ", "metadata", " ", "from", "\"_", ",_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "filename_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metadata_", "=_", "json_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "label_", "(_", "doc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "context", "\\u", "type_", "==_", "'", "book", "'_", ":_", "\\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 ", " _", "md_", "=_", "metadata_", "[_", "doc_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "md_", "[_", "'", "title", "'_", "]_", "[_", "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_", "doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "context", "\\u", "type_", "==_", "'", "page", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context", "\\u", "md_", "=_", "ctx", "\\u", "md_", "[_", "'", "page", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "where_", "=_", "np_", "._", "squeeze_", "(_", "np_", "._", "where_", "(_", "np_", "._", "in1", "d_", "(_", "context", "\\u", "md_", "[_", "'", "page", "\\u", "label", "'_", "]_", ",_", "[_", "doc_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "no_", "=_", "context", "\\u", "md_", "[_", "'", "file", "'_", "]_", "[_", "where_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "no_", "=_", "page", "\\u", "no_", "._", "split_", "(_", "'/'_", ")_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "no_", "=_", "page", "\\u", "no_", "._", "replace_", "(_", "'.", "txt", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "page", "\\u", "no_", "=_", "int_", "(_", "page", "\\u", "no_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "book", "\\u", "label_", "=_", "context", "\\u", "md_", "[_", "'", "book", "\\u", "label", "'_", "]_", "[_", "where_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "md_", "=_", "metadata_", "[_", "book", "\\u", "label_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xml_", "=_", "parse", "\\u", "marc", "_", "(_", "md_", "[_", "'", "full", "record", "'_", "]_", "._", "encode_", "(_", "'", "utf", "8", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vol_", "=_", "get", "\\u", "volume", "\\u", "from", "\\u", "marc", "_", "(_", "xml_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\"", "p", "%", "s", " ", "of", " ", "%", "s", " ", "of", " ", "%", "s", "\"_", "%_", "(_", "page", "\\u", "no_", ",_", "vol_", ",_", "md_", "[_", "'", "title", "'_", "]_", "[_", "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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "p", "%", "s", " ", "of", " ", "%", "s", "\"_", "%_", "(_", "page", "\\u", "no_", ",_", "md_", "[_", "'", "title", "'_", "]_", "[_", "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_", "doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\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_", "id", "\\u", "fn_", "(_", "md_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context", "\\u", "md_", "=_", "lda", "\\u", "v_", "._", "corpus_", "._", "view", "\\u", "metadata_", "(_", "context", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx", "\\u", "label_", "=_", "doc", "\\u", "label", "\\u", "name_", "(_", "context", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "context", "\\u", "md_", "[_", "ctx", "\\u", "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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
cournape/Bento/sandbox/wininst2egg.py
[ { "content": "import os\nimport sys\nimport zipfile\nimport tempfile\nimport struct\nimport base64\nimport shutil\n\nfrom cStringIO import StringIO\n\nimport bento\nfrom bento.installed_package_description \\\n import \\\n InstalledPkgDescription\nfrom bento.commands.build_egg \\\n import \\\n build_egg\n\n\nif __name__ == \"__main__\":\n from bento.commands.wininst_utils import get_exe_bytes\n if len(sys.argv) < 2:\n WININST = \"bento-0.0.3dev-py2.6.win32.exe\"\n else:\n WININST = sys.argv[1]\n\n ipkg = read_ipkg(WININST)\n tmpdir = tempfile.mkdtemp()\n\n z = zipfile.ZipFile(WININST)\n try:\n z.extractall(path=tmpdir)\n build_egg(ipkg, source_root=os.path.join(tmpdir, \"PURELIB\"), path=\".\")\n finally:\n z.close()\n shutil.rmtree(tmpdir)\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def read_ipkg(wininst):\n # See eof_cdir size in archive.h of bdist_wininst sources\n eof_cdir_n = 22\n eof_cdir_tag = 0x06054b50\n\n meta_n = 12\n\n stat_info = os.stat(WININST)\n inst_size = stat_info.st_size\n\n with open(WININST, \"rb\") as fid:\n fid.seek(-eof_cdir_n, 2)\n s = fid.read(4)\n tag = struct.unpack(\"<l\", s)[0]\n if not tag == eof_cdir_tag:\n raise ValueError(\"Unexpected bits\")\n fid.read(2 * 4)\n s = fid.read(4)\n nBytesCDir = struct.unpack(\"<l\", s)[0]\n s = fid.read(4)\n ofsCDir = struct.unpack(\"<l\", s)[0]\n\n arc_start = inst_size - eof_cdir_n - nBytesCDir - ofsCDir\n ofs = arc_start - meta_n\n fid.seek(ofs, 0)\n s = fid.read(4)\n tag = struct.unpack(\"<l\", s)[0]\n if not tag == 0x1234567B:\n raise ValueError(\"Unexpected bits\")\n\n s = fid.read(4)\n uncomp_size = struct.unpack(\"<l\", s)[0]\n\n s = fid.read(4)\n bitmap_size = struct.unpack(\"<l\", s)[0]\n pexe_size = ofs - uncomp_size - bitmap_size\n\n fid.seek(pexe_size, 0)\n data = fid.read(uncomp_size)\n\n from ConfigParser import ConfigParser\n parser = ConfigParser()\n sdata = StringIO(data)\n\n def truncate_null(sdata):\n cur = sdata.tell()\n sdata.seek(0, 2)\n nbytes = sdata.tell()\n try:\n n = 10\n sdata.seek(-n, 2)\n null_ind = sdata.read().find(\"\\0\")\n sdata.truncate(nbytes - (n-null_ind))\n finally:\n sdata.seek(cur, 0)\n truncate_null(sdata)\n parser.readfp(sdata)\n raise ValueError(\"YO - fix wininst METADATA\")\n ipkg_str = base64.b64decode(parser.get(\"IPKG_INFO\", \"value\"))\n\n ipkg = InstalledPkgDescription.from_string(ipkg_str)\n return ipkg", "metadata": "root.read_ipkg", "header": "['module', '___EOS___']", "index": 18 } ]
[ { "span": "import bento", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 12 }, { "span": "from bento.commands.wininst_utils import get_exe_bytes", "start_line": 82, "start_column": 4, "end_line": 82, "end_column": 58 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "zipfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "struct_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "c", "String", "IO_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ben", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ben", "to_", "._", "install", "ed", "\\u", "package", "\\u", "description_", "import_", "Install", "ed", "Pk", "g", "Description_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ben", "to_", "._", "commands_", "._", "build", "\\u", "egg", "_", "import_", "build", "\\u", "egg", "_", "\\u\\u\\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 ", " _", "from_", "ben", "to_", "._", "commands_", "._", "win", "inst", "\\u", "utils_", "import_", "get", "\\u", "exe", "\\u", "bytes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "sys_", "._", "argv_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WIN", "INST", "_", "=_", "\"", "ben", "to", "-0", ".0", ".3", "dev", "-", "py2", ".6", ".", "win32", ".", "exe", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "WIN", "INST", "_", "=_", "sys_", "._", "argv_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ip", "kg_", "=_", "read", "\\u", "ip", "kg_", "(_", "WIN", "INST", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmpdir_", "=_", "tempfile_", "._", "mkdtemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "z_", "=_", "zipfile_", "._", "Zip", "File_", "(_", "WIN", "INST", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "z_", "._", "extracta", "ll_", "(_", "path_", "=_", "tmpdir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "\\u", "egg", "_", "(_", "ip", "kg_", ",_", "source", "\\u", "root_", "=_", "os_", "._", "path_", "._", "join_", "(_", "tmpdir_", ",_", "\"", "PUR", "ELI", "B", "\"_", ")_", ",_", "path_", "=_", "\".\"_", ")_", "\\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 ", " _", "z_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shutil_", "._", "rmtree_", "(_", "tmpdir_", ")_", "\\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_", "read", "\\u", "ip", "kg_", "(_", "win", "inst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "See", " ", "eof", "\\u", "cdi", "r", " ", "size", " ", "in", " ", "archive", ".", "h", " ", "of", " ", "bdist", "\\u", "win", "inst", " ", "sources_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eof", "\\u", "cdi", "r", "\\u", "n_", "=_", "22_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eof", "\\u", "cdi", "r", "\\u", "tag_", "=_", "0x06", "054", "b5", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "meta", "\\u", "n_", "=_", "12_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stat", "\\u", "info_", "=_", "os_", "._", "stat_", "(_", "WIN", "INST", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inst", "\\u", "size_", "=_", "stat", "\\u", "info_", "._", "st", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "WIN", "INST", "_", ",_", "\"", "rb", "\"_", ")_", "as_", "fid_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fid_", "._", "seek_", "(_", "-_", "eof", "\\u", "cdi", "r", "\\u", "n_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "tag_", "==_", "eof", "\\u", "cdi", "r", "\\u", "tag_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "bits", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fid_", "._", "read_", "(_", "2_", "*_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "Byte", "s", "CD", "ir_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ofs", "CD", "ir_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "arc", "\\u", "start_", "=_", "inst", "\\u", "size_", "-_", "eof", "\\u", "cdi", "r", "\\u", "n_", "-_", "n", "Byte", "s", "CD", "ir_", "-_", "ofs", "CD", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ofs_", "=_", "arc", "\\u", "start_", "-_", "meta", "\\u", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fid_", "._", "seek_", "(_", "ofs_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tag_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "tag_", "==_", "0x12", "3456", "7", "B_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "bits", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uncom", "p", "\\u", "size_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "fid_", "._", "read_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bitmap", "\\u", "size_", "=_", "struct_", "._", "unpack_", "(_", "\"<", "l", "\"_", ",_", "s_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pex", "e\\u", "size_", "=_", "ofs_", "-_", "uncom", "p", "\\u", "size_", "-_", "bitmap", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fid_", "._", "seek_", "(_", "pex", "e\\u", "size_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "fid_", "._", "read_", "(_", "uncom", "p", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Config", "Parser_", "import_", "Config", "Parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "=_", "Config", "Parser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sdata", "_", "=_", "String", "IO_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "truncat", "e\\u", "null_", "(_", "sdata", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "=_", "sdata", "_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sdata", "_", "._", "seek_", "(_", "0_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nbytes_", "=_", "sdata", "_", "._", "tell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "n_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sdata", "_", "._", "seek_", "(_", "-_", "n_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "null", "\\u", "ind_", "=_", "sdata", "_", "._", "read_", "(_", ")_", "._", "find_", "(_", "\"\\\\", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sdata", "_", "._", "truncate_", "(_", "nbytes_", "-_", "(_", "n_", "-_", "null", "\\u", "ind_", ")_", ")_", "\\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 ", " _", "sdata", "_", "._", "seek_", "(_", "cur_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "truncat", "e\\u", "null_", "(_", "sdata", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parser_", "._", "readf", "p_", "(_", "sdata", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "\"", "YO", " ", "-", " ", "fix", " ", "win", "inst", " ", "METAD", "ATA", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip", "kg", "\\u", "str_", "=_", "base64_", "._", "b64decode_", "(_", "parser_", "._", "get_", "(_", "\"", "IP", "KG", "\\u", "INFO", "\"_", ",_", "\"", "value", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ip", "kg_", "=_", "Install", "ed", "Pk", "g", "Description_", "._", "from", "\\u", "string_", "(_", "ip", "kg", "\\u", "str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ip", "kg_", "\\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, 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, 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, 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 ]
Comparison using is when operands support `__eq__`
GoogleCloudPlatform/gcloud-python/gcloud/storage/test_bucket.py
[ { "content": " def test_lifecycle_rules_getter(self):\n NAME = 'name'\n LC_RULE = {'action': {'type': 'Delete'}, 'condition': {'age': 42}}\n rules = [LC_RULE]\n properties = {'lifecycle': {'rule': rules}}\n bucket = self._makeOne(name=NAME, properties=properties)\n self.assertEqual(bucket.lifecycle_rules, rules)\n # Make sure it's a copy\n self.assertFalse(bucket.lifecycle_rules is rules)", "metadata": "root.Test_Bucket.test_lifecycle_rules_getter", "header": "['class', 'Test_Bucket', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 612 }, { "content": " def test_cors_getter(self):\n NAME = 'name'\n CORS_ENTRY = {\n 'maxAgeSeconds': 1234,\n 'method': ['OPTIONS', 'GET'],\n 'origin': ['127.0.0.1'],\n 'responseHeader': ['Content-Type'],\n }\n properties = {'cors': [CORS_ENTRY, {}]}\n bucket = self._makeOne(name=NAME, properties=properties)\n entries = bucket.cors\n self.assertEqual(len(entries), 2)\n self.assertEqual(entries[0], CORS_ENTRY)\n self.assertEqual(entries[1], {})\n # Make sure it was a copy, not the same object.\n self.assertFalse(entries[0] is CORS_ENTRY)", "metadata": "root.Test_Bucket.test_cors_getter", "header": "['class', 'Test_Bucket', '(', 'unittest2', '.', 'TestCase', ')', ':', '___EOS___']", "index": 632 } ]
[ { "span": "bucket.lifecycle_rules is rules)", "start_line": 620, "start_column": 25, "end_line": 620, "end_column": 56 }, { "span": "entries[0] is CORS_ENTRY)", "start_line": 647, "start_column": 25, "end_line": 647, "end_column": 49 } ]
[]
1
false
[ "[CLS]_", "Compari", "son_", "using_", "is_", "when_", "operands_", "support_", " _", "`_", "\\u\\u", "eq\\u\\u_", "`_", "[SEP]_", "class_", "Test", "\\u", "Bucket_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "lifecycle", "\\u", "rule", "s", "\\u", "getter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "NAME_", "=_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "LC", "\\u", "RULE", "_", "=_", "{_", "'", "action", "'_", ":_", "{_", "'", "type", "'_", ":_", "'", "Delete", "'_", "}_", ",_", "'", "condition", "'_", ":_", "{_", "'", "age", "'_", ":_", "42_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "[_", "LC", "\\u", "RULE", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "properties_", "=_", "{_", "'", "lifecycle", "'_", ":_", "{_", "'", "rule", "'_", ":_", "rules_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bucket_", "=_", "self_", "._", "\\u", "make", "One_", "(_", "name_", "=_", "NAME_", ",_", "properties_", "=_", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "bucket_", "._", "lifecycle", "\\u", "rules_", ",_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "a", " ", "copy_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "bucket_", "._", "lifecycle", "\\u", "rules_", "is_", "rules_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "\\u", "Bucket_", "(_", "unittest2_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cors", "\\u", "getter_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "NAME_", "=_", "'", "name", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "CORS", "\\u", "ENTRY_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "Age", "Second", "s", "'_", ":_", "1234_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "method", "'_", ":_", "[_", "'", "OPTION", "S", "'_", ",_", "'", "GET", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orig", "in", "'_", ":_", "[_", "'", "127", ".0", ".0", ".1", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "Head", "er", "'_", ":_", "[_", "'", "Conten", "t", "-", "Type", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "properties_", "=_", "{_", "'", "cors", "'_", ":_", "[_", "CORS", "\\u", "ENTRY_", ",_", "{_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bucket_", "=_", "self_", "._", "\\u", "make", "One_", "(_", "name_", "=_", "NAME_", ",_", "properties_", "=_", "properties_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "entries_", "=_", "bucket_", "._", "cors", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "entries_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entries_", "[_", "0_", "]_", ",_", "CORS", "\\u", "ENTRY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "entries_", "[_", "1_", "]_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "it", " ", "was", " ", "a", " ", "copy", ",", " ", "not", " ", "the", " ", "same", " ", "object", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "entries_", "[_", "0_", "]_", "is_", "CORS", "\\u", "ENTRY_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
adafruit/io-client-python/tests/test_client.py
[ { "content": " def test_append_by_feed_name(self):\n io = self.get_client()\n self.ensure_feed_deleted(io, 'TestFeed')\n feed = io.create_feed(Feed(name='TestFeed'))\n result = io.append('TestFeed', 42)\n self.assertEqual(int(result.value), 42)", "metadata": "root.TestClient.test_append_by_feed_name", "header": "['class', 'TestClient', '(', 'base', '.', 'IOTestCase', ')', ':', '___NEWLINE___', '___NL___', \"# If your IP isn't put on the list of non-throttled IPs, uncomment the\", '___NL___', '# function below to waste time between tests to prevent throttling.', '___NL___', '#def tearDown(self):', '___NL___', '# time.sleep(30.0)', '___NL___', '___EOS___']", "index": 113 }, { "content": " @unittest.expectedFailure\n def test_delete_group(self):\n io = self.get_client()\n self.ensure_group_deleted(io, 'GroupDeleteTest')\n group = io.create_group(Group(name='GroupDeleteTest'))\n io.delete_group('GroupDeleteTest')\n self.assertRaises(RequestError, io.groups, 'GroupDeleteTest')", "metadata": "root.TestClient.test_delete_group", "header": "['class', 'TestClient', '(', 'base', '.', 'IOTestCase', ')', ':', '___NEWLINE___', '___NL___', \"# If your IP isn't put on the list of non-throttled IPs, uncomment the\", '___NL___', '# function below to waste time between tests to prevent throttling.', '___NL___', '#def tearDown(self):', '___NL___', '# time.sleep(30.0)', '___NL___', '___EOS___']", "index": 248 } ]
[ { "span": "feed ", "start_line": 116, "start_column": 8, "end_line": 116, "end_column": 12 }, { "span": "group ", "start_line": 252, "start_column": 8, "end_line": 252, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "IO", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "IP", " ", "isn", "'", "t", " ", "put", " ", "on", " ", "the", " ", "list", " ", "of", " ", "non", "-", "throttle", "d", " ", "IP", "s", ",", " ", "uncomm", "ent", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", " ", "belo", "w", " ", "to", " ", "wast", "e", " ", "time", " ", "bet", "ween", " ", "tests", " ", "to", " ", "prevent", " ", "thro", "ttl", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "tear", "Down", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "time", ".", "sleep", "(", "30.", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "append", "\\u", "by", "\\u", "feed", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "io_", "=_", "self_", "._", "get", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ensure", "\\u", "feed", "\\u", "deleted_", "(_", "io_", ",_", "'", "Test", "Feed", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "feed_", "=_", "io_", "._", "create", "\\u", "feed_", "(_", "Feed_", "(_", "name_", "=_", "'", "Test", "Feed", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "io_", "._", "append_", "(_", "'", "Test", "Feed", "'_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "int_", "(_", "result_", "._", "value_", ")_", ",_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Client_", "(_", "base_", "._", "IO", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "IP", " ", "isn", "'", "t", " ", "put", " ", "on", " ", "the", " ", "list", " ", "of", " ", "non", "-", "throttle", "d", " ", "IP", "s", ",", " ", "uncomm", "ent", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "function", " ", "belo", "w", " ", "to", " ", "wast", "e", " ", "time", " ", "bet", "ween", " ", "tests", " ", "to", " ", "prevent", " ", "thro", "ttl", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "def", " ", "tear", "Down", "(", "self", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "time", ".", "sleep", "(", "30.", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "unittest_", "._", "expected", "Failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "group_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "io_", "=_", "self_", "._", "get", "\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ensure", "\\u", "group", "\\u", "deleted_", "(_", "io_", ",_", "'", "Group", "Delete", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group_", "=_", "io_", "._", "create", "\\u", "group_", "(_", "Group_", "(_", "name_", "=_", "'", "Group", "Delete", "Test", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "io_", "._", "delete", "\\u", "group_", "(_", "'", "Group", "Delete", "Test", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Request", "Error_", ",_", "io_", "._", "groups_", ",_", "'", "Group", "Delete", "Test", "'_", ")_", "\\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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
baskoopmans/djcommon/djcommon/templatetags/common.py
[ { "content": "# encoding: utf-8\n\nimport re\nimport urllib\n\nfrom django import template\nfrom django.template.defaultfilters import stringfilter\nfrom django.template import Template, Variable, TemplateSyntaxError\nfrom django.http import HttpResponse\nfrom django.db.models.query import QuerySet\n\nfrom django.template.loader_tags import BlockNode, ExtendsNode\nfrom django.template import loader, Context, RequestContext, TextNode\n\nfrom djcommon.helpers import random_slice_list\n\nregister = template.Library()\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ncleartags.is_safe = True\n\n\ncut.is_safe = True\n\nreplace.is_safe = True\n\nnowhitespace.is_safe = True\n\ncleanwhitespace.is_safe = True\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def get_template(template):\n if isinstance(template, (tuple, list)):\n return loader.select_template(template)\n return loader.get_template(template)", "metadata": "root.get_template", "header": "['module', '___EOS___']", "index": 19 }, { "content": "class BlockNotFound(Exception):\n pass", "metadata": "root.BlockNotFound", "header": "['module', '___EOS___']", "index": 24 }, { "content": "def render_template_block(template, block, context):\n \"\"\"\n Renders a single block from a template. This template should have previously been rendered.\n \"\"\"\n return render_template_block_nodelist(template.nodelist, block, context)", "metadata": "root.render_template_block", "header": "['module', '___EOS___']", "index": 27 }, { "content": "def render_template_block_nodelist(nodelist, block, context):\n for node in nodelist:\n if isinstance(node, BlockNode) and node.name == block:\n return node.render(context)\n for key in ('nodelist', 'nodelist_true', 'nodelist_false'):\n if hasattr(node, key):\n try:\n return render_template_block_nodelist(getattr(node, key), block, context)\n except:\n pass\n for node in nodelist:\n if isinstance(node, ExtendsNode):\n try:\n return render_template_block(node.get_parent(context), block, context)\n except BlockNotFound:\n pass\n raise BlockNotFound(block)", "metadata": "root.render_template_block_nodelist", "header": "['module', '___EOS___']", "index": 33 }, { "content": "def render_block_to_string(template_name, block, dictionary=None, context_instance=None):\n \"\"\"\n Loads the given template_name and renders the given block with the given dictionary as\n context. Returns a string.\n \"\"\"\n import re\n\n dictionary = dictionary or {}\n t = get_template(template_name)\n if context_instance:\n context_instance.update(dictionary)\n else:\n context_instance = Context(dictionary)\n template_block = render_template_block(t, block, context_instance)\n return re.sub(r'\\s+', ' ', template_block)", "metadata": "root.render_block_to_string", "header": "['module', '___EOS___']", "index": 51 }, { "content": "def direct_block_to_template(request, template, block, extra_context=None, mimetype=None, **kwargs):\n \"\"\"\n Render a given block in a given template with any extra URL parameters in the context as\n ``{{ params }}``.\n \"\"\"\n if extra_context is None:\n extra_context = {}\n dictionary = {'params': kwargs}\n for key, value in extra_context.items():\n if callable(value):\n dictionary[key] = value()\n else:\n dictionary[key] = value\n c = RequestContext(request, dictionary)\n t = get_template(template)\n t.render(c)\n return HttpResponse(render_template_block(t, block, c), mimetype=mimetype)", "metadata": "root.direct_block_to_template", "header": "['module', '___EOS___']", "index": 67 }, { "content": "class RenderAsTemplateNode(template.Node):\n", "metadata": "root.RenderAsTemplateNode", "header": "['module', '___EOS___']", "index": 86 }, { "content": " def __init__(self, item_to_be_rendered):\n self.item_to_be_rendered = Variable(item_to_be_rendered)", "metadata": "root.RenderAsTemplateNode.__init__", "header": "['class', 'RenderAsTemplateNode', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 87 }, { "content": " def render(self, context):\n try:\n actual_item = self.item_to_be_rendered.resolve(context)\n return Template(actual_item).render(context)\n except template.VariableDoesNotExist:\n return ''", "metadata": "root.RenderAsTemplateNode.render", "header": "['class', 'RenderAsTemplateNode', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 90 }, { "content": "@register.tag\ndef render_as_template(parser, token):\n bits = token.split_contents()\n if len(bits) !=2:\n raise TemplateSyntaxError(\"'%s' takes only one argument (a variable representing a template to render)\" % bits[0])\n return RenderAsTemplateNode(bits[1])", "metadata": "root.render_as_template", "header": "['module', '___EOS___']", "index": 98 }, { "content": "class RenderTemplateBlockNode(template.Node):\n", "metadata": "root.RenderTemplateBlockNode", "header": "['module', '___EOS___']", "index": 106 }, { "content": " def __init__(self, template_name, block_name):\n self.template_name = template_name\n self.block_name = block_name", "metadata": "root.RenderTemplateBlockNode.__init__", "header": "['class', 'RenderTemplateBlockNode', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 107 }, { "content": " def render(self, context):\n #template_name = RenderAsTemplateNode(self.template_name).render(context)\n #template = loader.get_template('pages/'+template_name).render(context)\n return render_block_to_string('base.html', self.block_name[1:-1], context)", "metadata": "root.RenderTemplateBlockNode.render", "header": "['class', 'RenderTemplateBlockNode', '(', 'template', '.', 'Node', ')', ':', '___EOS___']", "index": 111 }, { "content": "@register.tag('render_template_block')\ndef render_template_block_tag(parser, token):\n try:\n # split_contents() knows not to split quoted strings.\n tag_name, template_name, block_name = token.split_contents()\n except ValueError:\n raise TemplateSyntaxError(\"'%s' takes two arguments (a variable representing a template and a block name)\" % tag_name)\n if not (block_name[0] == block_name[-1] and block_name[0] in ('\"', \"'\")):\n raise template.TemplateSyntaxError(\"%r tag's argument (block_name) should be in quotes\" % tag_name)\n return RenderTemplateBlockNode(template_name, block_name)", "metadata": "root.render_template_block_tag", "header": "['module', '___EOS___']", "index": 116 }, { "content": "@register.filter_function\ndef random_slice(value, arg=1):\n \"\"\"\n Returns one or more random item(s) from the list or if it's a queryset a new filtered queryset.\n \"\"\"\n try:\n arg = int(arg)\n except ValueError:\n raise Exception('Invalid argument: %s' % arg)\n\n if type(value) == QuerySet:\n pks = list(value.values_list('pk', flat=True))\n random_pks = random_slice_list(pks, arg)\n return value.filter(pk__in=random_pks)\n elif type(value) == list:\n return random_slice_list(value, arg)\n else:\n return value[:arg]", "metadata": "root.random_slice", "header": "['module', '___EOS___']", "index": 127 }, { "content": "@register.filter(name='zip')\ndef zip_lists(a, b):\n return zip(a, b)", "metadata": "root.zip_lists", "header": "['module', '___EOS___']", "index": 146 }, { "content": "@register.filter\n@stringfilter\ndef cleartags(value, tags):\n tags = [re.escape(tag) for tag in tags.split()]\n tags_re = u'(%s)' % u'|'.join(tags)\n clear_re = re.compile(\"<\\s*%s[^>]*>(.*?)<\\s*/\\s*\\\\1>\" % tags_re, re.U)\n value = clear_re.sub('', value)\n return value", "metadata": "root.cleartags", "header": "['module', '___EOS___']", "index": 150 }, { "content": "@register.filter\n@stringfilter\ndef split(str, splitter):\n \"Splits the string for with the given splitter\"\n return str.split(splitter)", "metadata": "root.split", "header": "['module', '___EOS___']", "index": 160 }, { "content": "@register.filter\n@stringfilter\ndef cut(value, arg):\n \"Removes all values of arg from the given string\"\n return value.replace(arg, '')", "metadata": "root.cut", "header": "['module', '___EOS___']", "index": 166 }, { "content": "@register.filter\n@stringfilter\ndef replace(value, arg):\n \"Replaces all arg in the given string\"\n arg = arg.split()\n return value.replace(arg[0], arg[1])", "metadata": "root.replace", "header": "['module', '___EOS___']", "index": 173 }, { "content": "@register.filter\ndef nowhitespace(value):\n \"Removes all whitespace from the given string\"\n return u\"\".join(value.split())", "metadata": "root.nowhitespace", "header": "['module', '___EOS___']", "index": 181 }, { "content": "@register.filter\ndef cleanwhitespace(value):\n \"Removes all multiple whitespace from the given string\"\n return u\" \".join(value.split())", "metadata": "root.cleanwhitespace", "header": "['module', '___EOS___']", "index": 187 }, { "content": "@register.filter\n@stringfilter\ndef startswith(value, arg):\n \"Checks if the given string starts with arg\"\n return value.startswith(arg)", "metadata": "root.startswith", "header": "['module', '___EOS___']", "index": 193 }, { "content": "@register.filter\n@stringfilter\ndef endswith(value, arg):\n \"Checks if the given string ends with arg\"\n return value.endswith(arg)", "metadata": "root.endswith", "header": "['module', '___EOS___']", "index": 199 }, { "content": "@register.filter\n@stringfilter\ndef urlunquote(value):\n \"Unquote a url\"\n return urllib.unquote(value)", "metadata": "root.urlunquote", "header": "['module', '___EOS___']", "index": 205 } ]
[ { "span": "from django.template import loader, Context, RequestContext, TextNode", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 69 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "encoding", ":", " ", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "import_", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "default", "filters_", "import_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "Template_", ",_", "Variable_", ",_", "Templa", "te", "Syntax", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "query_", "import_", "Query", "Set_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "template_", "._", "load", "er", "\\u", "tags_", "import_", "Block", "Node_", ",_", "Extend", "s", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "template_", "import_", "loader_", ",_", "Context_", ",_", "Request", "Context_", ",_", "Text", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "dj", "common_", "._", "helpers_", "import_", "random", "\\u", "slice", "\\u", "list_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "register_", "=_", "template_", "._", "Library_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "clear", "tags_", "._", "is", "\\u", "safe_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cut_", "._", "is", "\\u", "safe_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "replace_", "._", "is", "\\u", "safe_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "now", "hit", "espa", "ce_", "._", "is", "\\u", "safe_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "clean", "whitespace_", "._", "is", "\\u", "safe_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get", "\\u", "template_", "(_", "template_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "template_", ",_", "(_", "tuple_", ",_", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "loader_", "._", "select", "\\u", "template_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "loader_", "._", "get", "\\u", "template_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Block", "Not", "Found_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "template", "\\u", "block_", "(_", "template_", ",_", "block_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Render", "s", " ", "a", " ", "single", " ", "block", " ", "from", " ", "a", " ", "template", ".", " ", "Thi", "s", " ", "template", " ", "shou", "ld", " ", "have", " ", "previ", "ously", " ", "bee", "n", " ", "render", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "render", "\\u", "template", "\\u", "block", "\\u", "nodelist_", "(_", "template_", "._", "nodelist_", ",_", "block_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "template", "\\u", "block", "\\u", "nodelist_", "(_", "nodelist_", ",_", "block_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "node_", "in_", "nodelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "node_", ",_", "Block", "Node_", ")_", "and_", "node_", "._", "name_", "==_", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "node_", "._", "render_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "(_", "'", "nodel", "ist", "'_", ",_", "'", "nodel", "ist", "\\u", "true", "'_", ",_", "'", "nodel", "ist", "\\u", "fal", "se", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "node_", ",_", "key_", ")_", ":_", "\\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_", "render", "\\u", "template", "\\u", "block", "\\u", "nodelist_", "(_", "getattr_", "(_", "node_", ",_", "key_", ")_", ",_", "block_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "node_", "in_", "nodelist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "node_", ",_", "Extend", "s", "Node_", ")_", ":_", "\\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_", "render", "\\u", "template", "\\u", "block_", "(_", "node_", "._", "get", "\\u", "parent_", "(_", "context_", ")_", ",_", "block_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Block", "Not", "Found_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Block", "Not", "Found_", "(_", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render", "\\u", "block", "\\u", "to", "\\u", "string_", "(_", "template", "\\u", "name_", ",_", "block_", ",_", "dictionary_", "=_", "None_", ",_", "context", "\\u", "instance_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Load", "s", " ", "the", " ", "give", "n", " ", "template", "\\u", "name", " ", "and", " ", "render", "s", " ", "the", " ", "give", "n", " ", "block", " ", "with", " ", "the", " ", "give", "n", " ", "dictionar", "y", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "context", ".", " ", "Return", "s", " ", "a", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dictionary_", "=_", "dictionary_", "or_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "get", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "context", "\\u", "instance_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context", "\\u", "instance_", "._", "update_", "(_", "dictionary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "context", "\\u", "instance_", "=_", "Context_", "(_", "dictionary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "template", "\\u", "block_", "=_", "render", "\\u", "template", "\\u", "block_", "(_", "t_", ",_", "block_", ",_", "context", "\\u", "instance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "re_", "._", "sub_", "(_", "r", "'\\\\", "s", "+'_", ",_", "'", " ", "'_", ",_", "template", "\\u", "block_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "direct", "\\u", "block", "\\u", "to", "\\u", "template_", "(_", "request_", ",_", "template_", ",_", "block_", ",_", "extra", "\\u", "context_", "=_", "None_", ",_", "mimetype_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Render", " ", "a", " ", "give", "n", " ", "block", " ", "in", " ", "a", " ", "give", "n", " ", "template", " ", "with", " ", "any", " ", "extra", " ", "URL", " ", "parameter", "s", " ", "in", " ", "the", " ", "context", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "``", "{{", " ", "params", " ", "}}", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "extra", "\\u", "context_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "\\u", "context_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dictionary_", "=_", "{_", "'", "params", "'_", ":_", "kwargs_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "extra", "\\u", "context_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "callable_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dictionary_", "[_", "key_", "]_", "=_", "value_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dictionary_", "[_", "key_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "Request", "Context_", "(_", "request_", ",_", "dictionary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "=_", "get", "\\u", "template_", "(_", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "render_", "(_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Http", "Response_", "(_", "render", "\\u", "template", "\\u", "block_", "(_", "t_", ",_", "block_", ",_", "c_", ")_", ",_", "mimetype_", "=_", "mimetype_", ")_", "\\u\\u\\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_", "Render", "As", "Templa", "te", "Node_", "(_", "template_", "._", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Render", "As", "Templa", "te", "Node_", "(_", "template_", "._", "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_", ",_", "item", "\\u", "to", "\\u", "be", "\\u", "rendered_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "item", "\\u", "to", "\\u", "be", "\\u", "rendered_", "=_", "Variable_", "(_", "item", "\\u", "to", "\\u", "be", "\\u", "rendered_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Render", "As", "Templa", "te", "Node_", "(_", "template_", "._", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "actual", "\\u", "item_", "=_", "self_", "._", "item", "\\u", "to", "\\u", "be", "\\u", "rendered_", "._", "resolve_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Template_", "(_", "actual", "\\u", "item_", ")_", "._", "render_", "(_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "template_", "._", "Varia", "ble", "Do", "es", "Not", "Exist_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "tag_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "render", "\\u", "as", "\\u", "template_", "(_", "parser_", ",_", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bits_", "=_", "token_", "._", "split", "\\u", "contents_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "bits_", ")_", "!=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Syntax", "Error_", "(_", "\"'", "%", "s", "'", " ", "take", "s", " ", "only", " ", "one", " ", "argu", "ment", " ", "(", "a", " ", "variab", "le", " ", "represent", "ing", " ", "a", " ", "template", " ", "to", " ", "render", ")\"_", "%_", "bits_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Render", "As", "Templa", "te", "Node_", "(_", "bits_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Render", "Templa", "te", "Block", "Node_", "(_", "template_", "._", "Node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Render", "Templa", "te", "Block", "Node_", "(_", "template_", "._", "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_", ",_", "template", "\\u", "name_", ",_", "block", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "template", "\\u", "name_", "=_", "template", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "block", "\\u", "name_", "=_", "block", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Render", "Templa", "te", "Block", "Node_", "(_", "template_", "._", "Node_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "context_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "template", "\\u", "name", " ", "=", " ", "Render", "As", "Templa", "te", "Node", "(", "self", ".", "template", "\\u", "name", ").", "render", "(", "context", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "template", " ", "=", " ", "load", "er", ".", "get", "\\u", "template", "('", "page", "s", "/'", "+", "template", "\\u", "name", ").", "render", "(", "context", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "render", "\\u", "block", "\\u", "to", "\\u", "string_", "(_", "'", "base", ".", "html", "'_", ",_", "self_", "._", "block", "\\u", "name_", "[_", "1_", ":_", "-_", "1_", "]_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "tag_", "(_", "'", "render", "\\u", "template", "\\u", "block", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "render", "\\u", "template", "\\u", "block", "\\u", "tag_", "(_", "parser_", ",_", "token_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "split", "\\u", "content", "s", "()", " ", "knows", " ", "not", " ", "to", " ", "split", " ", "quoted", " ", "string", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tag", "\\u", "name_", ",_", "template", "\\u", "name_", ",_", "block", "\\u", "name_", "=_", "token_", "._", "split", "\\u", "contents_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Templa", "te", "Syntax", "Error_", "(_", "\"'", "%", "s", "'", " ", "take", "s", " ", "two", " ", "argu", "ment", "s", " ", "(", "a", " ", "variab", "le", " ", "represent", "ing", " ", "a", " ", "template", " ", "and", " ", "a", " ", "block", " ", "name", ")\"_", "%_", "tag", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "(_", "block", "\\u", "name_", "[_", "0_", "]_", "==_", "block", "\\u", "name_", "[_", "-_", "1_", "]_", "and_", "block", "\\u", "name_", "[_", "0_", "]_", "in_", "(_", "'\"'_", ",_", "\"'\"_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "template_", "._", "Templa", "te", "Syntax", "Error_", "(_", "\"%", "r", " ", "tag", "'", "s", " ", "argu", "ment", " ", "(", "block", "\\u", "name", ")", " ", "shou", "ld", " ", "be", " ", "in", " ", "quote", "s", "\"_", "%_", "tag", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Render", "Templa", "te", "Block", "Node_", "(_", "template", "\\u", "name_", ",_", "block", "\\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_", "@_", "register_", "._", "filter", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "random", "\\u", "slice_", "(_", "value_", ",_", "arg_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "one", " ", "or", " ", "more", " ", "random", " ", "item", "(", "s", ")", " ", "from", " ", "the", " ", "list", " ", "or", " ", "if", " ", "it", "'", "s", " ", "a", " ", "querys", "et", " ", "a", " ", "new", " ", "filter", "ed", " ", "querys", "et", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "arg_", "=_", "int_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Inva", "lid", " ", "argu", "ment", ":", " ", "%", "s", "'_", "%_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "value_", ")_", "==_", "Query", "Set_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pks", "_", "=_", "list_", "(_", "value_", "._", "values", "\\u", "list_", "(_", "'", "pk", "'_", ",_", "flat_", "=_", "True_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "random", "\\u", "pks", "_", "=_", "random", "\\u", "slice", "\\u", "list_", "(_", "pks", "_", ",_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "._", "filter_", "(_", "pk", "\\u\\u", "in_", "=_", "random", "\\u", "pks", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "type_", "(_", "value_", ")_", "==_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "random", "\\u", "slice", "\\u", "list_", "(_", "value_", ",_", "arg_", ")_", "\\u\\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_", "value_", "[_", ":_", "arg_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "(_", "name_", "=_", "'", "zip", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "zip", "\\u", "lists_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "zip_", "(_", "a_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "clear", "tags_", "(_", "value_", ",_", "tags_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tags_", "=_", "[_", "re_", "._", "escape_", "(_", "tag_", ")_", "for_", "tag_", "in_", "tags_", "._", "split_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tags", "\\u", "re_", "=_", "u", "'(", "%", "s", ")'_", "%_", "u", "'|'_", "._", "join_", "(_", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clear", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\"<", "\\\\", "s", "*", "%", "s", "[", "^", ">]", "*>", "(.*?)", "<\\\\", "s", "*/", "\\\\", "s", "*\\\\\\\\", "1", ">\"_", "%_", "tags", "\\u", "re_", ",_", "re_", "._", "U_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "clear", "\\u", "re_", "._", "sub_", "(_", "''_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "split_", "(_", "str_", ",_", "splitter_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Split", "s", " ", "the", " ", "string", " ", "for", " ", "with", " ", "the", " ", "give", "n", " ", "splitter", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "str_", "._", "split_", "(_", "splitter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "cut_", "(_", "value_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", "s", " ", "all", " ", "values", " ", "of", " ", "arg", " ", "from", " ", "the", " ", "give", "n", " ", "string", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "._", "replace_", "(_", "arg_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "replace_", "(_", "value_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Replace", "s", " ", "all", " ", "arg", " ", "in", " ", "the", " ", "give", "n", " ", "string", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arg_", "=_", "arg_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "._", "replace_", "(_", "arg_", "[_", "0_", "]_", ",_", "arg_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "now", "hit", "espa", "ce_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", "s", " ", "all", " ", "whitespace", " ", "from", " ", "the", " ", "give", "n", " ", "string", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "u", "\"\"_", "._", "join_", "(_", "value_", "._", "split_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "clean", "whitespace_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", "s", " ", "all", " ", "multiple", " ", "whitespace", " ", "from", " ", "the", " ", "give", "n", " ", "string", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "u", "\"", " ", "\"_", "._", "join_", "(_", "value_", "._", "split_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "startswith_", "(_", "value_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Check", "s", " ", "if", " ", "the", " ", "give", "n", " ", "string", " ", "starts", " ", "with", " ", "arg", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "._", "startswith_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "endswith_", "(_", "value_", ",_", "arg_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Check", "s", " ", "if", " ", "the", " ", "give", "n", " ", "string", " ", "ends", " ", "with", " ", "arg", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "value_", "._", "endswith_", "(_", "arg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "register_", "._", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "string", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "urlu", "nq", "uot", "e_", "(_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\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